From c5e54ec6e3e4a4ee60438b060091eacbae693be8 Mon Sep 17 00:00:00 2001 From: azure-powershell-bot <65331932+azure-powershell-bot@users.noreply.github.com> Date: Wed, 16 Oct 2024 04:48:24 +0000 Subject: [PATCH] [skip ci] Archive 9826124f1edb07d1697c40e95b226a279e6dec32 --- .../MSGraph.Autorest/Az.MSGraph.format.ps1xml | 246 +- .../MSGraph.Autorest/Az.MSGraph.psd1 | 4 +- .../MSGraph.Autorest/Az.MSGraph.psm1 | 24 +- .../MSGraph.Autorest/check-dependencies.ps1 | 6 +- .../exports/Add-AzADAppPermission.ps1 | 6 +- .../exports/Add-AzADGroupMember.ps1 | 9 +- .../exports/Get-AzADAppCredential.ps1 | 9 +- .../Get-AzADAppFederatedCredential.ps1 | 9 +- .../exports/Get-AzADAppPermission.ps1 | 6 +- .../exports/Get-AzADApplication.ps1 | 6 +- .../exports/Get-AzADGroup.ps1 | 6 +- .../exports/Get-AzADGroupMember.ps1 | 9 +- .../exports/Get-AzADGroupOwner.ps1 | 9 +- .../exports/Get-AzADOrganization.ps1 | 9 +- .../exports/Get-AzADServicePrincipal.ps1 | 9 +- ...-AzADServicePrincipalAppRoleAssignment.ps1 | 9 +- .../exports/Get-AzADSpCredential.ps1 | 9 +- .../MSGraph.Autorest/exports/Get-AzADUser.ps1 | 6 +- .../exports/New-AzADAppCredential.ps1 | 11 +- .../New-AzADAppFederatedCredential.ps1 | 6 +- .../exports/New-AzADApplication.ps1 | 36 +- .../exports/New-AzADGroup.ps1 | 18 +- .../exports/New-AzADGroupOwner.ps1 | 6 +- .../exports/New-AzADServicePrincipal.ps1 | 47 +- ...-AzADServicePrincipalAppRoleAssignment.ps1 | 6 +- .../exports/New-AzADSpCredential.ps1 | 11 +- .../MSGraph.Autorest/exports/New-AzADUser.ps1 | 8 +- .../exports/ProxyCmdletDefinitions.ps1 | 595 +- .../exports/Remove-AzADAppCredential.ps1 | 9 +- .../Remove-AzADAppFederatedCredential.ps1 | 9 +- .../exports/Remove-AzADAppPermission.ps1 | 6 +- .../exports/Remove-AzADApplication.ps1 | 9 +- .../exports/Remove-AzADGroup.ps1 | 9 +- .../exports/Remove-AzADGroupMember.ps1 | 9 +- .../exports/Remove-AzADGroupOwner.ps1 | 9 +- .../exports/Remove-AzADServicePrincipal.ps1 | 12 +- ...-AzADServicePrincipalAppRoleAssignment.ps1 | 9 +- .../exports/Remove-AzADSpCredential.ps1 | 9 +- .../exports/Remove-AzADUser.ps1 | 9 +- .../Update-AzADAppFederatedCredential.ps1 | 37 +- .../exports/Update-AzADApplication.ps1 | 37 +- .../exports/Update-AzADGroup.ps1 | 74 +- .../exports/Update-AzADServicePrincipal.ps1 | 47 +- ...-AzADServicePrincipalAppRoleAssignment.ps1 | 28 +- .../exports/Update-AzADUser.ps1 | 13 +- .../MSGraph.Autorest/generate-info.json | 2 +- .../MSGraph.Autorest/generated/Module.cs | 33 +- .../MSGraph.Autorest/generated/api/MSGraph.cs | 10765 ++++++++++++---- .../ApiV10/CollectionOfApplication.json.cs | 6 +- .../CollectionOfDirectoryObject.json.cs | 4 +- ...ionOfDirectoryObjectAutoGenerated2.json.cs | 4 +- .../Models/ApiV10/CollectionOfGroup.json.cs | 6 +- .../CollectionOfServicePrincipal.json.cs | 6 +- .../Models/ApiV10/CollectionOfUser.json.cs | 6 +- .../Models/ApiV10/MicrosoftGraphAddIn.json.cs | 6 +- .../MicrosoftGraphAdministrativeUnit.cs | 6 +- .../MicrosoftGraphAdministrativeUnit.json.cs | 12 +- ...ministrativeUnitCollectionResponse.json.cs | 4 +- ...icrosoftGraphAlternativeSecurityId.json.cs | 4 +- .../MicrosoftGraphApiApplication.json.cs | 10 +- .../ApiV10/MicrosoftGraphAppRole.json.cs | 14 +- .../ApiV10/MicrosoftGraphAppRoleAssignment.cs | 11 +- .../MicrosoftGraphAppRoleAssignment.json.cs | 16 +- ...softGraphAppRoleAssignmentAutoGenerated.cs | 6 +- ...raphAppRoleAssignmentAutoGenerated.json.cs | 16 +- ...ppRoleAssignmentCollectionResponse.json.cs | 4 +- .../ApiV10/MicrosoftGraphApplication.cs | 15 +- .../ApiV10/MicrosoftGraphApplication.json.cs | 72 +- .../ApiV10/MicrosoftGraphAssignedPlan.json.cs | 8 +- ...MicrosoftGraphCertificateAuthority.json.cs | 10 +- ...hCertificateBasedAuthConfiguration.json.cs | 2 +- .../MicrosoftGraphClaimsMappingPolicy.cs | 10 +- .../MicrosoftGraphClaimsMappingPolicy.json.cs | 4 +- .../Models/ApiV10/MicrosoftGraphContract.cs | 6 +- .../ApiV10/MicrosoftGraphContract.json.cs | 8 +- ...oftGraphContractCollectionResponse.json.cs | 4 +- ...hDelegatedPermissionClassification.json.cs | 8 +- .../api/Models/ApiV10/MicrosoftGraphDevice.cs | 6 +- .../ApiV10/MicrosoftGraphDevice.json.cs | 48 +- ...osoftGraphDeviceCollectionResponse.json.cs | 4 +- .../ApiV10/MicrosoftGraphDirectory.json.cs | 6 +- .../MicrosoftGraphDirectoryObject.json.cs | 8 +- ...hDirectoryObjectCollectionResponse.json.cs | 4 +- .../ApiV10/MicrosoftGraphDirectoryRole.cs | 6 +- .../MicrosoftGraphDirectoryRole.json.cs | 10 +- ...aphDirectoryRoleCollectionResponse.json.cs | 4 +- .../MicrosoftGraphDirectoryRoleTemplate.cs | 6 +- ...icrosoftGraphDirectoryRoleTemplate.json.cs | 4 +- ...toryRoleTemplateCollectionResponse.json.cs | 4 +- .../ApiV10/MicrosoftGraphDomain.json.cs | 34 +- ...osoftGraphDomainCollectionResponse.json.cs | 4 +- .../MicrosoftGraphDomainDnsRecord.json.cs | 10 +- ...hDomainDnsRecordCollectionResponse.json.cs | 4 +- .../ApiV10/MicrosoftGraphDomainState.json.cs | 6 +- .../MicrosoftGraphEmployeeOrgData.json.cs | 4 +- .../Models/ApiV10/MicrosoftGraphEndpoint.cs | 6 +- .../ApiV10/MicrosoftGraphEndpoint.json.cs | 12 +- .../ApiV10/MicrosoftGraphEntity.json.cs | 2 +- .../MicrosoftGraphEntityAutoGenerated.json.cs | 2 +- ...ftGraphExtensionCollectionResponse.json.cs | 4 +- .../ApiV10/MicrosoftGraphExtensionProperty.cs | 6 +- .../MicrosoftGraphExtensionProperty.json.cs | 12 +- ...softGraphExtensionPropertyAutoGenerated.cs | 6 +- ...raphExtensionPropertyAutoGenerated.json.cs | 12 +- ...crosoftGraphFederatedIdentityCredential.cs | 4 + ...ftGraphFederatedIdentityCredential.json.cs | 12 +- ...entityCredentialCollectionResponse.json.cs | 4 +- .../api/Models/ApiV10/MicrosoftGraphGroup.cs | 11 +- .../Models/ApiV10/MicrosoftGraphGroup.json.cs | 60 +- ...MicrosoftGraphGroupLifecyclePolicy.json.cs | 8 +- .../MicrosoftGraphHomeRealmDiscoveryPolicy.cs | 10 +- ...osoftGraphHomeRealmDiscoveryPolicy.json.cs | 4 +- .../ApiV10/MicrosoftGraphIdentity.json.cs | 4 +- ...MicrosoftGraphIdentityProviderBase.json.cs | 2 +- ...tityProviderBaseCollectionResponse.json.cs | 4 +- ...icrosoftGraphImplicitGrantSettings.json.cs | 4 +- .../MicrosoftGraphInformationalUrl.json.cs | 10 +- ...osoftGraphInternalDomainFederation.json.cs | 14 +- ...DomainFederationCollectionResponse.json.cs | 4 +- .../MicrosoftGraphKeyCredential.json.cs | 12 +- .../ApiV10/MicrosoftGraphKeyValue.json.cs | 4 +- .../MicrosoftGraphLicenseUnitsDetail.json.cs | 6 +- ...icrosoftGraphOAuth2PermissionGrant.json.cs | 12 +- ...rosoftGraphODataErrorsErrorDetails.json.cs | 6 +- ...MicrosoftGraphODataErrorsMainError.json.cs | 10 +- ...icrosoftGraphODataErrorsOdataError.json.cs | 2 +- .../MicrosoftGraphObjectIdentity.json.cs | 6 +- ...ftGraphOnPremisesProvisioningError.json.cs | 8 +- .../MicrosoftGraphOptionalClaim.json.cs | 8 +- .../MicrosoftGraphOptionalClaims.json.cs | 6 +- .../Models/ApiV10/MicrosoftGraphOrgContact.cs | 10 +- .../ApiV10/MicrosoftGraphOrgContact.json.cs | 36 +- ...tGraphOrgContactCollectionResponse.json.cs | 4 +- .../MicrosoftGraphOrganization.PowerShell.cs | 4 +- .../ApiV10/MicrosoftGraphOrganization.cs | 22 +- .../ApiV10/MicrosoftGraphOrganization.json.cs | 50 +- ...raphOrganizationCollectionResponse.json.cs | 4 +- .../MicrosoftGraphOrganizationalBranding.cs | 2 +- ...crosoftGraphOrganizationalBranding.json.cs | 2 +- ...GraphOrganizationalBrandingLocalization.cs | 2 +- ...dingLocalizationCollectionResponse.json.cs | 4 +- ...phOrganizationalBrandingProperties.json.cs | 14 +- ...rosoftGraphParentalControlSettings.json.cs | 4 +- .../MicrosoftGraphPasswordCredential.json.cs | 12 +- .../MicrosoftGraphPasswordProfile.json.cs | 6 +- .../MicrosoftGraphPermissionScope.json.cs | 18 +- .../Models/ApiV10/MicrosoftGraphPhone.json.cs | 8 +- ...icrosoftGraphPhysicalOfficeAddress.json.cs | 12 +- .../Models/ApiV10/MicrosoftGraphPolicyBase.cs | 6 +- .../ApiV10/MicrosoftGraphPolicyBase.json.cs | 4 +- ...osoftGraphPreAuthorizedApplication.json.cs | 4 +- .../MicrosoftGraphPrivacyProfile.json.cs | 4 +- .../MicrosoftGraphProvisionedPlan.json.cs | 6 +- ...rosoftGraphPublicClientApplication.json.cs | 2 +- ...crosoftGraphRequiredResourceAccess.json.cs | 4 +- .../MicrosoftGraphResourceAccess.json.cs | 4 +- ...oftGraphResourceSpecificPermissionGrant.cs | 6 +- ...aphResourceSpecificPermissionGrant.json.cs | 12 +- .../MicrosoftGraphSamlOrWsFedProvider.json.cs | 10 +- ...osoftGraphSamlSingleSignOnSettings.json.cs | 2 +- ...MicrosoftGraphScopedRoleMembership.json.cs | 6 +- ...edRoleMembershipCollectionResponse.json.cs | 4 +- .../MicrosoftGraphServicePlanInfo.json.cs | 8 +- .../ApiV10/MicrosoftGraphServicePrincipal.cs | 11 +- .../MicrosoftGraphServicePrincipal.json.cs | 92 +- ...raphSigningCertificateUpdateStatus.json.cs | 4 +- .../MicrosoftGraphSpaApplication.json.cs | 2 +- .../Models/ApiV10/MicrosoftGraphStsPolicy.cs | 6 +- .../ApiV10/MicrosoftGraphStsPolicy.json.cs | 10 +- .../MicrosoftGraphSubscribedSku.json.cs | 14 +- ...aphSubscribedSkuCollectionResponse.json.cs | 4 +- .../MicrosoftGraphTokenIssuancePolicy.cs | 10 +- .../MicrosoftGraphTokenIssuancePolicy.json.cs | 4 +- .../MicrosoftGraphTokenLifetimePolicy.cs | 10 +- .../MicrosoftGraphTokenLifetimePolicy.json.cs | 4 +- .../api/Models/ApiV10/MicrosoftGraphUser.cs | 11 +- .../Models/ApiV10/MicrosoftGraphUser.json.cs | 108 +- .../MicrosoftGraphVerifiedDomain.json.cs | 10 +- .../MicrosoftGraphWebApplication.json.cs | 8 +- ...stbodyContentApplicationJsonSchema.json.cs | 2 +- ...stbodyContentApplicationJsonSchema.json.cs | 6 +- ...stbodyContentApplicationJsonSchema.json.cs | 2 +- ...stbodyContentApplicationJsonSchema.json.cs | 4 +- ...stbodyContentApplicationJsonSchema.json.cs | 2 +- ...stbodyContentApplicationJsonSchema.json.cs | 4 +- ...stbodyContentApplicationJsonSchema.json.cs | 2 +- ...stbodyContentApplicationJsonSchema.json.cs | 6 +- .../api/Models/ApiV10/ReferenceCreate.json.cs | 2 +- .../ApiV10/StringCollectionResponse.json.cs | 4 +- ...tionOfDirectoryObjectAutoGenerated.json.cs | 4 +- .../api/Models/ApiV10Beta/OdataError.json.cs | 2 +- .../ApiV10Beta/OdataErrorDetail.json.cs | 6 +- .../Models/ApiV10Beta/OdataErrorMain.json.cs | 10 +- .../api/Models/MSGraphIdentity.json.cs | 18 +- .../api/Support/MdmAuthority.Completer.cs | 47 - .../api/Support/MdmAuthority.TypeConverter.cs | 59 - .../generated/api/Support/MdmAuthority.cs | 106 - ...ddAzADApplicationKey_AddViaJsonFilePath.cs | 491 + .../AddAzADApplicationKey_AddViaJsonString.cs | 489 + ...DApplicationPassword_AddViaJsonFilePath.cs | 491 + ...zADApplicationPassword_AddViaJsonString.cs | 489 + ...DServicePrincipalKey_AddViaJsonFilePath.cs | 491 + ...zADServicePrincipalKey_AddViaJsonString.cs | 489 + ...icePrincipalPassword_AddViaJsonFilePath.cs | 491 + ...rvicePrincipalPassword_AddViaJsonString.cs | 489 + .../cmdlets/AddAzAdApplicationKey_Add.cs | 84 +- .../AddAzAdApplicationKey_AddExpanded.cs | 84 +- .../cmdlets/AddAzAdApplicationPassword_Add.cs | 84 +- .../AddAzAdApplicationPassword_AddExpanded.cs | 84 +- .../cmdlets/AddAzAdServicePrincipalKey_Add.cs | 84 +- .../AddAzAdServicePrincipalKey_AddExpanded.cs | 84 +- .../AddAzAdServicePrincipalPassword_Add.cs | 84 +- ...zAdServicePrincipalPassword_AddExpanded.cs | 84 +- .../GetAzADAppFederatedCredential_Get.cs | 86 +- .../GetAzADAppFederatedCredential_List.cs | 95 +- .../cmdlets/GetAzADGroupOwner_List.cs | 95 +- .../cmdlets/GetAzADOrganization_List.cs | 95 +- ...ADServicePrincipalAppRoleAssignment_Get.cs | 86 +- ...DServicePrincipalAppRoleAssignment_List.cs | 95 +- .../GetAzADUserOwnedApplication_List.cs | 95 +- .../cmdlets/GetAzADUserOwnedObject_List.cs | 95 +- .../cmdlets/GetAzAdApplication_Get.cs | 115 +- .../cmdlets/GetAzAdApplication_List.cs | 95 +- .../cmdlets/GetAzAdGroupMember_List.cs | 96 +- .../generated/cmdlets/GetAzAdGroup_Get.cs | 115 +- .../generated/cmdlets/GetAzAdGroup_List.cs | 97 +- .../cmdlets/GetAzAdServicePrincipal_Get.cs | 115 +- .../cmdlets/GetAzAdServicePrincipal_List.cs | 95 +- .../cmdlets/GetAzAdUserSigned_Get.cs | 86 +- .../generated/cmdlets/GetAzAdUser_Get.cs | 115 +- .../generated/cmdlets/GetAzAdUser_List.cs | 95 +- ...ADAppFederatedCredential_CreateExpanded.cs | 90 +- ...deratedCredential_CreateViaJsonFilePath.cs | 491 + ...FederatedCredential_CreateViaJsonString.cs | 489 + ...ewAzADApplication_CreateViaJsonFilePath.cs | 477 + .../NewAzADApplication_CreateViaJsonString.cs | 475 + .../NewAzADGroupGraphRefMember_Create.cs | 65 +- ...wAzADGroupGraphRefMember_CreateExpanded.cs | 65 +- ...oupGraphRefMember_CreateViaJsonFilePath.cs | 482 + ...GroupGraphRefMember_CreateViaJsonString.cs | 480 + ...ADGroupOwnerGraphBPreRef_CreateExpanded.cs | 68 +- .../NewAzADGroup_CreateViaJsonFilePath.cs | 477 + .../NewAzADGroup_CreateViaJsonString.cs | 475 + .../cmdlets/NewAzADOrganization_Create.cs | 84 +- .../NewAzADOrganization_CreateExpanded.cs | 110 +- ...wAzADOrganization_CreateViaJsonFilePath.cs | 477 + ...NewAzADOrganization_CreateViaJsonString.cs | 475 + ...ervicePrincipalAppRoleAssignment_Create.cs | 88 +- ...incipalAppRoleAssignment_CreateExpanded.cs | 88 +- ...AppRoleAssignment_CreateViaJsonFilePath.cs | 492 + ...alAppRoleAssignment_CreateViaJsonString.cs | 489 + ...DServicePrincipal_CreateViaJsonFilePath.cs | 477 + ...zADServicePrincipal_CreateViaJsonString.cs | 475 + .../NewAzADUser_CreateViaJsonFilePath.cs | 477 + .../NewAzADUser_CreateViaJsonString.cs | 475 + .../NewAzAdApplication_CreateExpanded.cs | 106 +- .../cmdlets/NewAzAdGroup_CreateExpanded.cs | 90 +- .../NewAzAdServicePrincipal_CreateExpanded.cs | 124 +- .../cmdlets/NewAzAdUser_CreateExpanded.cs | 90 +- ...RemoveAzADAppFederatedCredential_Delete.cs | 64 +- ...zADApplicationKey_RemoveViaJsonFilePath.cs | 478 + ...eAzADApplicationKey_RemoveViaJsonString.cs | 476 + ...plicationPassword_RemoveViaJsonFilePath.cs | 478 + ...ApplicationPassword_RemoveViaJsonString.cs | 476 + .../cmdlets/RemoveAzADGroupOwner_Delete.cs | 64 +- ...ervicePrincipalAppRoleAssignment_Delete.cs | 64 +- ...rvicePrincipalKey_RemoveViaJsonFilePath.cs | 478 + ...ServicePrincipalKey_RemoveViaJsonString.cs | 476 + ...PrincipalPassword_RemoveViaJsonFilePath.cs | 478 + ...cePrincipalPassword_RemoveViaJsonString.cs | 476 + .../RemoveAzAdApplicationKey_Remove.cs | 64 +- ...RemoveAzAdApplicationKey_RemoveExpanded.cs | 64 +- .../RemoveAzAdApplicationPassword_Remove.cs | 64 +- ...eAzAdApplicationPassword_RemoveExpanded.cs | 64 +- .../cmdlets/RemoveAzAdApplication_Delete.cs | 95 +- .../RemoveAzAdGroupRefMember_Delete.cs | 65 +- .../cmdlets/RemoveAzAdGroup_Delete.cs | 95 +- .../RemoveAzAdServicePrincipalKey_Remove.cs | 64 +- ...eAzAdServicePrincipalKey_RemoveExpanded.cs | 64 +- ...moveAzAdServicePrincipalPassword_Remove.cs | 64 +- ...ServicePrincipalPassword_RemoveExpanded.cs | 64 +- .../RemoveAzAdServicePrincipal_Delete.cs | 95 +- .../cmdlets/RemoveAzAdUser_Delete.cs | 95 +- ...ADAppFederatedCredential_UpdateExpanded.cs | 70 +- ...deratedCredential_UpdateViaJsonFilePath.cs | 491 + ...FederatedCredential_UpdateViaJsonString.cs | 489 + ...teAzADApplication_UpdateViaJsonFilePath.cs | 481 + ...dateAzADApplication_UpdateViaJsonString.cs | 479 + .../UpdateAzADGroup_UpdateViaJsonFilePath.cs | 478 + .../UpdateAzADGroup_UpdateViaJsonString.cs | 476 + ...ervicePrincipalAppRoleAssignment_Update.cs | 68 +- ...incipalAppRoleAssignment_UpdateExpanded.cs | 68 +- ...AppRoleAssignment_UpdateViaJsonFilePath.cs | 492 + ...alAppRoleAssignment_UpdateViaJsonString.cs | 490 + ...DServicePrincipal_UpdateViaJsonFilePath.cs | 481 + ...zADServicePrincipal_UpdateViaJsonString.cs | 479 + .../UpdateAzADUser_UpdateViaJsonFilePath.cs | 478 + .../UpdateAzADUser_UpdateViaJsonString.cs | 476 + .../UpdateAzAdApplication_UpdateExpanded.cs | 117 +- .../cmdlets/UpdateAzAdGroup_UpdateExpanded.cs | 74 +- ...dateAzAdServicePrincipal_UpdateExpanded.cs | 135 +- .../cmdlets/UpdateAzAdUser_UpdateExpanded.cs | 101 +- .../PSArgumentCompleterAttribute.cs | 52 + .../BuildTime/Cmdlets/ExportFormatPs1xml.cs | 6 +- .../BuildTime/Cmdlets/ExportHelpMarkdown.cs | 5 +- .../BuildTime/Cmdlets/ExportModelSurface.cs | 2 +- .../BuildTime/Cmdlets/ExportProxyCmdlet.cs | 9 +- .../runtime/BuildTime/Cmdlets/ExportPsd1.cs | 10 +- .../BuildTime/Cmdlets/ExportTestStub.cs | 211 +- .../runtime/BuildTime/MarkdownRenderer.cs | 26 +- .../BuildTime/Models/PsProxyOutputs.cs | 61 +- .../runtime/BuildTime/Models/PsProxyTypes.cs | 46 +- .../runtime/BuildTime/PsAttributes.cs | 10 + .../runtime/BuildTime/PsExtensions.cs | 7 + .../generated/runtime/BuildTime/PsHelpers.cs | 7 +- .../generated/runtime/ISendAsync.cs | 113 + .../generated/runtime/MessageAttribute.cs | 100 +- .../runtime/MessageAttributeHelper.cs | 37 +- .../runtime/Nodes/Collections/XNodeArray.cs | 5 + .../generated/runtime/PipelineMocking.cs | 2 +- .../runtime/Properties/Resources.Designer.cs | 28 +- .../runtime/Properties/Resources.resx | 10 +- .../runtime/TypeConverterExtensions.cs | 50 + .../internal/Add-AzADApplicationKey.ps1 | 20 +- .../internal/Add-AzADApplicationPassword.ps1 | 19 +- .../internal/Add-AzADServicePrincipalKey.ps1 | 20 +- .../Add-AzADServicePrincipalPassword.ps1 | 19 +- .../internal/Az.MSGraph.internal.psm1 | 4 +- .../Get-AzADAppFederatedCredential.ps1 | 3 +- .../internal/Get-AzADApplication.ps1 | 6 +- .../internal/Get-AzADGroup.ps1 | 6 +- .../internal/Get-AzADGroupMember.ps1 | 3 +- .../internal/Get-AzADServicePrincipal.ps1 | 6 +- .../internal/Get-AzADUser.ps1 | 6 +- .../internal/Get-AzADUserOwnedApplication.ps1 | 3 +- .../internal/Get-AzADUserOwnedObject.ps1 | 3 +- .../internal/Get-AzADUserSigned.ps1 | 3 +- .../New-AzADAppFederatedCredential.ps1 | 33 +- .../internal/New-AzADApplication.ps1 | 109 +- .../internal/New-AzADGroup.ps1 | 64 +- .../internal/New-AzADGroupGraphRefMember.ps1 | 17 +- .../New-AzADGroupOwnerGraphBPreRef.ps1 | 7 +- .../internal/New-AzADOrganization.ps1 | 31 +- .../internal/New-AzADServicePrincipal.ps1 | 124 +- ...-AzADServicePrincipalAppRoleAssignment.ps1 | 22 +- .../internal/New-AzADUser.ps1 | 115 +- .../internal/ProxyCmdletDefinitions.ps1 | 1095 +- .../internal/Remove-AzADApplication.ps1 | 6 +- .../internal/Remove-AzADApplicationKey.ps1 | 18 +- .../Remove-AzADApplicationPassword.ps1 | 18 +- .../internal/Remove-AzADGroup.ps1 | 6 +- .../internal/Remove-AzADGroupRefMember.ps1 | 3 +- .../internal/Remove-AzADServicePrincipal.ps1 | 6 +- .../Remove-AzADServicePrincipalKey.ps1 | 18 +- .../Remove-AzADServicePrincipalPassword.ps1 | 18 +- .../internal/Remove-AzADUser.ps1 | 6 +- .../internal/Update-AzADApplication.ps1 | 112 +- .../internal/Update-AzADServicePrincipal.ps1 | 127 +- .../internal/Update-AzADUser.ps1 | 118 +- .../MSGraph.Autorest/test-module.ps1 | 18 +- 360 files changed, 37798 insertions(+), 5625 deletions(-) delete mode 100644 generated/Resources/MSGraph.Autorest/generated/api/Support/MdmAuthority.Completer.cs delete mode 100644 generated/Resources/MSGraph.Autorest/generated/api/Support/MdmAuthority.TypeConverter.cs delete mode 100644 generated/Resources/MSGraph.Autorest/generated/api/Support/MdmAuthority.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADApplicationKey_AddViaJsonFilePath.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADApplicationKey_AddViaJsonString.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADApplicationPassword_AddViaJsonFilePath.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADApplicationPassword_AddViaJsonString.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADServicePrincipalKey_AddViaJsonFilePath.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADServicePrincipalKey_AddViaJsonString.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADServicePrincipalPassword_AddViaJsonFilePath.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADServicePrincipalPassword_AddViaJsonString.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADAppFederatedCredential_CreateViaJsonFilePath.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADAppFederatedCredential_CreateViaJsonString.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADApplication_CreateViaJsonFilePath.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADApplication_CreateViaJsonString.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroupGraphRefMember_CreateViaJsonFilePath.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroupGraphRefMember_CreateViaJsonString.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroup_CreateViaJsonFilePath.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroup_CreateViaJsonString.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADOrganization_CreateViaJsonFilePath.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADOrganization_CreateViaJsonString.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipalAppRoleAssignment_CreateViaJsonFilePath.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipalAppRoleAssignment_CreateViaJsonString.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipal_CreateViaJsonFilePath.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipal_CreateViaJsonString.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADUser_CreateViaJsonFilePath.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADUser_CreateViaJsonString.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADApplicationKey_RemoveViaJsonFilePath.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADApplicationKey_RemoveViaJsonString.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADApplicationPassword_RemoveViaJsonFilePath.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADApplicationPassword_RemoveViaJsonString.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADServicePrincipalKey_RemoveViaJsonFilePath.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADServicePrincipalKey_RemoveViaJsonString.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADServicePrincipalPassword_RemoveViaJsonFilePath.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADServicePrincipalPassword_RemoveViaJsonString.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADAppFederatedCredential_UpdateViaJsonFilePath.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADAppFederatedCredential_UpdateViaJsonString.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADApplication_UpdateViaJsonFilePath.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADApplication_UpdateViaJsonString.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADGroup_UpdateViaJsonFilePath.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADGroup_UpdateViaJsonString.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipalAppRoleAssignment_UpdateViaJsonFilePath.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipalAppRoleAssignment_UpdateViaJsonString.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipal_UpdateViaJsonFilePath.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipal_UpdateViaJsonString.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADUser_UpdateViaJsonFilePath.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADUser_UpdateViaJsonString.cs create mode 100644 generated/Resources/MSGraph.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs diff --git a/generated/Resources/MSGraph.Autorest/Az.MSGraph.format.ps1xml b/generated/Resources/MSGraph.Autorest/Az.MSGraph.format.ps1xml index a4a509bb989e..1636dcde10ca 100644 --- a/generated/Resources/MSGraph.Autorest/Az.MSGraph.format.ps1xml +++ b/generated/Resources/MSGraph.Autorest/Az.MSGraph.format.ps1xml @@ -4,7 +4,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.MicrosoftGraphApplicationApiPermission - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.MicrosoftGraphApplicationApiPermission + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.MicrosoftGraphApplicationApiPermission#Multiple @@ -38,7 +38,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.MSGraphIdentity - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.MSGraphIdentity + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.MSGraphIdentity#Multiple @@ -108,7 +108,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfApplication - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfApplication + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfApplication#Multiple @@ -136,7 +136,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfDirectoryObject - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfDirectoryObject + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfDirectoryObject#Multiple @@ -158,7 +158,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfDirectoryObjectAutoGenerated2 - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfDirectoryObjectAutoGenerated2 + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfDirectoryObjectAutoGenerated2#Multiple @@ -180,7 +180,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfGroup - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfGroup + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfGroup#Multiple @@ -208,7 +208,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfServicePrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfServicePrincipal + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfServicePrincipal#Multiple @@ -236,7 +236,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfUser - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfUser + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfUser#Multiple @@ -264,7 +264,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAddIn - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAddIn + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAddIn#Multiple @@ -292,7 +292,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAdministrativeUnit - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAdministrativeUnit + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAdministrativeUnit#Multiple @@ -350,7 +350,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAdministrativeUnitCollectionResponse - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAdministrativeUnitCollectionResponse + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAdministrativeUnitCollectionResponse#Multiple @@ -372,7 +372,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAlternativeSecurityId - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAlternativeSecurityId + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAlternativeSecurityId#Multiple @@ -406,7 +406,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphApiApplication - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphApiApplication + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphApiApplication#Multiple @@ -440,7 +440,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphApplication - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphApplication + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphApplication#Multiple @@ -474,7 +474,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRole - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRole + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRole#Multiple @@ -532,7 +532,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignment - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignment + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignment#Multiple @@ -578,7 +578,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignmentAutoGenerated - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignmentAutoGenerated + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignmentAutoGenerated#Multiple @@ -666,7 +666,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignmentCollectionResponse - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignmentCollectionResponse + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignmentCollectionResponse#Multiple @@ -688,7 +688,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAssignedPlan - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAssignedPlan + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAssignedPlan#Multiple @@ -728,7 +728,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphCertificateAuthority - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphCertificateAuthority + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphCertificateAuthority#Multiple @@ -780,7 +780,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphCertificateBasedAuthConfiguration - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphCertificateBasedAuthConfiguration + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphCertificateBasedAuthConfiguration#Multiple @@ -802,7 +802,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphClaimsMappingPolicy - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphClaimsMappingPolicy + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphClaimsMappingPolicy#Multiple @@ -866,7 +866,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphContract - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphContract + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphContract#Multiple @@ -930,7 +930,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphContractCollectionResponse - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphContractCollectionResponse + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphContractCollectionResponse#Multiple @@ -952,7 +952,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDelegatedPermissionClassification - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDelegatedPermissionClassification + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDelegatedPermissionClassification#Multiple @@ -992,7 +992,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDevice - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDevice + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDevice#Multiple @@ -1140,7 +1140,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDeviceCollectionResponse - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDeviceCollectionResponse + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDeviceCollectionResponse#Multiple @@ -1162,7 +1162,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectory - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectory + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectory#Multiple @@ -1184,7 +1184,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject#Multiple @@ -1218,7 +1218,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObjectCollectionResponse - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObjectCollectionResponse + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObjectCollectionResponse#Multiple @@ -1240,7 +1240,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryRole - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryRole + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryRole#Multiple @@ -1298,7 +1298,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryRoleCollectionResponse - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryRoleCollectionResponse + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryRoleCollectionResponse#Multiple @@ -1320,7 +1320,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryRoleTemplate - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryRoleTemplate + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryRoleTemplate#Multiple @@ -1372,7 +1372,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryRoleTemplateCollectionResponse - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryRoleTemplateCollectionResponse + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryRoleTemplateCollectionResponse#Multiple @@ -1394,7 +1394,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomain - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomain + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomain#Multiple @@ -1488,7 +1488,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomainCollectionResponse - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomainCollectionResponse + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomainCollectionResponse#Multiple @@ -1510,7 +1510,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomainDnsRecord - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomainDnsRecord + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomainDnsRecord#Multiple @@ -1562,7 +1562,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomainDnsRecordCollectionResponse - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomainDnsRecordCollectionResponse + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomainDnsRecordCollectionResponse#Multiple @@ -1584,7 +1584,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomainState - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomainState + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomainState#Multiple @@ -1618,7 +1618,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEmployeeOrgData - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEmployeeOrgData + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEmployeeOrgData#Multiple @@ -1646,7 +1646,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEndpoint - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEndpoint#Multiple @@ -1722,7 +1722,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEntity - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEntity + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEntity#Multiple @@ -1744,7 +1744,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEntityAutoGenerated - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEntityAutoGenerated + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEntityAutoGenerated#Multiple @@ -1766,7 +1766,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphExtension - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphExtension + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphExtension#Multiple @@ -1788,7 +1788,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphExtensionCollectionResponse - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphExtensionCollectionResponse + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphExtensionCollectionResponse#Multiple @@ -1810,7 +1810,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphExtensionProperty - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphExtensionProperty + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphExtensionProperty#Multiple @@ -1886,7 +1886,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphExtensionPropertyAutoGenerated - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphExtensionPropertyAutoGenerated + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphExtensionPropertyAutoGenerated#Multiple @@ -1962,7 +1962,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredential - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredential + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredential#Multiple @@ -1981,6 +1981,9 @@ + + + @@ -2003,6 +2006,9 @@ Name + + ResourceGroupName + Subject @@ -2014,7 +2020,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredentialCollectionResponse - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredentialCollectionResponse + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredentialCollectionResponse#Multiple @@ -2036,7 +2042,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphGroup - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphGroup + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphGroup#Multiple @@ -2076,7 +2082,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphGroupLifecyclePolicy - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphGroupLifecyclePolicy + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphGroupLifecyclePolicy#Multiple @@ -2116,7 +2122,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphHomeRealmDiscoveryPolicy - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphHomeRealmDiscoveryPolicy + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphHomeRealmDiscoveryPolicy#Multiple @@ -2180,7 +2186,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphIdentity - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphIdentity + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphIdentity#Multiple @@ -2208,7 +2214,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphIdentityProviderBase - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphIdentityProviderBase + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphIdentityProviderBase#Multiple @@ -2236,7 +2242,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphIdentityProviderBaseCollectionResponse - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphIdentityProviderBaseCollectionResponse + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphIdentityProviderBaseCollectionResponse#Multiple @@ -2258,7 +2264,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphImplicitGrantSettings - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphImplicitGrantSettings + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphImplicitGrantSettings#Multiple @@ -2286,7 +2292,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphInformationalUrl - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphInformationalUrl + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphInformationalUrl#Multiple @@ -2332,7 +2338,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphInternalDomainFederation - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphInternalDomainFederation + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphInternalDomainFederation#Multiple @@ -2426,7 +2432,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphInternalDomainFederationCollectionResponse - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphInternalDomainFederationCollectionResponse + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphInternalDomainFederationCollectionResponse#Multiple @@ -2448,7 +2454,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential#Multiple @@ -2512,7 +2518,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyValue - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyValue + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyValue#Multiple @@ -2540,7 +2546,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphLicenseUnitsDetail - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphLicenseUnitsDetail + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphLicenseUnitsDetail#Multiple @@ -2574,7 +2580,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOAuth2PermissionGrant - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOAuth2PermissionGrant + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOAuth2PermissionGrant#Multiple @@ -2626,7 +2632,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphObjectIdentity - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphObjectIdentity + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphObjectIdentity#Multiple @@ -2660,7 +2666,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphODataErrorsErrorDetails - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphODataErrorsErrorDetails + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphODataErrorsErrorDetails#Multiple @@ -2694,7 +2700,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphODataErrorsMainError - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphODataErrorsMainError + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphODataErrorsMainError#Multiple @@ -2728,7 +2734,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOnPremisesProvisioningError - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOnPremisesProvisioningError + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOnPremisesProvisioningError#Multiple @@ -2768,7 +2774,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOptionalClaim - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOptionalClaim + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOptionalClaim#Multiple @@ -2808,7 +2814,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganization - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganization + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganization#Multiple @@ -2860,6 +2866,9 @@ + + + @@ -2930,6 +2939,9 @@ PreferredLanguage + + ResourceGroupName + SecurityComplianceNotificationMail @@ -2956,7 +2968,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationalBranding - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationalBranding + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationalBranding#Multiple @@ -3038,7 +3050,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationalBrandingLocalization - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationalBrandingLocalization + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationalBrandingLocalization#Multiple @@ -3120,7 +3132,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationalBrandingLocalizationCollectionResponse - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationalBrandingLocalizationCollectionResponse + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationalBrandingLocalizationCollectionResponse#Multiple @@ -3142,7 +3154,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationalBrandingProperties - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationalBrandingProperties + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationalBrandingProperties#Multiple @@ -3224,7 +3236,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationCollectionResponse - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationCollectionResponse + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationCollectionResponse#Multiple @@ -3246,7 +3258,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrgContact - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrgContact + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrgContact#Multiple @@ -3352,7 +3364,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrgContactCollectionResponse - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrgContactCollectionResponse + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrgContactCollectionResponse#Multiple @@ -3374,7 +3386,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphParentalControlSettings - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphParentalControlSettings + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphParentalControlSettings#Multiple @@ -3402,7 +3414,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential#Multiple @@ -3460,7 +3472,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordProfile - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordProfile + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordProfile#Multiple @@ -3494,7 +3506,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPermissionScope - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPermissionScope + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPermissionScope#Multiple @@ -3564,7 +3576,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPhone - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPhone + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPhone#Multiple @@ -3604,7 +3616,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPhysicalOfficeAddress - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPhysicalOfficeAddress + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPhysicalOfficeAddress#Multiple @@ -3656,7 +3668,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPolicyBase - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPolicyBase + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPolicyBase#Multiple @@ -3708,7 +3720,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPreAuthorizedApplication - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPreAuthorizedApplication + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPreAuthorizedApplication#Multiple @@ -3736,7 +3748,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPrivacyProfile - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPrivacyProfile + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPrivacyProfile#Multiple @@ -3764,7 +3776,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphProvisionedPlan - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphProvisionedPlan + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphProvisionedPlan#Multiple @@ -3798,7 +3810,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPublicClientApplication - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPublicClientApplication + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPublicClientApplication#Multiple @@ -3820,7 +3832,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphRequiredResourceAccess - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphRequiredResourceAccess + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphRequiredResourceAccess#Multiple @@ -3842,7 +3854,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphResourceAccess - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphResourceAccess + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphResourceAccess#Multiple @@ -3870,7 +3882,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphResourceSpecificPermissionGrant - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphResourceSpecificPermissionGrant + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphResourceSpecificPermissionGrant#Multiple @@ -3946,7 +3958,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSamlOrWsFedProvider - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSamlOrWsFedProvider + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSamlOrWsFedProvider#Multiple @@ -4004,7 +4016,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSamlSingleSignOnSettings - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSamlSingleSignOnSettings + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSamlSingleSignOnSettings#Multiple @@ -4026,7 +4038,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphScopedRoleMembership - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphScopedRoleMembership + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphScopedRoleMembership#Multiple @@ -4060,7 +4072,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphScopedRoleMembershipCollectionResponse - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphScopedRoleMembershipCollectionResponse + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphScopedRoleMembershipCollectionResponse#Multiple @@ -4082,7 +4094,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphServicePlanInfo - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphServicePlanInfo + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphServicePlanInfo#Multiple @@ -4122,7 +4134,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphServicePrincipal - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphServicePrincipal + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphServicePrincipal#Multiple @@ -4156,7 +4168,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSigningCertificateUpdateStatus - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSigningCertificateUpdateStatus + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSigningCertificateUpdateStatus#Multiple @@ -4184,7 +4196,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSpaApplication - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSpaApplication + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSpaApplication#Multiple @@ -4206,7 +4218,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphStsPolicy - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphStsPolicy + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphStsPolicy#Multiple @@ -4270,7 +4282,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSubscribedSku - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSubscribedSku + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSubscribedSku#Multiple @@ -4322,7 +4334,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSubscribedSkuCollectionResponse - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSubscribedSkuCollectionResponse + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSubscribedSkuCollectionResponse#Multiple @@ -4344,7 +4356,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphTokenIssuancePolicy - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphTokenIssuancePolicy + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphTokenIssuancePolicy#Multiple @@ -4408,7 +4420,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphTokenLifetimePolicy - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphTokenLifetimePolicy + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphTokenLifetimePolicy#Multiple @@ -4472,7 +4484,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphUser - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphUser + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphUser#Multiple @@ -4512,7 +4524,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphVerifiedDomain - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphVerifiedDomain + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphVerifiedDomain#Multiple @@ -4558,7 +4570,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphWebApplication - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphWebApplication + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphWebApplication#Multiple @@ -4592,7 +4604,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.Paths17CrvdcApplicationsApplicationIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.Paths17CrvdcApplicationsApplicationIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.Paths17CrvdcApplicationsApplicationIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema#Multiple @@ -4614,7 +4626,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.Paths1Idoj4GServiceprincipalsServiceprincipalIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.Paths1Idoj4GServiceprincipalsServiceprincipalIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.Paths1Idoj4GServiceprincipalsServiceprincipalIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema#Multiple @@ -4636,7 +4648,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.Paths1UhuhlbServiceprincipalsServiceprincipalIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.Paths1UhuhlbServiceprincipalsServiceprincipalIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.Paths1UhuhlbServiceprincipalsServiceprincipalIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema#Multiple @@ -4664,7 +4676,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.PathsHv033BApplicationsApplicationIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.PathsHv033BApplicationsApplicationIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.PathsHv033BApplicationsApplicationIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema#Multiple @@ -4686,7 +4698,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.PathsHxlydaApplicationsApplicationIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.PathsHxlydaApplicationsApplicationIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.PathsHxlydaApplicationsApplicationIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema#Multiple @@ -4714,7 +4726,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.PathsN3Fx9GServiceprincipalsServiceprincipalIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.PathsN3Fx9GServiceprincipalsServiceprincipalIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.PathsN3Fx9GServiceprincipalsServiceprincipalIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema#Multiple @@ -4736,7 +4748,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.ReferenceCreate - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.ReferenceCreate + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.ReferenceCreate#Multiple @@ -4758,7 +4770,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.StringCollectionResponse - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.StringCollectionResponse + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.StringCollectionResponse#Multiple @@ -4786,7 +4798,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.CollectionOfDirectoryObjectAutoGenerated - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.CollectionOfDirectoryObjectAutoGenerated + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.CollectionOfDirectoryObjectAutoGenerated#Multiple @@ -4808,7 +4820,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataErrorDetail - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataErrorDetail + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataErrorDetail#Multiple @@ -4842,7 +4854,7 @@ Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataErrorMain - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataErrorMain + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataErrorMain#Multiple diff --git a/generated/Resources/MSGraph.Autorest/Az.MSGraph.psd1 b/generated/Resources/MSGraph.Autorest/Az.MSGraph.psd1 index 57056c4f50fb..b5049fe8c1b7 100644 --- a/generated/Resources/MSGraph.Autorest/Az.MSGraph.psd1 +++ b/generated/Resources/MSGraph.Autorest/Az.MSGraph.psd1 @@ -11,8 +11,8 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.MSGraph.private.dll' FormatsToProcess = './Az.MSGraph.format.ps1xml' - FunctionsToExport = 'Add-AzADAppPermission', 'Add-AzADGroupMember', 'Get-AzADAppCredential', 'Get-AzADAppFederatedCredential', 'Get-AzADApplication', 'Get-AzADAppPermission', 'Get-AzADGroup', 'Get-AzADGroupMember', 'Get-AzADGroupOwner', 'Get-AzADOrganization', 'Get-AzADServicePrincipal', 'Get-AzADServicePrincipalAppRoleAssignment', 'Get-AzADSpCredential', 'Get-AzADUser', 'New-AzADAppCredential', 'New-AzADAppFederatedCredential', 'New-AzADApplication', 'New-AzADGroup', 'New-AzADGroupOwner', 'New-AzADServicePrincipal', 'New-AzADServicePrincipalAppRoleAssignment', 'New-AzADSpCredential', 'New-AzADUser', 'Remove-AzADAppCredential', 'Remove-AzADAppFederatedCredential', 'Remove-AzADApplication', 'Remove-AzADAppPermission', 'Remove-AzADGroup', 'Remove-AzADGroupMember', 'Remove-AzADGroupOwner', 'Remove-AzADServicePrincipal', 'Remove-AzADServicePrincipalAppRoleAssignment', 'Remove-AzADSpCredential', 'Remove-AzADUser', 'Update-AzADAppFederatedCredential', 'Update-AzADApplication', 'Update-AzADGroup', 'Update-AzADServicePrincipal', 'Update-AzADServicePrincipalAppRoleAssignment', 'Update-AzADUser', '*' - AliasesToExport = 'Get-AzADServicePrincipalCredential', 'New-AzADServicePrincipalCredential', 'Remove-AzADServicePrincipalCredential', 'Set-AzADApplication', 'Set-AzADServicePrincipal', 'Set-AzADUser', '*' + FunctionsToExport = 'Add-AzADAppPermission', 'Add-AzADGroupMember', 'Get-AzADAppCredential', 'Get-AzADAppFederatedCredential', 'Get-AzADApplication', 'Get-AzADAppPermission', 'Get-AzADGroup', 'Get-AzADGroupMember', 'Get-AzADGroupOwner', 'Get-AzADOrganization', 'Get-AzADServicePrincipal', 'Get-AzADServicePrincipalAppRoleAssignment', 'Get-AzADSpCredential', 'Get-AzADUser', 'New-AzADAppCredential', 'New-AzADAppFederatedCredential', 'New-AzADApplication', 'New-AzADGroup', 'New-AzADGroupOwner', 'New-AzADServicePrincipal', 'New-AzADServicePrincipalAppRoleAssignment', 'New-AzADSpCredential', 'New-AzADUser', 'Remove-AzADAppCredential', 'Remove-AzADAppFederatedCredential', 'Remove-AzADApplication', 'Remove-AzADAppPermission', 'Remove-AzADGroup', 'Remove-AzADGroupMember', 'Remove-AzADGroupOwner', 'Remove-AzADServicePrincipal', 'Remove-AzADServicePrincipalAppRoleAssignment', 'Remove-AzADSpCredential', 'Remove-AzADUser', 'Update-AzADAppFederatedCredential', 'Update-AzADApplication', 'Update-AzADGroup', 'Update-AzADServicePrincipal', 'Update-AzADServicePrincipalAppRoleAssignment', 'Update-AzADUser' + AliasesToExport = 'Get-AzADServicePrincipalCredential', 'New-AzADServicePrincipalCredential', 'Remove-AzADServicePrincipalCredential', 'Set-AzADApplication', 'Set-AzADServicePrincipal', 'Set-AzADUser' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'MSGraph' diff --git a/generated/Resources/MSGraph.Autorest/Az.MSGraph.psm1 b/generated/Resources/MSGraph.Autorest/Az.MSGraph.psm1 index 49100709fda7..d025857fa0ad 100644 --- a/generated/Resources/MSGraph.Autorest/Az.MSGraph.psm1 +++ b/generated/Resources/MSGraph.Autorest/Az.MSGraph.psm1 @@ -47,14 +47,19 @@ # Ask for the shared functionality table $VTable = Register-AzModule - + # Tweaks the pipeline on module load $instance.OnModuleLoad = $VTable.OnModuleLoad # Following two delegates are added for telemetry $instance.GetTelemetryId = $VTable.GetTelemetryId $instance.Telemetry = $VTable.Telemetry - + + # Delegate to sanitize the output object + $instance.SanitizeOutput = $VTable.SanitizerHandler + + # Delegate to get the telemetry info + $instance.GetTelemetryInfo = $VTable.GetTelemetryInfo # Tweaks the pipeline per call $instance.AddRequestUserAgentHandler = $VTable.AddRequestUserAgentHandler @@ -65,26 +70,25 @@ # Tweaks the pipeline per call $instance.AddAuthorizeRequestHandler = $VTable.AddAuthorizeRequestHandler - + # Gets shared parameter values $instance.GetParameterValue = $VTable.GetParameterValue - + # Allows shared module to listen to events from this module $instance.EventListener = $VTable.EventListener - + # Gets shared argument completers $instance.ArgumentCompleter = $VTable.ArgumentCompleter - + # The name of the currently selected Azure profile $instance.ProfileName = $VTable.ProfileName - # Load the custom module $customModulePath = Join-Path $PSScriptRoot './custom/Az.MSGraph.custom.psm1' if(Test-Path $customModulePath) { $null = Import-Module -Name $customModulePath } - + # Export nothing to clear implicit exports Export-ModuleMember @@ -104,12 +108,12 @@ # Load the last folder if no profile is selected $profileDirectory = $directories | Select-Object -Last 1 } - + if($profileDirectory) { Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'" $exportsPath = $profileDirectory.FullName } - + if($exportsPath) { Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath diff --git a/generated/Resources/MSGraph.Autorest/check-dependencies.ps1 b/generated/Resources/MSGraph.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/generated/Resources/MSGraph.Autorest/check-dependencies.ps1 +++ b/generated/Resources/MSGraph.Autorest/check-dependencies.ps1 @@ -12,13 +12,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code # is regenerated. # ---------------------------------------------------------------------------------- -param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) +param([switch]$NotIsolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) $ErrorActionPreference = 'Stop' -if(-not $Isolated) { +if(-not $NotIsolated) { Write-Host -ForegroundColor Green 'Creating isolated process...' $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path - & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated return } diff --git a/generated/Resources/MSGraph.Autorest/exports/Add-AzADAppPermission.ps1 b/generated/Resources/MSGraph.Autorest/exports/Add-AzADAppPermission.ps1 index fbd4c27a985b..3db2f5d9f3ff 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Add-AzADAppPermission.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Add-AzADAppPermission.ps1 @@ -133,7 +133,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -155,6 +155,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Add-AzADGroupMember.ps1 b/generated/Resources/MSGraph.Autorest/exports/Add-AzADGroupMember.ps1 index 3c79a00253d0..64ae6cce275c 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Add-AzADGroupMember.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Add-AzADGroupMember.ps1 @@ -98,7 +98,7 @@ TARGETGROUPOBJECT : The target group object, could be used [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -405,7 +405,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphGroup] # The target group object, could be used as pipeline input. - # To construct, see NOTES section for TARGETGROUPOBJECT properties and create a hash table. ${TargetGroupObject}, [Parameter()] @@ -471,7 +470,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -497,6 +496,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Get-AzADAppCredential.ps1 b/generated/Resources/MSGraph.Autorest/exports/Get-AzADAppCredential.ps1 index 2a61003d9a55..e8bfddb6ed1f 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Get-AzADAppCredential.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Get-AzADAppCredential.ps1 @@ -131,7 +131,7 @@ APPLICATIONOBJECT : The application object, could be [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -308,7 +308,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication] # The application object, could be used as pipeline input. - # To construct, see NOTES section for APPLICATIONOBJECT properties and create a hash table. ${ApplicationObject}, [Parameter()] @@ -368,7 +367,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -392,6 +391,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Get-AzADAppFederatedCredential.ps1 b/generated/Resources/MSGraph.Autorest/exports/Get-AzADAppFederatedCredential.ps1 index 8b0cc29e370b..484c90b8b11c 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Get-AzADAppFederatedCredential.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Get-AzADAppFederatedCredential.ps1 @@ -127,7 +127,7 @@ APPLICATIONOBJECT : application object [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -302,7 +302,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphApplication] # application object - # To construct, see NOTES section for APPLICATIONOBJECT properties and create a hash table. ${ApplicationObject}, [Parameter()] @@ -419,7 +418,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -443,6 +442,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Get-AzADAppPermission.ps1 b/generated/Resources/MSGraph.Autorest/exports/Get-AzADAppPermission.ps1 index 4474fc7a983a..65116e451fef 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Get-AzADAppPermission.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Get-AzADAppPermission.ps1 @@ -100,7 +100,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -122,6 +122,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Get-AzADApplication.ps1 b/generated/Resources/MSGraph.Autorest/exports/Get-AzADApplication.ps1 index 98fa7698d5ff..12a76c43fcd3 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Get-AzADApplication.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Get-AzADApplication.ps1 @@ -205,7 +205,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -232,6 +232,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Get-AzADGroup.ps1 b/generated/Resources/MSGraph.Autorest/exports/Get-AzADGroup.ps1 index aa685749a53d..4ae216f55c1e 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Get-AzADGroup.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Get-AzADGroup.ps1 @@ -191,7 +191,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -215,6 +215,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Get-AzADGroupMember.ps1 b/generated/Resources/MSGraph.Autorest/exports/Get-AzADGroupMember.ps1 index 579d3b07ea82..1e2bf7d21e1b 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Get-AzADGroupMember.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Get-AzADGroupMember.ps1 @@ -98,7 +98,7 @@ GROUPOBJECT : The target group object, could be used as pi [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -430,7 +430,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup] # The target group object, could be used as pipeline input. - # To construct, see NOTES section for GROUPOBJECT properties and create a hash table. ${GroupObject}, [Parameter()] @@ -490,7 +489,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -513,6 +512,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Get-AzADGroupOwner.ps1 b/generated/Resources/MSGraph.Autorest/exports/Get-AzADGroupOwner.ps1 index 57170aed4144..cdfe2f607b0d 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Get-AzADGroupOwner.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Get-AzADGroupOwner.ps1 @@ -113,7 +113,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -165,7 +166,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -186,6 +187,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Get-AzADOrganization.ps1 b/generated/Resources/MSGraph.Autorest/exports/Get-AzADOrganization.ps1 index 2174dd245ec4..f3b410be5f6e 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Get-AzADOrganization.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Get-AzADOrganization.ps1 @@ -89,7 +89,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -141,7 +142,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -162,6 +163,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Get-AzADServicePrincipal.ps1 b/generated/Resources/MSGraph.Autorest/exports/Get-AzADServicePrincipal.ps1 index 20e98461be30..940a311a0f00 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Get-AzADServicePrincipal.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Get-AzADServicePrincipal.ps1 @@ -142,7 +142,7 @@ APPLICATIONOBJECT : The service principal object, co [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -359,7 +359,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Query')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication] # The service principal object, could be used as pipeline input. - # To construct, see NOTES section for APPLICATIONOBJECT properties and create a hash table. ${ApplicationObject}, [Parameter(ParameterSetName='SPNParameterSet', Mandatory)] @@ -458,7 +457,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -485,6 +484,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Get-AzADServicePrincipalAppRoleAssignment.ps1 b/generated/Resources/MSGraph.Autorest/exports/Get-AzADServicePrincipalAppRoleAssignment.ps1 index 032a0ebafd06..f4fef5cd82ea 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Get-AzADServicePrincipalAppRoleAssignment.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Get-AzADServicePrincipalAppRoleAssignment.ps1 @@ -101,7 +101,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -153,7 +154,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -175,6 +176,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Get-AzADSpCredential.ps1 b/generated/Resources/MSGraph.Autorest/exports/Get-AzADSpCredential.ps1 index a887f098e050..b526de1a77b8 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Get-AzADSpCredential.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Get-AzADSpCredential.ps1 @@ -116,7 +116,7 @@ SERVICEPRINCIPALOBJECT : The service principal [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -334,7 +334,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal] # The service principal object, could be used as pipeline input. - # To construct, see NOTES section for SERVICEPRINCIPALOBJECT properties and create a hash table. ${ServicePrincipalObject}, [Parameter()] @@ -394,7 +393,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -418,6 +417,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Get-AzADUser.ps1 b/generated/Resources/MSGraph.Autorest/exports/Get-AzADUser.ps1 index f4094dcb8263..33c9e8fe5b67 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Get-AzADUser.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Get-AzADUser.ps1 @@ -212,7 +212,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -239,6 +239,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/New-AzADAppCredential.ps1 b/generated/Resources/MSGraph.Autorest/exports/New-AzADAppCredential.ps1 index 99440a1d5343..a57ff9108c02 100644 --- a/generated/Resources/MSGraph.Autorest/exports/New-AzADAppCredential.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/New-AzADAppCredential.ps1 @@ -142,7 +142,7 @@ APPLICATIONOBJECT : The application object, could be [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -367,7 +367,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential[]] # Password credentials associated with the application. - # To construct, see NOTES section for PASSWORDCREDENTIALS properties and create a hash table. ${PasswordCredentials}, [Parameter(ParameterSetName='ApplicationObjectIdWithKeyCredentialParameterSet', Mandatory)] @@ -377,7 +376,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential[]] # key credentials associated with the application. - # To construct, see NOTES section for KEYCREDENTIALS properties and create a hash table. ${KeyCredentials}, [Parameter(ParameterSetName='ApplicationObjectIdWithCertValueParameterSet', Mandatory)] @@ -415,7 +413,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication] # The application object, could be used as pipeline input. - # To construct, see NOTES section for APPLICATIONOBJECT properties and create a hash table. ${ApplicationObject}, [Parameter()] @@ -475,7 +472,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -511,6 +508,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/New-AzADAppFederatedCredential.ps1 b/generated/Resources/MSGraph.Autorest/exports/New-AzADAppFederatedCredential.ps1 index 92024cc0cc1a..3d2e59210828 100644 --- a/generated/Resources/MSGraph.Autorest/exports/New-AzADAppFederatedCredential.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/New-AzADAppFederatedCredential.ps1 @@ -147,7 +147,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -168,6 +168,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/New-AzADApplication.ps1 b/generated/Resources/MSGraph.Autorest/exports/New-AzADApplication.ps1 index adc11df4a881..70acc249226e 100644 --- a/generated/Resources/MSGraph.Autorest/exports/New-AzADApplication.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/New-AzADApplication.ps1 @@ -29,14 +29,14 @@ 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. -ADDIN : Defines custom behavior that a consuming service can use to call an app in specific contexts. For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. This will let services like Office 365 call the application in the context of a document the user is working on. +ADDIN : Defines custom behavior that a consuming service can use to call an app in specific contexts. For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. This will let services like Office 365 call the application in the context of a document the user is working on. To construct, see NOTES section for ADDIN properties and create a hash table. [Id ]: [Property ]: [Key ]: Key. [Value ]: Value. [Type ]: -API : apiApplication +API : apiApplication To construct, see NOTES section for API properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [AcceptMappedClaim ]: When true, allows an application to use claims mapping without specifying a custom signing key. [KnownClientApplication ]: Used for bundling consent if you have a solution that contains two parts: a client app and a custom web API app. If you set the appID of the client app to this value, the user only consents once to the client app. Azure AD knows that consenting to the client means implicitly consenting to the web API and automatically provisions service principals for both APIs at the same time. Both the client and the web API app must be registered in the same tenant. @@ -55,7 +55,7 @@ API : apiApplication [DelegatedPermissionId ]: The unique identifier for the oauth2PermissionScopes the application requires. [RequestedAccessTokenVersion ]: Specifies the access token version expected by this resource. This changes the version and format of the JWT produced independent of the endpoint or client used to request the access token. The endpoint used, v1.0 or v2.0, is chosen by the client and only impacts the version of id_tokens. Resources need to explicitly configure requestedAccessTokenVersion to indicate the supported access token format. Possible values for requestedAccessTokenVersion are 1, 2, or null. If the value is null, this defaults to 1, which corresponds to the v1.0 endpoint. If signInAudience on the application is configured as AzureADandPersonalMicrosoftAccount, the value for this property must be 2 -APPROLE : The collection of roles assigned to the application. With app role assignments, these roles can be assigned to users, groups, or service principals associated with other applications. Not nullable. +APPROLE : The collection of roles assigned to the application. With app role assignments, these roles can be assigned to users, groups, or service principals associated with other applications. Not nullable. To construct, see NOTES section for APPROLE properties and create a hash table. [AllowedMemberType ]: Specifies whether this app role can be assigned to users and groups (by setting to ['User']), to other application's (by setting to ['Application'], or both (by setting to ['User', 'Application']). App roles supporting assignment to other applications' service principals are also known as application permissions. The 'Application' value is only supported for app roles defined on application entities. [Description ]: The description for the app role. This is displayed when the app role is being assigned and, if the app role functions as an application permission, during consent experiences. [DisplayName ]: Display name for the permission that appears in the app role assignment and consent experiences. @@ -63,7 +63,7 @@ APPROLE : The collection of roles assigned to the appl [IsEnabled ]: When creating or updating an app role, this must be set to true (which is the default). To delete a role, this must first be set to false. At that point, in a subsequent call, this role may be removed. [Value ]: Specifies the value to include in the roles claim in ID tokens and access tokens authenticating an assigned user or service principal. Must not exceed 120 characters in length. Allowed characters are : ! # $ % & ' ( ) * + , - . / : ; = ? @ [ ] ^ + _ { } ~, as well as characters in the ranges 0-9, A-Z and a-z. Any other character, including the space character, are not allowed. May not begin with .. -HOMEREALMDISCOVERYPOLICY : . +HOMEREALMDISCOVERYPOLICY : . To construct, see NOTES section for HOMEREALMDISCOVERYPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -114,7 +114,7 @@ HOMEREALMDISCOVERYPOLICY : . [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -274,7 +274,7 @@ HOMEREALMDISCOVERYPOLICY : . [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -INFO : informationalUrl +INFO : informationalUrl To construct, see NOTES section for INFO properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [MarketingUrl ]: Link to the application's marketing page. For example, https://www.contoso.com/app/marketing [PrivacyStatementUrl ]: Link to the application's privacy statement. For example, https://www.contoso.com/app/privacy @@ -291,7 +291,7 @@ KEYCREDENTIALS : key credentials associated with [Type ]: The type of key credential; for example, 'Symmetric'. [Usage ]: A string that describes the purpose for which the key can be used; for example, 'Verify'. -OPTIONALCLAIM : optionalClaims +OPTIONALCLAIM : optionalClaims To construct, see NOTES section for OPTIONALCLAIM properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [AccessToken ]: The optional claims returned in the JWT access token. [AdditionalProperty ]: Additional properties of the claim. If a property exists in this collection, it modifies the behavior of the optional claim specified in the name property. @@ -301,7 +301,7 @@ OPTIONALCLAIM : optionalClaims [IdToken ]: The optional claims returned in the JWT ID token. [Saml2Token ]: The optional claims returned in the SAML token. -PARENTALCONTROLSETTING : parentalControlSettings +PARENTALCONTROLSETTING : parentalControlSettings To construct, see NOTES section for PARENTALCONTROLSETTING properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [CountriesBlockedForMinor ]: Specifies the two-letter ISO country codes. Access to the application will be blocked for minors from the countries specified in this list. [LegalAgeGroupRule ]: Specifies the legal age group rule that applies to users of the app. Can be set to one of the following values: ValueDescriptionAllowDefault. Enforces the legal minimum. This means parental consent is required for minors in the European Union and Korea.RequireConsentForPrivacyServicesEnforces the user to specify date of birth to comply with COPPA rules. RequireConsentForMinorsRequires parental consent for ages below 18, regardless of country minor rules.RequireConsentForKidsRequires parental consent for ages below 14, regardless of country minor rules.BlockMinorsBlocks minors from using the app. @@ -313,13 +313,13 @@ PASSWORDCREDENTIALS : Password credentials [KeyId ]: The unique identifier for the password. [StartDateTime ]: The date and time at which the password becomes valid. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Optional. -REQUIREDRESOURCEACCESS : Specifies the resources that the application needs to access. This property also specifies the set of OAuth permission scopes and application roles that it needs for each of those resources. This configuration of access to the required resources drives the consent experience. Not nullable. Supports $filter (eq, NOT, ge, le). +REQUIREDRESOURCEACCESS : Specifies the resources that the application needs to access. This property also specifies the set of OAuth permission scopes and application roles that it needs for each of those resources. This configuration of access to the required resources drives the consent experience. Not nullable. Supports $filter (eq, NOT, ge, le). To construct, see NOTES section for REQUIREDRESOURCEACCESS properties and create a hash table. [ResourceAccess ]: The list of OAuth2.0 permission scopes and app roles that the application requires from the specified resource. [Id ]: The unique identifier for one of the oauth2PermissionScopes or appRole instances that the resource application exposes. [Type ]: Specifies whether the id property references an oauth2PermissionScopes or an appRole. Possible values are Scope or Role. [ResourceAppId ]: The unique identifier for the resource that the application requires access to. This should be equal to the appId declared on the target resource application. -TOKENISSUANCEPOLICY : . +TOKENISSUANCEPOLICY : . To construct, see NOTES section for TOKENISSUANCEPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -370,7 +370,7 @@ TOKENISSUANCEPOLICY : . [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -530,7 +530,7 @@ TOKENISSUANCEPOLICY : . [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -TOKENLIFETIMEPOLICY : The tokenLifetimePolicies assigned to this application. Supports $expand. +TOKENLIFETIMEPOLICY : The tokenLifetimePolicies assigned to this application. Supports $expand. To construct, see NOTES section for TOKENLIFETIMEPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -581,7 +581,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -741,7 +741,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -WEB : webApplication +WEB : webApplication To construct, see NOTES section for WEB properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [HomePageUrl ]: Home page or landing page of the application. [ImplicitGrantSetting ]: implicitGrantSettings @@ -1009,7 +1009,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential[]] # key credentials associated with the application. - # To construct, see NOTES section for KEYCREDENTIALS properties and create a hash table. ${KeyCredentials}, [Parameter(ParameterSetName='ApplicationWithPasswordCredentialParameterSet', Mandatory)] @@ -1017,7 +1016,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential[]] # Password credentials associated with the application. - # To construct, see NOTES section for PASSWORDCREDENTIALS properties and create a hash table. ${PasswordCredentials}, [Parameter(ParameterSetName='ApplicationWithKeyPlainParameterSet', Mandatory)] @@ -1102,7 +1100,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -1127,6 +1125,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/New-AzADGroup.ps1 b/generated/Resources/MSGraph.Autorest/exports/New-AzADGroup.ps1 index cc16bedf1a6a..f9d339cde46b 100644 --- a/generated/Resources/MSGraph.Autorest/exports/New-AzADGroup.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/New-AzADGroup.ps1 @@ -29,11 +29,11 @@ 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. -ACCEPTEDSENDER : The list of users or groups that are allowed to create post's or calendar events in this group. If this list is non-empty then only users or groups listed here are allowed to post. +ACCEPTEDSENDER : The list of users or groups that are allowed to create post's or calendar events in this group. If this list is non-empty then only users or groups listed here are allowed to post. To construct, see NOTES section for ACCEPTEDSENDER properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -APPROLEASSIGNMENT : Represents the app roles a group has been granted for an application. Supports $expand. +APPROLEASSIGNMENT : Represents the app roles a group has been granted for an application. Supports $expand. To construct, see NOTES section for APPROLEASSIGNMENT properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory [AppRoleId ]: The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. Required on create. @@ -44,11 +44,11 @@ APPROLEASSIGNMENT : Represents [ResourceDisplayName ]: The display name of the resource app's service principal to which the assignment is made. [ResourceId ]: The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports $filter (eq only). -CREATEDONBEHALFOF : Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity types. +CREATEDONBEHALFOF : Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity types. To construct, see NOTES section for CREATEDONBEHALFOF properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -PERMISSIONGRANT : The permissions that have been granted for a group to a specific application. Supports $expand. +PERMISSIONGRANT : The permissions that have been granted for a group to a specific application. Supports $expand. To construct, see NOTES section for PERMISSIONGRANT properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory [ClientAppId ]: ID of the service principal of the Azure AD app that has been granted access. Read-only. @@ -57,11 +57,11 @@ PERMISSIONGRANT : The permissi [PermissionType ]: The type of permission. Possible values are: Application, Delegated. Read-only. [ResourceAppId ]: ID of the Azure AD app that is hosting the resource. Read-only. -TRANSITIVEMEMBER : . +TRANSITIVEMEMBER : . To construct, see NOTES section for TRANSITIVEMEMBER properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -TRANSITIVEMEMBEROF : . +TRANSITIVEMEMBEROF : . To construct, see NOTES section for TRANSITIVEMEMBEROF properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory .Link @@ -342,7 +342,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -363,6 +363,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/New-AzADGroupOwner.ps1 b/generated/Resources/MSGraph.Autorest/exports/New-AzADGroupOwner.ps1 index 8ef5a59dd339..4af1ae5683e6 100644 --- a/generated/Resources/MSGraph.Autorest/exports/New-AzADGroupOwner.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/New-AzADGroupOwner.ps1 @@ -108,7 +108,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -129,6 +129,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/New-AzADServicePrincipal.ps1 b/generated/Resources/MSGraph.Autorest/exports/New-AzADServicePrincipal.ps1 index 84a89e23eb08..8cecf30bb85a 100644 --- a/generated/Resources/MSGraph.Autorest/exports/New-AzADServicePrincipal.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/New-AzADServicePrincipal.ps1 @@ -35,7 +35,7 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -ADDIN : Defines custom behavior that a consuming service can use to call an app in specific contexts. For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. This will let services like Microsoft 365 call the application in the context of a document the user is working on. +ADDIN : Defines custom behavior that a consuming service can use to call an app in specific contexts. For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. This will let services like Microsoft 365 call the application in the context of a document the user is working on. To construct, see NOTES section for ADDIN properties and create a hash table. [Id ]: [Property ]: [Key ]: Key. @@ -140,7 +140,7 @@ APPLICATIONOBJECT : The application object, could be [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -288,7 +288,7 @@ APPLICATIONOBJECT : The application object, could be [TokenLifetimePolicy ]: The tokenLifetimePolicies assigned to this application. Supports $expand. [Web ]: webApplication -APPROLE : The roles exposed by the application which this service principal represents. For more information see the appRoles property definition on the application entity. Not nullable. +APPROLE : The roles exposed by the application which this service principal represents. For more information see the appRoles property definition on the application entity. Not nullable. To construct, see NOTES section for APPROLE properties and create a hash table. [AllowedMemberType ]: Specifies whether this app role can be assigned to users and groups (by setting to ['User']), to other application's (by setting to ['Application'], or both (by setting to ['User', 'Application']). App roles supporting assignment to other applications' service principals are also known as application permissions. The 'Application' value is only supported for app roles defined on application entities. [Description ]: The description for the app role. This is displayed when the app role is being assigned and, if the app role functions as an application permission, during consent experiences. [DisplayName ]: Display name for the permission that appears in the app role assignment and consent experiences. @@ -296,7 +296,7 @@ APPROLE : The roles exposed by the application which t [IsEnabled ]: When creating or updating an app role, this must be set to true (which is the default). To delete a role, this must first be set to false. At that point, in a subsequent call, this role may be removed. [Value ]: Specifies the value to include in the roles claim in ID tokens and access tokens authenticating an assigned user or service principal. Must not exceed 120 characters in length. Allowed characters are : ! # $ % & ' ( ) * + , - . / : ; = ? @ [ ] ^ + _ { } ~, as well as characters in the ranges 0-9, A-Z and a-z. Any other character, including the space character, are not allowed. May not begin with .. -APPROLEASSIGNEDTO : App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. +APPROLEASSIGNEDTO : App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. To construct, see NOTES section for APPROLEASSIGNEDTO properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory [AppRoleId ]: The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. Required on create. @@ -304,7 +304,7 @@ APPROLEASSIGNEDTO : App role assignments for [ResourceDisplayName ]: The display name of the resource app's service principal to which the assignment is made. [ResourceId ]: The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports $filter (eq only). -APPROLEASSIGNMENT : App role assignment for another app or service, granted to this service principal. Supports $expand. +APPROLEASSIGNMENT : App role assignment for another app or service, granted to this service principal. Supports $expand. To construct, see NOTES section for APPROLEASSIGNMENT properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory [AppRoleId ]: The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. Required on create. @@ -312,7 +312,7 @@ APPROLEASSIGNMENT : App role assignment for [ResourceDisplayName ]: The display name of the resource app's service principal to which the assignment is made. [ResourceId ]: The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports $filter (eq only). -CLAIMSMAPPINGPOLICY : The claimsMappingPolicies assigned to this service principal. Supports $expand. +CLAIMSMAPPINGPOLICY : The claimsMappingPolicies assigned to this service principal. Supports $expand. To construct, see NOTES section for CLAIMSMAPPINGPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -363,7 +363,7 @@ CLAIMSMAPPINGPOLICY : The claimsMappingPol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -529,16 +529,16 @@ CLAIMSMAPPINGPOLICY : The claimsMappingPol [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -DELEGATEDPERMISSIONCLASSIFICATION : The permission classifications for delegated permissions exposed by the app that this service principal represents. Supports $expand. +DELEGATEDPERMISSIONCLASSIFICATION : The permission classifications for delegated permissions exposed by the app that this service principal represents. Supports $expand. To construct, see NOTES section for DELEGATEDPERMISSIONCLASSIFICATION properties and create a hash table. [Classification ]: permissionClassificationType [PermissionId ]: The unique identifier (id) for the delegated permission listed in the publishedPermissionScopes collection of the servicePrincipal. Required on create. Does not support $filter. [PermissionName ]: The claim value (value) for the delegated permission listed in the publishedPermissionScopes collection of the servicePrincipal. Does not support $filter. -ENDPOINT : Endpoints available for discovery. Services like Sharepoint populate this property with a tenant specific SharePoint endpoints that other applications can discover and use in their experiences. +ENDPOINT : Endpoints available for discovery. Services like Sharepoint populate this property with a tenant specific SharePoint endpoints that other applications can discover and use in their experiences. To construct, see NOTES section for ENDPOINT properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -HOMEREALMDISCOVERYPOLICY : The homeRealmDiscoveryPolicies assigned to this service principal. Supports $expand. +HOMEREALMDISCOVERYPOLICY : The homeRealmDiscoveryPolicies assigned to this service principal. Supports $expand. To construct, see NOTES section for HOMEREALMDISCOVERYPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -589,7 +589,7 @@ HOMEREALMDISCOVERYPOLICY : The homeRe [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -749,7 +749,7 @@ HOMEREALMDISCOVERYPOLICY : The homeRe [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -INFO : informationalUrl +INFO : informationalUrl To construct, see NOTES section for INFO properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [MarketingUrl ]: Link to the application's marketing page. For example, https://www.contoso.com/app/marketing [PrivacyStatementUrl ]: Link to the application's privacy statement. For example, https://www.contoso.com/app/privacy @@ -766,7 +766,7 @@ KEYCREDENTIAL : key credentials associated with [Type ]: The type of key credential; for example, 'Symmetric'. [Usage ]: A string that describes the purpose for which the key can be used; for example, 'Verify'. -OAUTH2PERMISSIONSCOPE : The delegated permissions exposed by the application. For more information see the oauth2PermissionScopes property on the application entity's api property. Not nullable. +OAUTH2PERMISSIONSCOPE : The delegated permissions exposed by the application. For more information see the oauth2PermissionScopes property on the application entity's api property. Not nullable. To construct, see NOTES section for OAUTH2PERMISSIONSCOPE properties and create a hash table. [AdminConsentDescription ]: A description of the delegated permissions, intended to be read by an administrator granting the permission on behalf of all users. This text appears in tenant-wide admin consent experiences. [AdminConsentDisplayName ]: The permission's title, intended to be read by an administrator granting the permission on behalf of all users. [Id ]: Unique delegated permission identifier inside the collection of delegated permissions defined for a resource application. @@ -784,11 +784,11 @@ PASSWORDCREDENTIAL : Password credentials a [KeyId ]: The unique identifier for the password. [StartDateTime ]: The date and time at which the password becomes valid. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Optional. -SAMLSINGLESIGNONSETTING : samlSingleSignOnSettings +SAMLSINGLESIGNONSETTING : samlSingleSignOnSettings To construct, see NOTES section for SAMLSINGLESIGNONSETTING properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [RelayState ]: The relative URI the service provider would redirect to after completion of the single sign-on flow. -TOKENISSUANCEPOLICY : The tokenIssuancePolicies assigned to this service principal. Supports $expand. +TOKENISSUANCEPOLICY : The tokenIssuancePolicies assigned to this service principal. Supports $expand. To construct, see NOTES section for TOKENISSUANCEPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -839,7 +839,7 @@ TOKENISSUANCEPOLICY : The tokenIssuancePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -999,7 +999,7 @@ TOKENISSUANCEPOLICY : The tokenIssuancePol [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -TOKENLIFETIMEPOLICY : The tokenLifetimePolicies assigned to this service principal. Supports $expand. +TOKENLIFETIMEPOLICY : The tokenLifetimePolicies assigned to this service principal. Supports $expand. To construct, see NOTES section for TOKENLIFETIMEPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -1050,7 +1050,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -1210,7 +1210,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -TRANSITIVEMEMBEROF : . +TRANSITIVEMEMBEROF : . To construct, see NOTES section for TRANSITIVEMEMBEROF properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory .Link @@ -1554,7 +1554,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential[]] # key credentials associated with the service principal. - # To construct, see NOTES section for KEYCREDENTIAL properties and create a hash table. ${KeyCredential}, [Parameter(ParameterSetName='DisplayNameWithPasswordCredentialParameterSet', Mandatory)] @@ -1563,14 +1562,12 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential[]] # Password credentials associated with the service principal. - # To construct, see NOTES section for PASSWORDCREDENTIAL properties and create a hash table. ${PasswordCredential}, [Parameter(ParameterSetName='ApplicationObjectParameterSet', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication] # The application object, could be used as pipeline input. - # To construct, see NOTES section for APPLICATIONOBJECT properties and create a hash table. ${ApplicationObject}, [Parameter(ParameterSetName='ApplicationIdParameterSet')] @@ -1637,7 +1634,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -1663,6 +1660,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/New-AzADServicePrincipalAppRoleAssignment.ps1 b/generated/Resources/MSGraph.Autorest/exports/New-AzADServicePrincipalAppRoleAssignment.ps1 index 19a2d90c6e2b..96c851247f64 100644 --- a/generated/Resources/MSGraph.Autorest/exports/New-AzADServicePrincipalAppRoleAssignment.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/New-AzADServicePrincipalAppRoleAssignment.ps1 @@ -145,7 +145,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -169,6 +169,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/New-AzADSpCredential.ps1 b/generated/Resources/MSGraph.Autorest/exports/New-AzADSpCredential.ps1 index 5ceeebd56317..41a7822d49ae 100644 --- a/generated/Resources/MSGraph.Autorest/exports/New-AzADSpCredential.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/New-AzADSpCredential.ps1 @@ -140,7 +140,7 @@ SERVICEPRINCIPALOBJECT : The service principal [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -377,7 +377,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential[]] # Password credentials associated with the service principal. - # To construct, see NOTES section for PASSWORDCREDENTIALS properties and create a hash table. ${PasswordCredentials}, [Parameter(ParameterSetName='SpObjectIdWithKeyCredentialParameterSet', Mandatory)] @@ -386,7 +385,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential[]] # key credentials associated with the service principal. - # To construct, see NOTES section for KEYCREDENTIALS properties and create a hash table. ${KeyCredentials}, [Parameter(ParameterSetName='SpObjectIdWithCertValueParameterSet', Mandatory)] @@ -415,7 +413,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal] # The service principal object, could be used as pipeline input. - # To construct, see NOTES section for SERVICEPRINCIPALOBJECT properties and create a hash table. ${ServicePrincipalObject}, [Parameter()] @@ -475,7 +472,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -507,6 +504,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/New-AzADUser.ps1 b/generated/Resources/MSGraph.Autorest/exports/New-AzADUser.ps1 index 380262330540..4b6723a032be 100644 --- a/generated/Resources/MSGraph.Autorest/exports/New-AzADUser.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/New-AzADUser.ps1 @@ -34,7 +34,7 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -PASSWORDPROFILE : passwordProfile +PASSWORDPROFILE : passwordProfile To construct, see NOTES section for PASSWORDPROFILE properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [ForceChangePasswordNextSignIn ]: true if the user must change her password on the next login; otherwise false. If not set, default is false. NOTE: For Azure B2C tenants, set to false and instead use custom policies and user flows to force password reset at first sign in. See Force password reset at first logon. [ForceChangePasswordNextSignInWithMfa ]: If true, at next sign-in, the user must perform a multi-factor authentication (MFA) before being forced to change their password. The behavior is identical to forceChangePasswordNextSignIn except that the user is required to first perform a multi-factor authentication before password change. After a password change, this property will be automatically reset to false. If not set, default is false. @@ -483,7 +483,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -505,6 +505,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/Resources/MSGraph.Autorest/exports/ProxyCmdletDefinitions.ps1 index fd58bf86fd26..3b6b996989a2 100644 --- a/generated/Resources/MSGraph.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -113,7 +113,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -165,7 +166,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -186,6 +187,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -305,7 +310,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -357,7 +363,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -378,6 +384,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -509,7 +519,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -561,7 +572,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -583,6 +594,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -667,7 +682,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -725,7 +741,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -746,6 +762,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -826,7 +846,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -884,7 +905,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -905,6 +926,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -989,7 +1014,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1047,7 +1073,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -1068,6 +1094,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -1114,9 +1144,9 @@ end { <# .Synopsis -Update the navigation property federatedIdentityCredentials in applications +update the navigation property federatedIdentityCredentials in applications .Description -Update the navigation property federatedIdentityCredentials in applications +update the navigation property federatedIdentityCredentials in applications .Example Update-AzADAppFederatedCredential -ApplicationObjectId $appObjectId -FederatedCredentialId $credentialId -Subject 'subject' @@ -1141,13 +1171,13 @@ param( # key: id of federatedIdentityCredential ${FederatedCredentialId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Collections.Hashtable] # Additional Parameters ${AdditionalProperties}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -1158,14 +1188,14 @@ param( # Required. ${Audience}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The un-validated, user-provided description of the federated identity credential. # Optional. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The URL of the external identity provider and must match the issuer claim of the external token being exchanged. @@ -1173,7 +1203,7 @@ param( # Required. ${Issuer}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Required. @@ -1184,12 +1214,25 @@ param( # Supports $filter (eq). ${Subject}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1247,7 +1290,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -1265,9 +1308,15 @@ begin { $mapping = @{ UpdateExpanded = 'Az.MSGraph.private\Update-AzADAppFederatedCredential_UpdateExpanded'; + UpdateViaJsonFilePath = 'Az.MSGraph.private\Update-AzADAppFederatedCredential_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.MSGraph.private\Update-AzADAppFederatedCredential_UpdateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -1314,9 +1363,9 @@ end { <# .Synopsis -Update entity in groups +update entity in groups .Description -Update entity in groups +update entity in groups .Example Update-AzADGroup -ObjectId $objectid -Description $description @@ -1364,22 +1413,21 @@ param( # key: id of group ${ObjectId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Collections.Hashtable] # Additional Parameters ${AdditionalProperties}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentAutoGenerated[]] # Represents the app roles a group has been granted for an application. # Supports $expand. - # To construct, see NOTES section for APPROLEASSIGNMENT properties and create a hash table. ${AppRoleAssignment}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Describes a classification for the group (such as low, medium or high business impact). @@ -1387,21 +1435,20 @@ param( # Supports $filter (eq, ne, NOT, ge, le, startsWith). ${Classification}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject] # Represents an Azure Active Directory object. # The directoryObject type is the base type for many other directory entity types. - # To construct, see NOTES section for CREATEDONBEHALFOF properties and create a hash table. ${CreatedOnBehalfOf}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # . ${DeletedDateTime}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # An optional description for the group. @@ -1409,13 +1456,13 @@ param( # Supports $filter (eq, ne, NOT, ge, le, startsWith) and $search. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name displayed in directory ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -1426,7 +1473,7 @@ param( # Supports $filter (eq, NOT). ${GroupType}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether there are members in this group that have license errors from its group-based license assignment. @@ -1435,13 +1482,13 @@ param( # Supports $filter (eq). ${HasMembersWithLicenseError}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # . ${IsArchived}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether this group can be assigned to an Azure Active Directory role.This property can only be set while creating the group and is immutable. @@ -1452,7 +1499,7 @@ param( # Supports $filter (eq, ne, NOT). ${IsAssignableToRole}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Specifies whether the group is mail-enabled. @@ -1460,7 +1507,7 @@ param( # Supports $filter (eq, ne, NOT). ${MailEnabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The mail alias for the group, unique in the organization. @@ -1470,7 +1517,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${MailNickname}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The rule that determines members for this group if the group is a dynamic group (groupTypes contains DynamicMembership). @@ -1479,7 +1526,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, startsWith). ${MembershipRule}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Indicates whether the dynamic membership processing is on or paused. @@ -1488,16 +1535,15 @@ param( # Supports $filter (eq, ne, NOT, in). ${MembershipRuleProcessingState}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphResourceSpecificPermissionGrant[]] # The permissions that have been granted for a group to a specific application. # Supports $expand. - # To construct, see NOTES section for PERMISSIONGRANT properties and create a hash table. ${PermissionGrant}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The preferred data location for the group. @@ -1505,7 +1551,7 @@ param( # Returned by default. ${PreferredDataLocation}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The preferred language for a Microsoft 365 group. @@ -1514,7 +1560,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${PreferredLanguage}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Specifies whether the group is a security group. @@ -1522,14 +1568,14 @@ param( # Supports $filter (eq, ne, NOT, in). ${SecurityEnabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Security identifier of the group, used in Windows scenarios. # Returned by default. ${SecurityIdentifier}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies a Microsoft 365 group's color theme. @@ -1537,7 +1583,7 @@ param( # Returned by default. ${Theme}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the group join policy and group content visibility for groups. @@ -1550,12 +1596,25 @@ param( # Returned by default. ${Visibility}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1613,7 +1672,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -1631,9 +1690,15 @@ begin { $mapping = @{ UpdateExpanded = 'Az.MSGraph.private\Update-AzADGroup_UpdateExpanded'; + UpdateViaJsonFilePath = 'Az.MSGraph.private\Update-AzADGroup_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.MSGraph.private\Update-AzADGroup_UpdateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -1680,9 +1745,9 @@ end { <# .Synopsis -Update the navigation property appRoleAssignments in servicePrincipals +update the navigation property appRoleAssignments in servicePrincipals .Description -Update the navigation property appRoleAssignments in servicePrincipals +update the navigation property appRoleAssignments in servicePrincipals .Example Update-AzADServicePrincipalAppRoleAssignment -AppRoleAssignmentId Zbm-cUeDXUmlicIc3eenIoFW9pZ_gRBIudKgu0gaMIw -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 -AppRoleId 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 @@ -1727,7 +1792,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment] # Represents an Azure Active Directory object. # The directoryObject type is the base type for many other directory entity types. - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='UpdateExpanded')] @@ -1745,12 +1809,25 @@ param( # Required on create. ${AppRoleId}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1808,7 +1885,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -1827,9 +1904,15 @@ begin { $mapping = @{ Update = 'Az.MSGraph.private\Update-AzADServicePrincipalAppRoleAssignment_Update'; UpdateExpanded = 'Az.MSGraph.private\Update-AzADServicePrincipalAppRoleAssignment_UpdateExpanded'; + UpdateViaJsonFilePath = 'Az.MSGraph.private\Update-AzADServicePrincipalAppRoleAssignment_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.MSGraph.private\Update-AzADServicePrincipalAppRoleAssignment_UpdateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -1993,7 +2076,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -2015,6 +2098,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -2143,7 +2230,7 @@ TARGETGROUPOBJECT : The target group object, could be used [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -2450,7 +2537,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphGroup] # The target group object, could be used as pipeline input. - # To construct, see NOTES section for TARGETGROUPOBJECT properties and create a hash table. ${TargetGroupObject}, [Parameter()] @@ -2516,7 +2602,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -2542,6 +2628,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -2703,7 +2793,7 @@ APPLICATIONOBJECT : The application object, could be [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -2880,7 +2970,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication] # The application object, could be used as pipeline input. - # To construct, see NOTES section for APPLICATIONOBJECT properties and create a hash table. ${ApplicationObject}, [Parameter()] @@ -2940,7 +3029,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -2964,6 +3053,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -3121,7 +3214,7 @@ APPLICATIONOBJECT : application object [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -3296,7 +3389,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphApplication] # application object - # To construct, see NOTES section for APPLICATIONOBJECT properties and create a hash table. ${ApplicationObject}, [Parameter()] @@ -3413,7 +3505,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -3437,6 +3529,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -3672,7 +3768,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -3699,6 +3795,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -3829,7 +3929,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -3851,6 +3951,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -4072,7 +4176,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -4096,6 +4200,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -4224,7 +4332,7 @@ GROUPOBJECT : The target group object, could be used as pi [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -4556,7 +4664,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup] # The target group object, could be used as pipeline input. - # To construct, see NOTES section for GROUPOBJECT properties and create a hash table. ${GroupObject}, [Parameter()] @@ -4616,7 +4723,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -4639,6 +4746,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -4811,7 +4922,7 @@ APPLICATIONOBJECT : The service principal object, co [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -5028,7 +5139,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Query')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication] # The service principal object, could be used as pipeline input. - # To construct, see NOTES section for APPLICATIONOBJECT properties and create a hash table. ${ApplicationObject}, [Parameter(ParameterSetName='SPNParameterSet', Mandatory)] @@ -5127,7 +5237,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -5154,6 +5264,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -5300,7 +5414,7 @@ SERVICEPRINCIPALOBJECT : The service principal [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -5518,7 +5632,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal] # The service principal object, could be used as pipeline input. - # To construct, see NOTES section for SERVICEPRINCIPALOBJECT properties and create a hash table. ${ServicePrincipalObject}, [Parameter()] @@ -5578,7 +5691,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -5602,6 +5715,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -5844,7 +5961,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -5871,6 +5988,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -6043,7 +6164,7 @@ APPLICATIONOBJECT : The application object, could be [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -6268,7 +6389,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential[]] # Password credentials associated with the application. - # To construct, see NOTES section for PASSWORDCREDENTIALS properties and create a hash table. ${PasswordCredentials}, [Parameter(ParameterSetName='ApplicationObjectIdWithKeyCredentialParameterSet', Mandatory)] @@ -6278,7 +6398,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential[]] # key credentials associated with the application. - # To construct, see NOTES section for KEYCREDENTIALS properties and create a hash table. ${KeyCredentials}, [Parameter(ParameterSetName='ApplicationObjectIdWithCertValueParameterSet', Mandatory)] @@ -6316,7 +6435,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication] # The application object, could be used as pipeline input. - # To construct, see NOTES section for APPLICATIONOBJECT properties and create a hash table. ${ApplicationObject}, [Parameter()] @@ -6376,7 +6494,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -6412,6 +6530,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -6589,7 +6711,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -6610,6 +6732,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -6669,14 +6795,14 @@ 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. -ADDIN : Defines custom behavior that a consuming service can use to call an app in specific contexts. For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. This will let services like Office 365 call the application in the context of a document the user is working on. +ADDIN : Defines custom behavior that a consuming service can use to call an app in specific contexts. For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. This will let services like Office 365 call the application in the context of a document the user is working on. To construct, see NOTES section for ADDIN properties and create a hash table. [Id ]: [Property ]: [Key ]: Key. [Value ]: Value. [Type ]: -API : apiApplication +API : apiApplication To construct, see NOTES section for API properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [AcceptMappedClaim ]: When true, allows an application to use claims mapping without specifying a custom signing key. [KnownClientApplication ]: Used for bundling consent if you have a solution that contains two parts: a client app and a custom web API app. If you set the appID of the client app to this value, the user only consents once to the client app. Azure AD knows that consenting to the client means implicitly consenting to the web API and automatically provisions service principals for both APIs at the same time. Both the client and the web API app must be registered in the same tenant. @@ -6695,7 +6821,7 @@ API : apiApplication [DelegatedPermissionId ]: The unique identifier for the oauth2PermissionScopes the application requires. [RequestedAccessTokenVersion ]: Specifies the access token version expected by this resource. This changes the version and format of the JWT produced independent of the endpoint or client used to request the access token. The endpoint used, v1.0 or v2.0, is chosen by the client and only impacts the version of id_tokens. Resources need to explicitly configure requestedAccessTokenVersion to indicate the supported access token format. Possible values for requestedAccessTokenVersion are 1, 2, or null. If the value is null, this defaults to 1, which corresponds to the v1.0 endpoint. If signInAudience on the application is configured as AzureADandPersonalMicrosoftAccount, the value for this property must be 2 -APPROLE : The collection of roles assigned to the application. With app role assignments, these roles can be assigned to users, groups, or service principals associated with other applications. Not nullable. +APPROLE : The collection of roles assigned to the application. With app role assignments, these roles can be assigned to users, groups, or service principals associated with other applications. Not nullable. To construct, see NOTES section for APPROLE properties and create a hash table. [AllowedMemberType ]: Specifies whether this app role can be assigned to users and groups (by setting to ['User']), to other application's (by setting to ['Application'], or both (by setting to ['User', 'Application']). App roles supporting assignment to other applications' service principals are also known as application permissions. The 'Application' value is only supported for app roles defined on application entities. [Description ]: The description for the app role. This is displayed when the app role is being assigned and, if the app role functions as an application permission, during consent experiences. [DisplayName ]: Display name for the permission that appears in the app role assignment and consent experiences. @@ -6703,7 +6829,7 @@ APPROLE : The collection of roles assigned to the appl [IsEnabled ]: When creating or updating an app role, this must be set to true (which is the default). To delete a role, this must first be set to false. At that point, in a subsequent call, this role may be removed. [Value ]: Specifies the value to include in the roles claim in ID tokens and access tokens authenticating an assigned user or service principal. Must not exceed 120 characters in length. Allowed characters are : ! # $ % & ' ( ) * + , - . / : ; = ? @ [ ] ^ + _ { } ~, as well as characters in the ranges 0-9, A-Z and a-z. Any other character, including the space character, are not allowed. May not begin with .. -HOMEREALMDISCOVERYPOLICY : . +HOMEREALMDISCOVERYPOLICY : . To construct, see NOTES section for HOMEREALMDISCOVERYPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -6754,7 +6880,7 @@ HOMEREALMDISCOVERYPOLICY : . [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -6914,7 +7040,7 @@ HOMEREALMDISCOVERYPOLICY : . [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -INFO : informationalUrl +INFO : informationalUrl To construct, see NOTES section for INFO properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [MarketingUrl ]: Link to the application's marketing page. For example, https://www.contoso.com/app/marketing [PrivacyStatementUrl ]: Link to the application's privacy statement. For example, https://www.contoso.com/app/privacy @@ -6931,7 +7057,7 @@ KEYCREDENTIALS : key credentials associated with [Type ]: The type of key credential; for example, 'Symmetric'. [Usage ]: A string that describes the purpose for which the key can be used; for example, 'Verify'. -OPTIONALCLAIM : optionalClaims +OPTIONALCLAIM : optionalClaims To construct, see NOTES section for OPTIONALCLAIM properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [AccessToken ]: The optional claims returned in the JWT access token. [AdditionalProperty ]: Additional properties of the claim. If a property exists in this collection, it modifies the behavior of the optional claim specified in the name property. @@ -6941,7 +7067,7 @@ OPTIONALCLAIM : optionalClaims [IdToken ]: The optional claims returned in the JWT ID token. [Saml2Token ]: The optional claims returned in the SAML token. -PARENTALCONTROLSETTING : parentalControlSettings +PARENTALCONTROLSETTING : parentalControlSettings To construct, see NOTES section for PARENTALCONTROLSETTING properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [CountriesBlockedForMinor ]: Specifies the two-letter ISO country codes. Access to the application will be blocked for minors from the countries specified in this list. [LegalAgeGroupRule ]: Specifies the legal age group rule that applies to users of the app. Can be set to one of the following values: ValueDescriptionAllowDefault. Enforces the legal minimum. This means parental consent is required for minors in the European Union and Korea.RequireConsentForPrivacyServicesEnforces the user to specify date of birth to comply with COPPA rules. RequireConsentForMinorsRequires parental consent for ages below 18, regardless of country minor rules.RequireConsentForKidsRequires parental consent for ages below 14, regardless of country minor rules.BlockMinorsBlocks minors from using the app. @@ -6953,13 +7079,13 @@ PASSWORDCREDENTIALS : Password credentials [KeyId ]: The unique identifier for the password. [StartDateTime ]: The date and time at which the password becomes valid. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Optional. -REQUIREDRESOURCEACCESS : Specifies the resources that the application needs to access. This property also specifies the set of OAuth permission scopes and application roles that it needs for each of those resources. This configuration of access to the required resources drives the consent experience. Not nullable. Supports $filter (eq, NOT, ge, le). +REQUIREDRESOURCEACCESS : Specifies the resources that the application needs to access. This property also specifies the set of OAuth permission scopes and application roles that it needs for each of those resources. This configuration of access to the required resources drives the consent experience. Not nullable. Supports $filter (eq, NOT, ge, le). To construct, see NOTES section for REQUIREDRESOURCEACCESS properties and create a hash table. [ResourceAccess ]: The list of OAuth2.0 permission scopes and app roles that the application requires from the specified resource. [Id ]: The unique identifier for one of the oauth2PermissionScopes or appRole instances that the resource application exposes. [Type ]: Specifies whether the id property references an oauth2PermissionScopes or an appRole. Possible values are Scope or Role. [ResourceAppId ]: The unique identifier for the resource that the application requires access to. This should be equal to the appId declared on the target resource application. -TOKENISSUANCEPOLICY : . +TOKENISSUANCEPOLICY : . To construct, see NOTES section for TOKENISSUANCEPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -7010,7 +7136,7 @@ TOKENISSUANCEPOLICY : . [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -7170,7 +7296,7 @@ TOKENISSUANCEPOLICY : . [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -TOKENLIFETIMEPOLICY : The tokenLifetimePolicies assigned to this application. Supports $expand. +TOKENLIFETIMEPOLICY : The tokenLifetimePolicies assigned to this application. Supports $expand. To construct, see NOTES section for TOKENLIFETIMEPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -7221,7 +7347,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -7381,7 +7507,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -WEB : webApplication +WEB : webApplication To construct, see NOTES section for WEB properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [HomePageUrl ]: Home page or landing page of the application. [ImplicitGrantSetting ]: implicitGrantSettings @@ -7649,7 +7775,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential[]] # key credentials associated with the application. - # To construct, see NOTES section for KEYCREDENTIALS properties and create a hash table. ${KeyCredentials}, [Parameter(ParameterSetName='ApplicationWithPasswordCredentialParameterSet', Mandatory)] @@ -7657,7 +7782,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential[]] # Password credentials associated with the application. - # To construct, see NOTES section for PASSWORDCREDENTIALS properties and create a hash table. ${PasswordCredentials}, [Parameter(ParameterSetName='ApplicationWithKeyPlainParameterSet', Mandatory)] @@ -7742,7 +7866,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -7767,6 +7891,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -7826,11 +7954,11 @@ 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. -ACCEPTEDSENDER : The list of users or groups that are allowed to create post's or calendar events in this group. If this list is non-empty then only users or groups listed here are allowed to post. +ACCEPTEDSENDER : The list of users or groups that are allowed to create post's or calendar events in this group. If this list is non-empty then only users or groups listed here are allowed to post. To construct, see NOTES section for ACCEPTEDSENDER properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -APPROLEASSIGNMENT : Represents the app roles a group has been granted for an application. Supports $expand. +APPROLEASSIGNMENT : Represents the app roles a group has been granted for an application. Supports $expand. To construct, see NOTES section for APPROLEASSIGNMENT properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory [AppRoleId ]: The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. Required on create. @@ -7841,11 +7969,11 @@ APPROLEASSIGNMENT : Represents [ResourceDisplayName ]: The display name of the resource app's service principal to which the assignment is made. [ResourceId ]: The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports $filter (eq only). -CREATEDONBEHALFOF : Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity types. +CREATEDONBEHALFOF : Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity types. To construct, see NOTES section for CREATEDONBEHALFOF properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -PERMISSIONGRANT : The permissions that have been granted for a group to a specific application. Supports $expand. +PERMISSIONGRANT : The permissions that have been granted for a group to a specific application. Supports $expand. To construct, see NOTES section for PERMISSIONGRANT properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory [ClientAppId ]: ID of the service principal of the Azure AD app that has been granted access. Read-only. @@ -7854,11 +7982,11 @@ PERMISSIONGRANT : The permissi [PermissionType ]: The type of permission. Possible values are: Application, Delegated. Read-only. [ResourceAppId ]: ID of the Azure AD app that is hosting the resource. Read-only. -TRANSITIVEMEMBER : . +TRANSITIVEMEMBER : . To construct, see NOTES section for TRANSITIVEMEMBER properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -TRANSITIVEMEMBEROF : . +TRANSITIVEMEMBEROF : . To construct, see NOTES section for TRANSITIVEMEMBEROF properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory .Link @@ -8139,7 +8267,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -8160,6 +8288,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -8298,7 +8430,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -8319,6 +8451,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -8384,7 +8520,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. -ADDIN : Defines custom behavior that a consuming service can use to call an app in specific contexts. For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. This will let services like Microsoft 365 call the application in the context of a document the user is working on. +ADDIN : Defines custom behavior that a consuming service can use to call an app in specific contexts. For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. This will let services like Microsoft 365 call the application in the context of a document the user is working on. To construct, see NOTES section for ADDIN properties and create a hash table. [Id ]: [Property ]: [Key ]: Key. @@ -8489,7 +8625,7 @@ APPLICATIONOBJECT : The application object, could be [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -8637,7 +8773,7 @@ APPLICATIONOBJECT : The application object, could be [TokenLifetimePolicy ]: The tokenLifetimePolicies assigned to this application. Supports $expand. [Web ]: webApplication -APPROLE : The roles exposed by the application which this service principal represents. For more information see the appRoles property definition on the application entity. Not nullable. +APPROLE : The roles exposed by the application which this service principal represents. For more information see the appRoles property definition on the application entity. Not nullable. To construct, see NOTES section for APPROLE properties and create a hash table. [AllowedMemberType ]: Specifies whether this app role can be assigned to users and groups (by setting to ['User']), to other application's (by setting to ['Application'], or both (by setting to ['User', 'Application']). App roles supporting assignment to other applications' service principals are also known as application permissions. The 'Application' value is only supported for app roles defined on application entities. [Description ]: The description for the app role. This is displayed when the app role is being assigned and, if the app role functions as an application permission, during consent experiences. [DisplayName ]: Display name for the permission that appears in the app role assignment and consent experiences. @@ -8645,7 +8781,7 @@ APPROLE : The roles exposed by the application which t [IsEnabled ]: When creating or updating an app role, this must be set to true (which is the default). To delete a role, this must first be set to false. At that point, in a subsequent call, this role may be removed. [Value ]: Specifies the value to include in the roles claim in ID tokens and access tokens authenticating an assigned user or service principal. Must not exceed 120 characters in length. Allowed characters are : ! # $ % & ' ( ) * + , - . / : ; = ? @ [ ] ^ + _ { } ~, as well as characters in the ranges 0-9, A-Z and a-z. Any other character, including the space character, are not allowed. May not begin with .. -APPROLEASSIGNEDTO : App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. +APPROLEASSIGNEDTO : App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. To construct, see NOTES section for APPROLEASSIGNEDTO properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory [AppRoleId ]: The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. Required on create. @@ -8653,7 +8789,7 @@ APPROLEASSIGNEDTO : App role assignments for [ResourceDisplayName ]: The display name of the resource app's service principal to which the assignment is made. [ResourceId ]: The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports $filter (eq only). -APPROLEASSIGNMENT : App role assignment for another app or service, granted to this service principal. Supports $expand. +APPROLEASSIGNMENT : App role assignment for another app or service, granted to this service principal. Supports $expand. To construct, see NOTES section for APPROLEASSIGNMENT properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory [AppRoleId ]: The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. Required on create. @@ -8661,7 +8797,7 @@ APPROLEASSIGNMENT : App role assignment for [ResourceDisplayName ]: The display name of the resource app's service principal to which the assignment is made. [ResourceId ]: The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports $filter (eq only). -CLAIMSMAPPINGPOLICY : The claimsMappingPolicies assigned to this service principal. Supports $expand. +CLAIMSMAPPINGPOLICY : The claimsMappingPolicies assigned to this service principal. Supports $expand. To construct, see NOTES section for CLAIMSMAPPINGPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -8712,7 +8848,7 @@ CLAIMSMAPPINGPOLICY : The claimsMappingPol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -8878,16 +9014,16 @@ CLAIMSMAPPINGPOLICY : The claimsMappingPol [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -DELEGATEDPERMISSIONCLASSIFICATION : The permission classifications for delegated permissions exposed by the app that this service principal represents. Supports $expand. +DELEGATEDPERMISSIONCLASSIFICATION : The permission classifications for delegated permissions exposed by the app that this service principal represents. Supports $expand. To construct, see NOTES section for DELEGATEDPERMISSIONCLASSIFICATION properties and create a hash table. [Classification ]: permissionClassificationType [PermissionId ]: The unique identifier (id) for the delegated permission listed in the publishedPermissionScopes collection of the servicePrincipal. Required on create. Does not support $filter. [PermissionName ]: The claim value (value) for the delegated permission listed in the publishedPermissionScopes collection of the servicePrincipal. Does not support $filter. -ENDPOINT : Endpoints available for discovery. Services like Sharepoint populate this property with a tenant specific SharePoint endpoints that other applications can discover and use in their experiences. +ENDPOINT : Endpoints available for discovery. Services like Sharepoint populate this property with a tenant specific SharePoint endpoints that other applications can discover and use in their experiences. To construct, see NOTES section for ENDPOINT properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -HOMEREALMDISCOVERYPOLICY : The homeRealmDiscoveryPolicies assigned to this service principal. Supports $expand. +HOMEREALMDISCOVERYPOLICY : The homeRealmDiscoveryPolicies assigned to this service principal. Supports $expand. To construct, see NOTES section for HOMEREALMDISCOVERYPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -8938,7 +9074,7 @@ HOMEREALMDISCOVERYPOLICY : The homeRe [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -9098,7 +9234,7 @@ HOMEREALMDISCOVERYPOLICY : The homeRe [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -INFO : informationalUrl +INFO : informationalUrl To construct, see NOTES section for INFO properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [MarketingUrl ]: Link to the application's marketing page. For example, https://www.contoso.com/app/marketing [PrivacyStatementUrl ]: Link to the application's privacy statement. For example, https://www.contoso.com/app/privacy @@ -9115,7 +9251,7 @@ KEYCREDENTIAL : key credentials associated with [Type ]: The type of key credential; for example, 'Symmetric'. [Usage ]: A string that describes the purpose for which the key can be used; for example, 'Verify'. -OAUTH2PERMISSIONSCOPE : The delegated permissions exposed by the application. For more information see the oauth2PermissionScopes property on the application entity's api property. Not nullable. +OAUTH2PERMISSIONSCOPE : The delegated permissions exposed by the application. For more information see the oauth2PermissionScopes property on the application entity's api property. Not nullable. To construct, see NOTES section for OAUTH2PERMISSIONSCOPE properties and create a hash table. [AdminConsentDescription ]: A description of the delegated permissions, intended to be read by an administrator granting the permission on behalf of all users. This text appears in tenant-wide admin consent experiences. [AdminConsentDisplayName ]: The permission's title, intended to be read by an administrator granting the permission on behalf of all users. [Id ]: Unique delegated permission identifier inside the collection of delegated permissions defined for a resource application. @@ -9133,11 +9269,11 @@ PASSWORDCREDENTIAL : Password credentials a [KeyId ]: The unique identifier for the password. [StartDateTime ]: The date and time at which the password becomes valid. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Optional. -SAMLSINGLESIGNONSETTING : samlSingleSignOnSettings +SAMLSINGLESIGNONSETTING : samlSingleSignOnSettings To construct, see NOTES section for SAMLSINGLESIGNONSETTING properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [RelayState ]: The relative URI the service provider would redirect to after completion of the single sign-on flow. -TOKENISSUANCEPOLICY : The tokenIssuancePolicies assigned to this service principal. Supports $expand. +TOKENISSUANCEPOLICY : The tokenIssuancePolicies assigned to this service principal. Supports $expand. To construct, see NOTES section for TOKENISSUANCEPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -9188,7 +9324,7 @@ TOKENISSUANCEPOLICY : The tokenIssuancePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -9348,7 +9484,7 @@ TOKENISSUANCEPOLICY : The tokenIssuancePol [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -TOKENLIFETIMEPOLICY : The tokenLifetimePolicies assigned to this service principal. Supports $expand. +TOKENLIFETIMEPOLICY : The tokenLifetimePolicies assigned to this service principal. Supports $expand. To construct, see NOTES section for TOKENLIFETIMEPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -9399,7 +9535,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -9559,7 +9695,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -TRANSITIVEMEMBEROF : . +TRANSITIVEMEMBEROF : . To construct, see NOTES section for TRANSITIVEMEMBEROF properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory .Link @@ -9903,7 +10039,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential[]] # key credentials associated with the service principal. - # To construct, see NOTES section for KEYCREDENTIAL properties and create a hash table. ${KeyCredential}, [Parameter(ParameterSetName='DisplayNameWithPasswordCredentialParameterSet', Mandatory)] @@ -9912,14 +10047,12 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential[]] # Password credentials associated with the service principal. - # To construct, see NOTES section for PASSWORDCREDENTIAL properties and create a hash table. ${PasswordCredential}, [Parameter(ParameterSetName='ApplicationObjectParameterSet', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication] # The application object, could be used as pipeline input. - # To construct, see NOTES section for APPLICATIONOBJECT properties and create a hash table. ${ApplicationObject}, [Parameter(ParameterSetName='ApplicationIdParameterSet')] @@ -9986,7 +10119,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -10012,6 +10145,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -10187,7 +10324,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -10211,6 +10348,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -10381,7 +10522,7 @@ SERVICEPRINCIPALOBJECT : The service principal [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -10618,7 +10759,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential[]] # Password credentials associated with the service principal. - # To construct, see NOTES section for PASSWORDCREDENTIALS properties and create a hash table. ${PasswordCredentials}, [Parameter(ParameterSetName='SpObjectIdWithKeyCredentialParameterSet', Mandatory)] @@ -10627,7 +10767,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential[]] # key credentials associated with the service principal. - # To construct, see NOTES section for KEYCREDENTIALS properties and create a hash table. ${KeyCredentials}, [Parameter(ParameterSetName='SpObjectIdWithCertValueParameterSet', Mandatory)] @@ -10656,7 +10795,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal] # The service principal object, could be used as pipeline input. - # To construct, see NOTES section for SERVICEPRINCIPALOBJECT properties and create a hash table. ${ServicePrincipalObject}, [Parameter()] @@ -10716,7 +10854,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -10748,6 +10886,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -10812,7 +10954,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. -PASSWORDPROFILE : passwordProfile +PASSWORDPROFILE : passwordProfile To construct, see NOTES section for PASSWORDPROFILE properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [ForceChangePasswordNextSignIn ]: true if the user must change her password on the next login; otherwise false. If not set, default is false. NOTE: For Azure B2C tenants, set to false and instead use custom policies and user flows to force password reset at first sign in. See Force password reset at first logon. [ForceChangePasswordNextSignInWithMfa ]: If true, at next sign-in, the user must perform a multi-factor authentication (MFA) before being forced to change their password. The behavior is identical to forceChangePasswordNextSignIn except that the user is required to first perform a multi-factor authentication before password change. After a password change, this property will be automatically reset to false. If not set, default is false. @@ -11261,7 +11403,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -11283,6 +11425,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -11444,7 +11590,7 @@ APPLICATIONOBJECT : The application object, could be [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -11627,7 +11773,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication] # The application object, could be used as pipeline input. - # To construct, see NOTES section for APPLICATIONOBJECT properties and create a hash table. ${ApplicationObject}, [Parameter()] @@ -11693,7 +11838,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -11717,6 +11862,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -11878,7 +12027,7 @@ INPUTOBJECT : The application object, could be used [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -12055,7 +12204,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication] # The application object, could be used as pipeline input. - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -12121,7 +12269,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -12145,6 +12293,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -12282,7 +12434,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -12304,6 +12456,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -12432,7 +12588,7 @@ INPUTOBJECT : user input object [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -12724,7 +12880,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup] # user input object - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -12790,7 +12945,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -12813,6 +12968,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -12948,7 +13107,7 @@ GROUPOBJECT : The target group object, could be used as pip [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -13255,7 +13414,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphGroup] # The target group object, could be used as pipeline input. - # To construct, see NOTES section for GROUPOBJECT properties and create a hash table. ${GroupObject}, [Parameter()] @@ -13321,7 +13479,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -13348,6 +13506,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -13511,7 +13673,7 @@ APPLICATIONOBJECT : key: application object [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -13742,7 +13904,7 @@ INPUTOBJECT : key: service principal object [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -13967,14 +14129,12 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal] # key: service principal object - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='ApplicationObjectParameterSet', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication] # key: application object - # To construct, see NOTES section for APPLICATIONOBJECT properties and create a hash table. ${ApplicationObject}, [Parameter()] @@ -14046,7 +14206,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -14072,6 +14232,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -14218,7 +14382,7 @@ SERVICEPRINCIPALOBJECT : The service principal [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -14442,7 +14606,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal] # The service principal object, could be used as pipeline input. - # To construct, see NOTES section for SERVICEPRINCIPALOBJECT properties and create a hash table. ${ServicePrincipalObject}, [Parameter()] @@ -14508,7 +14671,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -14532,6 +14695,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -14678,7 +14845,7 @@ INPUTOBJECT : user input object [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -15046,7 +15213,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser] # user input object - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -15112,7 +15278,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -15137,6 +15303,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -15200,14 +15370,14 @@ 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. -ADDIN : Defines custom behavior that a consuming service can use to call an app in specific contexts. For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. This will let services like Office 365 call the application in the context of a document the user is working on. +ADDIN : Defines custom behavior that a consuming service can use to call an app in specific contexts. For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. This will let services like Office 365 call the application in the context of a document the user is working on. To construct, see NOTES section for ADDIN properties and create a hash table. [Id ]: [Property ]: [Key ]: Key. [Value ]: Value. [Type ]: -API : apiApplication +API : apiApplication To construct, see NOTES section for API properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [AcceptMappedClaim ]: When true, allows an application to use claims mapping without specifying a custom signing key. [KnownClientApplication ]: Used for bundling consent if you have a solution that contains two parts: a client app and a custom web API app. If you set the appID of the client app to this value, the user only consents once to the client app. Azure AD knows that consenting to the client means implicitly consenting to the web API and automatically provisions service principals for both APIs at the same time. Both the client and the web API app must be registered in the same tenant. @@ -15226,7 +15396,7 @@ API : apiApplication [DelegatedPermissionId ]: The unique identifier for the oauth2PermissionScopes the application requires. [RequestedAccessTokenVersion ]: Specifies the access token version expected by this resource. This changes the version and format of the JWT produced independent of the endpoint or client used to request the access token. The endpoint used, v1.0 or v2.0, is chosen by the client and only impacts the version of id_tokens. Resources need to explicitly configure requestedAccessTokenVersion to indicate the supported access token format. Possible values for requestedAccessTokenVersion are 1, 2, or null. If the value is null, this defaults to 1, which corresponds to the v1.0 endpoint. If signInAudience on the application is configured as AzureADandPersonalMicrosoftAccount, the value for this property must be 2 -APPROLE : The collection of roles assigned to the application. With app role assignments, these roles can be assigned to users, groups, or service principals associated with other applications. Not nullable. +APPROLE : The collection of roles assigned to the application. With app role assignments, these roles can be assigned to users, groups, or service principals associated with other applications. Not nullable. To construct, see NOTES section for APPROLE properties and create a hash table. [AllowedMemberType ]: Specifies whether this app role can be assigned to users and groups (by setting to ['User']), to other application's (by setting to ['Application'], or both (by setting to ['User', 'Application']). App roles supporting assignment to other applications' service principals are also known as application permissions. The 'Application' value is only supported for app roles defined on application entities. [Description ]: The description for the app role. This is displayed when the app role is being assigned and, if the app role functions as an application permission, during consent experiences. [DisplayName ]: Display name for the permission that appears in the app role assignment and consent experiences. @@ -15234,7 +15404,7 @@ APPROLE : The collection of roles assigned to the appl [IsEnabled ]: When creating or updating an app role, this must be set to true (which is the default). To delete a role, this must first be set to false. At that point, in a subsequent call, this role may be removed. [Value ]: Specifies the value to include in the roles claim in ID tokens and access tokens authenticating an assigned user or service principal. Must not exceed 120 characters in length. Allowed characters are : ! # $ % & ' ( ) * + , - . / : ; = ? @ [ ] ^ + _ { } ~, as well as characters in the ranges 0-9, A-Z and a-z. Any other character, including the space character, are not allowed. May not begin with .. -HOMEREALMDISCOVERYPOLICY : . +HOMEREALMDISCOVERYPOLICY : . To construct, see NOTES section for HOMEREALMDISCOVERYPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -15285,7 +15455,7 @@ HOMEREALMDISCOVERYPOLICY : . [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -15445,7 +15615,7 @@ HOMEREALMDISCOVERYPOLICY : . [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -INFO : informationalUrl +INFO : informationalUrl To construct, see NOTES section for INFO properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [MarketingUrl ]: Link to the application's marketing page. For example, https://www.contoso.com/app/marketing [PrivacyStatementUrl ]: Link to the application's privacy statement. For example, https://www.contoso.com/app/privacy @@ -15550,7 +15720,7 @@ INPUTOBJECT : key: application object [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -15698,7 +15868,7 @@ INPUTOBJECT : key: application object [TokenLifetimePolicy ]: The tokenLifetimePolicies assigned to this application. Supports $expand. [Web ]: webApplication -OPTIONALCLAIM : optionalClaims +OPTIONALCLAIM : optionalClaims To construct, see NOTES section for OPTIONALCLAIM properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [AccessToken ]: The optional claims returned in the JWT access token. [AdditionalProperty ]: Additional properties of the claim. If a property exists in this collection, it modifies the behavior of the optional claim specified in the name property. @@ -15708,18 +15878,18 @@ OPTIONALCLAIM : optionalClaims [IdToken ]: The optional claims returned in the JWT ID token. [Saml2Token ]: The optional claims returned in the SAML token. -PARENTALCONTROLSETTING : parentalControlSettings +PARENTALCONTROLSETTING : parentalControlSettings To construct, see NOTES section for PARENTALCONTROLSETTING properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [CountriesBlockedForMinor ]: Specifies the two-letter ISO country codes. Access to the application will be blocked for minors from the countries specified in this list. [LegalAgeGroupRule ]: Specifies the legal age group rule that applies to users of the app. Can be set to one of the following values: ValueDescriptionAllowDefault. Enforces the legal minimum. This means parental consent is required for minors in the European Union and Korea.RequireConsentForPrivacyServicesEnforces the user to specify date of birth to comply with COPPA rules. RequireConsentForMinorsRequires parental consent for ages below 18, regardless of country minor rules.RequireConsentForKidsRequires parental consent for ages below 14, regardless of country minor rules.BlockMinorsBlocks minors from using the app. -REQUIREDRESOURCEACCESS : Specifies the resources that the application needs to access. This property also specifies the set of OAuth permission scopes and application roles that it needs for each of those resources. This configuration of access to the required resources drives the consent experience. Not nullable. Supports $filter (eq, NOT, ge, le). +REQUIREDRESOURCEACCESS : Specifies the resources that the application needs to access. This property also specifies the set of OAuth permission scopes and application roles that it needs for each of those resources. This configuration of access to the required resources drives the consent experience. Not nullable. Supports $filter (eq, NOT, ge, le). To construct, see NOTES section for REQUIREDRESOURCEACCESS properties and create a hash table. [ResourceAccess ]: The list of OAuth2.0 permission scopes and app roles that the application requires from the specified resource. [Id ]: The unique identifier for one of the oauth2PermissionScopes or appRole instances that the resource application exposes. [Type ]: Specifies whether the id property references an oauth2PermissionScopes or an appRole. Possible values are Scope or Role. [ResourceAppId ]: The unique identifier for the resource that the application requires access to. This should be equal to the appId declared on the target resource application. -TOKENISSUANCEPOLICY : . +TOKENISSUANCEPOLICY : . To construct, see NOTES section for TOKENISSUANCEPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -15770,7 +15940,7 @@ TOKENISSUANCEPOLICY : . [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -15930,7 +16100,7 @@ TOKENISSUANCEPOLICY : . [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -TOKENLIFETIMEPOLICY : The tokenLifetimePolicies assigned to this application. Supports $expand. +TOKENLIFETIMEPOLICY : The tokenLifetimePolicies assigned to this application. Supports $expand. To construct, see NOTES section for TOKENLIFETIMEPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -15981,7 +16151,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -16141,7 +16311,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -WEB : webApplication +WEB : webApplication To construct, see NOTES section for WEB properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [HomePageUrl ]: Home page or landing page of the application. [ImplicitGrantSetting ]: implicitGrantSettings @@ -16176,7 +16346,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication] # key: application object - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -16493,7 +16662,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -16516,6 +16685,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -16579,14 +16752,14 @@ 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. -ADDIN : Defines custom behavior that a consuming service can use to call an app in specific contexts. For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. This will let services like Microsoft 365 call the application in the context of a document the user is working on. +ADDIN : Defines custom behavior that a consuming service can use to call an app in specific contexts. For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. This will let services like Microsoft 365 call the application in the context of a document the user is working on. To construct, see NOTES section for ADDIN properties and create a hash table. [Id ]: [Property ]: [Key ]: Key. [Value ]: Value. [Type ]: -APPROLE : The roles exposed by the application which this service principal represents. For more information see the appRoles property definition on the application entity. Not nullable. +APPROLE : The roles exposed by the application which this service principal represents. For more information see the appRoles property definition on the application entity. Not nullable. To construct, see NOTES section for APPROLE properties and create a hash table. [AllowedMemberType ]: Specifies whether this app role can be assigned to users and groups (by setting to ['User']), to other application's (by setting to ['Application'], or both (by setting to ['User', 'Application']). App roles supporting assignment to other applications' service principals are also known as application permissions. The 'Application' value is only supported for app roles defined on application entities. [Description ]: The description for the app role. This is displayed when the app role is being assigned and, if the app role functions as an application permission, during consent experiences. [DisplayName ]: Display name for the permission that appears in the app role assignment and consent experiences. @@ -16594,7 +16767,7 @@ APPROLE : The roles exposed by the application which t [IsEnabled ]: When creating or updating an app role, this must be set to true (which is the default). To delete a role, this must first be set to false. At that point, in a subsequent call, this role may be removed. [Value ]: Specifies the value to include in the roles claim in ID tokens and access tokens authenticating an assigned user or service principal. Must not exceed 120 characters in length. Allowed characters are : ! # $ % & ' ( ) * + , - . / : ; = ? @ [ ] ^ + _ { } ~, as well as characters in the ranges 0-9, A-Z and a-z. Any other character, including the space character, are not allowed. May not begin with .. -APPROLEASSIGNEDTO : App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. +APPROLEASSIGNEDTO : App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. To construct, see NOTES section for APPROLEASSIGNEDTO properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory [AppRoleId ]: The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. Required on create. @@ -16602,7 +16775,7 @@ APPROLEASSIGNEDTO : App role assignments for [ResourceDisplayName ]: The display name of the resource app's service principal to which the assignment is made. [ResourceId ]: The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports $filter (eq only). -APPROLEASSIGNMENT : App role assignment for another app or service, granted to this service principal. Supports $expand. +APPROLEASSIGNMENT : App role assignment for another app or service, granted to this service principal. Supports $expand. To construct, see NOTES section for APPROLEASSIGNMENT properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory [AppRoleId ]: The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. Required on create. @@ -16610,7 +16783,7 @@ APPROLEASSIGNMENT : App role assignment for [ResourceDisplayName ]: The display name of the resource app's service principal to which the assignment is made. [ResourceId ]: The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports $filter (eq only). -CLAIMSMAPPINGPOLICY : The claimsMappingPolicies assigned to this service principal. Supports $expand. +CLAIMSMAPPINGPOLICY : The claimsMappingPolicies assigned to this service principal. Supports $expand. To construct, see NOTES section for CLAIMSMAPPINGPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -16661,7 +16834,7 @@ CLAIMSMAPPINGPOLICY : The claimsMappingPol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -16827,16 +17000,16 @@ CLAIMSMAPPINGPOLICY : The claimsMappingPol [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -DELEGATEDPERMISSIONCLASSIFICATION : The permission classifications for delegated permissions exposed by the app that this service principal represents. Supports $expand. +DELEGATEDPERMISSIONCLASSIFICATION : The permission classifications for delegated permissions exposed by the app that this service principal represents. Supports $expand. To construct, see NOTES section for DELEGATEDPERMISSIONCLASSIFICATION properties and create a hash table. [Classification ]: permissionClassificationType [PermissionId ]: The unique identifier (id) for the delegated permission listed in the publishedPermissionScopes collection of the servicePrincipal. Required on create. Does not support $filter. [PermissionName ]: The claim value (value) for the delegated permission listed in the publishedPermissionScopes collection of the servicePrincipal. Does not support $filter. -ENDPOINT : Endpoints available for discovery. Services like Sharepoint populate this property with a tenant specific SharePoint endpoints that other applications can discover and use in their experiences. +ENDPOINT : Endpoints available for discovery. Services like Sharepoint populate this property with a tenant specific SharePoint endpoints that other applications can discover and use in their experiences. To construct, see NOTES section for ENDPOINT properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -HOMEREALMDISCOVERYPOLICY : The homeRealmDiscoveryPolicies assigned to this service principal. Supports $expand. +HOMEREALMDISCOVERYPOLICY : The homeRealmDiscoveryPolicies assigned to this service principal. Supports $expand. To construct, see NOTES section for HOMEREALMDISCOVERYPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -16887,7 +17060,7 @@ HOMEREALMDISCOVERYPOLICY : The homeRe [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -17047,7 +17220,7 @@ HOMEREALMDISCOVERYPOLICY : The homeRe [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -INFO : informationalUrl +INFO : informationalUrl To construct, see NOTES section for INFO properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [MarketingUrl ]: Link to the application's marketing page. For example, https://www.contoso.com/app/marketing [PrivacyStatementUrl ]: Link to the application's privacy statement. For example, https://www.contoso.com/app/privacy @@ -17137,7 +17310,7 @@ INPUTOBJECT : service principal object [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -17335,7 +17508,7 @@ KEYCREDENTIAL : The collection of key credential [Type ]: The type of key credential; for example, 'Symmetric'. [Usage ]: A string that describes the purpose for which the key can be used; for example, 'Verify'. -OAUTH2PERMISSIONSCOPE : The delegated permissions exposed by the application. For more information see the oauth2PermissionScopes property on the application entity's api property. Not nullable. +OAUTH2PERMISSIONSCOPE : The delegated permissions exposed by the application. For more information see the oauth2PermissionScopes property on the application entity's api property. Not nullable. To construct, see NOTES section for OAUTH2PERMISSIONSCOPE properties and create a hash table. [AdminConsentDescription ]: A description of the delegated permissions, intended to be read by an administrator granting the permission on behalf of all users. This text appears in tenant-wide admin consent experiences. [AdminConsentDisplayName ]: The permission's title, intended to be read by an administrator granting the permission on behalf of all users. [Id ]: Unique delegated permission identifier inside the collection of delegated permissions defined for a resource application. @@ -17353,11 +17526,11 @@ PASSWORDCREDENTIAL : The collection of pass [KeyId ]: The unique identifier for the password. [StartDateTime ]: The date and time at which the password becomes valid. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Optional. -SAMLSINGLESIGNONSETTING : samlSingleSignOnSettings +SAMLSINGLESIGNONSETTING : samlSingleSignOnSettings To construct, see NOTES section for SAMLSINGLESIGNONSETTING properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [RelayState ]: The relative URI the service provider would redirect to after completion of the single sign-on flow. -TOKENISSUANCEPOLICY : The tokenIssuancePolicies assigned to this service principal. Supports $expand. +TOKENISSUANCEPOLICY : The tokenIssuancePolicies assigned to this service principal. Supports $expand. To construct, see NOTES section for TOKENISSUANCEPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -17408,7 +17581,7 @@ TOKENISSUANCEPOLICY : The tokenIssuancePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -17568,7 +17741,7 @@ TOKENISSUANCEPOLICY : The tokenIssuancePol [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -TOKENLIFETIMEPOLICY : The tokenLifetimePolicies assigned to this service principal. Supports $expand. +TOKENLIFETIMEPOLICY : The tokenLifetimePolicies assigned to this service principal. Supports $expand. To construct, see NOTES section for TOKENLIFETIMEPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -17619,7 +17792,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -17779,7 +17952,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -TRANSITIVEMEMBEROF : . +TRANSITIVEMEMBEROF : . To construct, see NOTES section for TRANSITIVEMEMBEROF properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory .Link @@ -17805,7 +17978,6 @@ param( # Not nullable. # Supports $filter (eq, NOT, ge, le). # To construct, see NOTES section for KEYCREDENTIALS properties and create a hash table. - # To construct, see NOTES section for KEYCREDENTIAL properties and create a hash table. ${KeyCredential}, [Parameter()] @@ -17815,7 +17987,6 @@ param( # The collection of password credentials associated with the application. # Not nullable. # To construct, see NOTES section for PASSWORDCREDENTIALS properties and create a hash table. - # To construct, see NOTES section for PASSWORDCREDENTIAL properties and create a hash table. ${PasswordCredential}, [Parameter()] @@ -18116,7 +18287,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal] # service principal object - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='SPNWithDisplayNameParameterSet', Mandatory)] @@ -18195,7 +18365,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -18219,6 +18389,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -18280,7 +18454,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. -IDENTITY : Represents the identities that can be used to sign in to this user account. An identity can be provided by Microsoft (also known as a local account), by organizations, or by social identity providers such as Facebook, Google, and Microsoft, and tied to a user account. May contain multiple items with the same signInType value. Supports $filter (eq) only where the signInType is not userPrincipalName. +IDENTITY : Represents the identities that can be used to sign in to this user account. An identity can be provided by Microsoft (also known as a local account), by organizations, or by social identity providers such as Facebook, Google, and Microsoft, and tied to a user account. May contain multiple items with the same signInType value. Supports $filter (eq) only where the signInType is not userPrincipalName. To construct, see NOTES section for IDENTITY properties and create a hash table. [Issuer ]: Specifies the issuer of the identity, for example facebook.com.For local accounts (where signInType is not federated), this property is the local B2C tenant default domain name, for example contoso.onmicrosoft.com.For external users from other Azure AD organization, this will be the domain of the federated organization, for example contoso.com.Supports $filter. 512 character limit. [IssuerAssignedId ]: Specifies the unique identifier assigned to the user by the issuer. The combination of issuer and issuerAssignedId must be unique within the organization. Represents the sign-in name for the user, when signInType is set to emailAddress or userName (also known as local accounts).When signInType is set to: emailAddress, (or a custom string that starts with emailAddress like emailAddress1) issuerAssignedId must be a valid email addressuserName, issuerAssignedId must be a valid local part of an email addressSupports $filter. 100 character limit. [SignInType ]: Specifies the user sign-in types in your directory, such as emailAddress, userName or federated. Here, federated represents a unique identifier for a user from an issuer, that can be in any format chosen by the issuer. Additional validation is enforced on issuerAssignedId when the sign-in type is set to emailAddress or userName. This property can also be set to any custom string. @@ -18368,7 +18542,7 @@ INPUTOBJECT : user input object [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -18701,7 +18875,7 @@ INPUTOBJECT : user input object [UserPrincipalName ]: The user principal name (UPN) of the user. The UPN is an Internet-style login name for the user based on the Internet standard RFC 822. By convention, this should map to the user's email name. The general format is alias@domain, where domain must be present in the tenant's collection of verified domains. This property is required when a user is created. The verified domains for the tenant can be accessed from the verifiedDomains property of organization.NOTE: While this property can contain accent characters, they can cause access issues to first-party applications for the user. Supports $filter (eq, ne, NOT, ge, le, in, startsWith, endsWith) and $orderBy. [UserType ]: A string value that can be used to classify user types in your directory, such as Member and Guest. Supports $filter (eq, ne, NOT, in,). -PASSWORDPROFILE : passwordProfile +PASSWORDPROFILE : passwordProfile To construct, see NOTES section for PASSWORDPROFILE properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [ForceChangePasswordNextSignIn ]: true if the user must change her password on the next login; otherwise false. If not set, default is false. NOTE: For Azure B2C tenants, set to false and instead use custom policies and user flows to force password reset at first sign in. See Force password reset at first logon. [ForceChangePasswordNextSignInWithMfa ]: If true, at next sign-in, the user must perform a multi-factor authentication (MFA) before being forced to change their password. The behavior is identical to forceChangePasswordNextSignIn except that the user is required to first perform a multi-factor authentication before password change. After a password change, this property will be automatically reset to false. If not set, default is false. @@ -19034,7 +19208,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser] # user input object - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='UPNParameterSet', Mandatory)] @@ -19113,7 +19286,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -19137,6 +19310,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Remove-AzADAppCredential.ps1 b/generated/Resources/MSGraph.Autorest/exports/Remove-AzADAppCredential.ps1 index 677d4434c729..45ab35addbc2 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Remove-AzADAppCredential.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Remove-AzADAppCredential.ps1 @@ -131,7 +131,7 @@ APPLICATIONOBJECT : The application object, could be [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -314,7 +314,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication] # The application object, could be used as pipeline input. - # To construct, see NOTES section for APPLICATIONOBJECT properties and create a hash table. ${ApplicationObject}, [Parameter()] @@ -380,7 +379,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -404,6 +403,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Remove-AzADAppFederatedCredential.ps1 b/generated/Resources/MSGraph.Autorest/exports/Remove-AzADAppFederatedCredential.ps1 index 46f7c7a58213..78eeb55b896a 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Remove-AzADAppFederatedCredential.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Remove-AzADAppFederatedCredential.ps1 @@ -54,7 +54,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -112,7 +113,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -133,6 +134,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Remove-AzADAppPermission.ps1 b/generated/Resources/MSGraph.Autorest/exports/Remove-AzADAppPermission.ps1 index 65a31444b74c..9928c9ba20bc 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Remove-AzADAppPermission.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Remove-AzADAppPermission.ps1 @@ -107,7 +107,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -129,6 +129,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Remove-AzADApplication.ps1 b/generated/Resources/MSGraph.Autorest/exports/Remove-AzADApplication.ps1 index 54a03cf31aae..728fa9cfbe7a 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Remove-AzADApplication.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Remove-AzADApplication.ps1 @@ -131,7 +131,7 @@ INPUTOBJECT : The application object, could be used [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -308,7 +308,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication] # The application object, could be used as pipeline input. - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -374,7 +373,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -398,6 +397,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Remove-AzADGroup.ps1 b/generated/Resources/MSGraph.Autorest/exports/Remove-AzADGroup.ps1 index 5188b9c61f95..ad96ea0a5210 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Remove-AzADGroup.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Remove-AzADGroup.ps1 @@ -98,7 +98,7 @@ INPUTOBJECT : user input object [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -390,7 +390,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup] # user input object - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -456,7 +455,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -479,6 +478,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Remove-AzADGroupMember.ps1 b/generated/Resources/MSGraph.Autorest/exports/Remove-AzADGroupMember.ps1 index 146ef0f5eff8..7bda527d9f7c 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Remove-AzADGroupMember.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Remove-AzADGroupMember.ps1 @@ -105,7 +105,7 @@ GROUPOBJECT : The target group object, could be used as pip [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -412,7 +412,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphGroup] # The target group object, could be used as pipeline input. - # To construct, see NOTES section for GROUPOBJECT properties and create a hash table. ${GroupObject}, [Parameter()] @@ -478,7 +477,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -505,6 +504,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Remove-AzADGroupOwner.ps1 b/generated/Resources/MSGraph.Autorest/exports/Remove-AzADGroupOwner.ps1 index f87d6a59e833..1f9a6cbcf2af 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Remove-AzADGroupOwner.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Remove-AzADGroupOwner.ps1 @@ -50,7 +50,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -108,7 +109,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -129,6 +130,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Remove-AzADServicePrincipal.ps1 b/generated/Resources/MSGraph.Autorest/exports/Remove-AzADServicePrincipal.ps1 index f736a0298a14..8abad6d1b78d 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Remove-AzADServicePrincipal.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Remove-AzADServicePrincipal.ps1 @@ -133,7 +133,7 @@ APPLICATIONOBJECT : key: application object [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -364,7 +364,7 @@ INPUTOBJECT : key: service principal object [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -589,14 +589,12 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal] # key: service principal object - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='ApplicationObjectParameterSet', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication] # key: application object - # To construct, see NOTES section for APPLICATIONOBJECT properties and create a hash table. ${ApplicationObject}, [Parameter()] @@ -668,7 +666,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -694,6 +692,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Remove-AzADServicePrincipalAppRoleAssignment.ps1 b/generated/Resources/MSGraph.Autorest/exports/Remove-AzADServicePrincipalAppRoleAssignment.ps1 index e94ff08d5df5..5984ccc04bdb 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Remove-AzADServicePrincipalAppRoleAssignment.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Remove-AzADServicePrincipalAppRoleAssignment.ps1 @@ -54,7 +54,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -112,7 +113,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -133,6 +134,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Remove-AzADSpCredential.ps1 b/generated/Resources/MSGraph.Autorest/exports/Remove-AzADSpCredential.ps1 index c4bd75e60957..bd0e17e7b071 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Remove-AzADSpCredential.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Remove-AzADSpCredential.ps1 @@ -116,7 +116,7 @@ SERVICEPRINCIPALOBJECT : The service principal [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -340,7 +340,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal] # The service principal object, could be used as pipeline input. - # To construct, see NOTES section for SERVICEPRINCIPALOBJECT properties and create a hash table. ${ServicePrincipalObject}, [Parameter()] @@ -406,7 +405,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -430,6 +429,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Remove-AzADUser.ps1 b/generated/Resources/MSGraph.Autorest/exports/Remove-AzADUser.ps1 index 6e10f7584b01..b1b98b130ca3 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Remove-AzADUser.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Remove-AzADUser.ps1 @@ -116,7 +116,7 @@ INPUTOBJECT : user input object [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -484,7 +484,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser] # user input object - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -550,7 +549,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -575,6 +574,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Update-AzADAppFederatedCredential.ps1 b/generated/Resources/MSGraph.Autorest/exports/Update-AzADAppFederatedCredential.ps1 index 0fc3ef032a17..7a7703f8d947 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Update-AzADAppFederatedCredential.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Update-AzADAppFederatedCredential.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Update the navigation property federatedIdentityCredentials in applications +update the navigation property federatedIdentityCredentials in applications .Description -Update the navigation property federatedIdentityCredentials in applications +update the navigation property federatedIdentityCredentials in applications .Example Update-AzADAppFederatedCredential -ApplicationObjectId $appObjectId -FederatedCredentialId $credentialId -Subject 'subject' @@ -43,13 +43,13 @@ param( # key: id of federatedIdentityCredential ${FederatedCredentialId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Collections.Hashtable] # Additional Parameters ${AdditionalProperties}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -60,14 +60,14 @@ param( # Required. ${Audience}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The un-validated, user-provided description of the federated identity credential. # Optional. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The URL of the external identity provider and must match the issuer claim of the external token being exchanged. @@ -75,7 +75,7 @@ param( # Required. ${Issuer}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Required. @@ -86,12 +86,25 @@ param( # Supports $filter (eq). ${Subject}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -149,7 +162,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -167,9 +180,15 @@ begin { $mapping = @{ UpdateExpanded = 'Az.MSGraph.private\Update-AzADAppFederatedCredential_UpdateExpanded'; + UpdateViaJsonFilePath = 'Az.MSGraph.private\Update-AzADAppFederatedCredential_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.MSGraph.private\Update-AzADAppFederatedCredential_UpdateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Update-AzADApplication.ps1 b/generated/Resources/MSGraph.Autorest/exports/Update-AzADApplication.ps1 index 4adc9ba80775..803618c81ee8 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Update-AzADApplication.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Update-AzADApplication.ps1 @@ -33,14 +33,14 @@ 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. -ADDIN : Defines custom behavior that a consuming service can use to call an app in specific contexts. For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. This will let services like Office 365 call the application in the context of a document the user is working on. +ADDIN : Defines custom behavior that a consuming service can use to call an app in specific contexts. For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. This will let services like Office 365 call the application in the context of a document the user is working on. To construct, see NOTES section for ADDIN properties and create a hash table. [Id ]: [Property ]: [Key ]: Key. [Value ]: Value. [Type ]: -API : apiApplication +API : apiApplication To construct, see NOTES section for API properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [AcceptMappedClaim ]: When true, allows an application to use claims mapping without specifying a custom signing key. [KnownClientApplication ]: Used for bundling consent if you have a solution that contains two parts: a client app and a custom web API app. If you set the appID of the client app to this value, the user only consents once to the client app. Azure AD knows that consenting to the client means implicitly consenting to the web API and automatically provisions service principals for both APIs at the same time. Both the client and the web API app must be registered in the same tenant. @@ -59,7 +59,7 @@ API : apiApplication [DelegatedPermissionId ]: The unique identifier for the oauth2PermissionScopes the application requires. [RequestedAccessTokenVersion ]: Specifies the access token version expected by this resource. This changes the version and format of the JWT produced independent of the endpoint or client used to request the access token. The endpoint used, v1.0 or v2.0, is chosen by the client and only impacts the version of id_tokens. Resources need to explicitly configure requestedAccessTokenVersion to indicate the supported access token format. Possible values for requestedAccessTokenVersion are 1, 2, or null. If the value is null, this defaults to 1, which corresponds to the v1.0 endpoint. If signInAudience on the application is configured as AzureADandPersonalMicrosoftAccount, the value for this property must be 2 -APPROLE : The collection of roles assigned to the application. With app role assignments, these roles can be assigned to users, groups, or service principals associated with other applications. Not nullable. +APPROLE : The collection of roles assigned to the application. With app role assignments, these roles can be assigned to users, groups, or service principals associated with other applications. Not nullable. To construct, see NOTES section for APPROLE properties and create a hash table. [AllowedMemberType ]: Specifies whether this app role can be assigned to users and groups (by setting to ['User']), to other application's (by setting to ['Application'], or both (by setting to ['User', 'Application']). App roles supporting assignment to other applications' service principals are also known as application permissions. The 'Application' value is only supported for app roles defined on application entities. [Description ]: The description for the app role. This is displayed when the app role is being assigned and, if the app role functions as an application permission, during consent experiences. [DisplayName ]: Display name for the permission that appears in the app role assignment and consent experiences. @@ -67,7 +67,7 @@ APPROLE : The collection of roles assigned to the appl [IsEnabled ]: When creating or updating an app role, this must be set to true (which is the default). To delete a role, this must first be set to false. At that point, in a subsequent call, this role may be removed. [Value ]: Specifies the value to include in the roles claim in ID tokens and access tokens authenticating an assigned user or service principal. Must not exceed 120 characters in length. Allowed characters are : ! # $ % & ' ( ) * + , - . / : ; = ? @ [ ] ^ + _ { } ~, as well as characters in the ranges 0-9, A-Z and a-z. Any other character, including the space character, are not allowed. May not begin with .. -HOMEREALMDISCOVERYPOLICY : . +HOMEREALMDISCOVERYPOLICY : . To construct, see NOTES section for HOMEREALMDISCOVERYPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -118,7 +118,7 @@ HOMEREALMDISCOVERYPOLICY : . [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -278,7 +278,7 @@ HOMEREALMDISCOVERYPOLICY : . [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -INFO : informationalUrl +INFO : informationalUrl To construct, see NOTES section for INFO properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [MarketingUrl ]: Link to the application's marketing page. For example, https://www.contoso.com/app/marketing [PrivacyStatementUrl ]: Link to the application's privacy statement. For example, https://www.contoso.com/app/privacy @@ -383,7 +383,7 @@ INPUTOBJECT : key: application object [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -531,7 +531,7 @@ INPUTOBJECT : key: application object [TokenLifetimePolicy ]: The tokenLifetimePolicies assigned to this application. Supports $expand. [Web ]: webApplication -OPTIONALCLAIM : optionalClaims +OPTIONALCLAIM : optionalClaims To construct, see NOTES section for OPTIONALCLAIM properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [AccessToken ]: The optional claims returned in the JWT access token. [AdditionalProperty ]: Additional properties of the claim. If a property exists in this collection, it modifies the behavior of the optional claim specified in the name property. @@ -541,18 +541,18 @@ OPTIONALCLAIM : optionalClaims [IdToken ]: The optional claims returned in the JWT ID token. [Saml2Token ]: The optional claims returned in the SAML token. -PARENTALCONTROLSETTING : parentalControlSettings +PARENTALCONTROLSETTING : parentalControlSettings To construct, see NOTES section for PARENTALCONTROLSETTING properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [CountriesBlockedForMinor ]: Specifies the two-letter ISO country codes. Access to the application will be blocked for minors from the countries specified in this list. [LegalAgeGroupRule ]: Specifies the legal age group rule that applies to users of the app. Can be set to one of the following values: ValueDescriptionAllowDefault. Enforces the legal minimum. This means parental consent is required for minors in the European Union and Korea.RequireConsentForPrivacyServicesEnforces the user to specify date of birth to comply with COPPA rules. RequireConsentForMinorsRequires parental consent for ages below 18, regardless of country minor rules.RequireConsentForKidsRequires parental consent for ages below 14, regardless of country minor rules.BlockMinorsBlocks minors from using the app. -REQUIREDRESOURCEACCESS : Specifies the resources that the application needs to access. This property also specifies the set of OAuth permission scopes and application roles that it needs for each of those resources. This configuration of access to the required resources drives the consent experience. Not nullable. Supports $filter (eq, NOT, ge, le). +REQUIREDRESOURCEACCESS : Specifies the resources that the application needs to access. This property also specifies the set of OAuth permission scopes and application roles that it needs for each of those resources. This configuration of access to the required resources drives the consent experience. Not nullable. Supports $filter (eq, NOT, ge, le). To construct, see NOTES section for REQUIREDRESOURCEACCESS properties and create a hash table. [ResourceAccess ]: The list of OAuth2.0 permission scopes and app roles that the application requires from the specified resource. [Id ]: The unique identifier for one of the oauth2PermissionScopes or appRole instances that the resource application exposes. [Type ]: Specifies whether the id property references an oauth2PermissionScopes or an appRole. Possible values are Scope or Role. [ResourceAppId ]: The unique identifier for the resource that the application requires access to. This should be equal to the appId declared on the target resource application. -TOKENISSUANCEPOLICY : . +TOKENISSUANCEPOLICY : . To construct, see NOTES section for TOKENISSUANCEPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -603,7 +603,7 @@ TOKENISSUANCEPOLICY : . [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -763,7 +763,7 @@ TOKENISSUANCEPOLICY : . [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -TOKENLIFETIMEPOLICY : The tokenLifetimePolicies assigned to this application. Supports $expand. +TOKENLIFETIMEPOLICY : The tokenLifetimePolicies assigned to this application. Supports $expand. To construct, see NOTES section for TOKENLIFETIMEPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -814,7 +814,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -974,7 +974,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -WEB : webApplication +WEB : webApplication To construct, see NOTES section for WEB properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [HomePageUrl ]: Home page or landing page of the application. [ImplicitGrantSetting ]: implicitGrantSettings @@ -1009,7 +1009,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication] # key: application object - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -1326,7 +1325,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -1349,6 +1348,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Update-AzADGroup.ps1 b/generated/Resources/MSGraph.Autorest/exports/Update-AzADGroup.ps1 index 5d53eb730a05..0d7f5fecfe47 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Update-AzADGroup.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Update-AzADGroup.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Update entity in groups +update entity in groups .Description -Update entity in groups +update entity in groups .Example Update-AzADGroup -ObjectId $objectid -Description $description @@ -66,22 +66,21 @@ param( # key: id of group ${ObjectId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Collections.Hashtable] # Additional Parameters ${AdditionalProperties}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentAutoGenerated[]] # Represents the app roles a group has been granted for an application. # Supports $expand. - # To construct, see NOTES section for APPROLEASSIGNMENT properties and create a hash table. ${AppRoleAssignment}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Describes a classification for the group (such as low, medium or high business impact). @@ -89,21 +88,20 @@ param( # Supports $filter (eq, ne, NOT, ge, le, startsWith). ${Classification}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject] # Represents an Azure Active Directory object. # The directoryObject type is the base type for many other directory entity types. - # To construct, see NOTES section for CREATEDONBEHALFOF properties and create a hash table. ${CreatedOnBehalfOf}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # . ${DeletedDateTime}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # An optional description for the group. @@ -111,13 +109,13 @@ param( # Supports $filter (eq, ne, NOT, ge, le, startsWith) and $search. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name displayed in directory ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -128,7 +126,7 @@ param( # Supports $filter (eq, NOT). ${GroupType}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether there are members in this group that have license errors from its group-based license assignment. @@ -137,13 +135,13 @@ param( # Supports $filter (eq). ${HasMembersWithLicenseError}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # . ${IsArchived}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether this group can be assigned to an Azure Active Directory role.This property can only be set while creating the group and is immutable. @@ -154,7 +152,7 @@ param( # Supports $filter (eq, ne, NOT). ${IsAssignableToRole}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Specifies whether the group is mail-enabled. @@ -162,7 +160,7 @@ param( # Supports $filter (eq, ne, NOT). ${MailEnabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The mail alias for the group, unique in the organization. @@ -172,7 +170,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${MailNickname}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The rule that determines members for this group if the group is a dynamic group (groupTypes contains DynamicMembership). @@ -181,7 +179,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, startsWith). ${MembershipRule}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Indicates whether the dynamic membership processing is on or paused. @@ -190,16 +188,15 @@ param( # Supports $filter (eq, ne, NOT, in). ${MembershipRuleProcessingState}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphResourceSpecificPermissionGrant[]] # The permissions that have been granted for a group to a specific application. # Supports $expand. - # To construct, see NOTES section for PERMISSIONGRANT properties and create a hash table. ${PermissionGrant}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The preferred data location for the group. @@ -207,7 +204,7 @@ param( # Returned by default. ${PreferredDataLocation}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The preferred language for a Microsoft 365 group. @@ -216,7 +213,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${PreferredLanguage}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Specifies whether the group is a security group. @@ -224,14 +221,14 @@ param( # Supports $filter (eq, ne, NOT, in). ${SecurityEnabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Security identifier of the group, used in Windows scenarios. # Returned by default. ${SecurityIdentifier}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies a Microsoft 365 group's color theme. @@ -239,7 +236,7 @@ param( # Returned by default. ${Theme}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the group join policy and group content visibility for groups. @@ -252,12 +249,25 @@ param( # Returned by default. ${Visibility}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -315,7 +325,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -333,9 +343,15 @@ begin { $mapping = @{ UpdateExpanded = 'Az.MSGraph.private\Update-AzADGroup_UpdateExpanded'; + UpdateViaJsonFilePath = 'Az.MSGraph.private\Update-AzADGroup_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.MSGraph.private\Update-AzADGroup_UpdateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Update-AzADServicePrincipal.ps1 b/generated/Resources/MSGraph.Autorest/exports/Update-AzADServicePrincipal.ps1 index 96b33fff1e06..52f66ade3275 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Update-AzADServicePrincipal.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Update-AzADServicePrincipal.ps1 @@ -33,14 +33,14 @@ 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. -ADDIN : Defines custom behavior that a consuming service can use to call an app in specific contexts. For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. This will let services like Microsoft 365 call the application in the context of a document the user is working on. +ADDIN : Defines custom behavior that a consuming service can use to call an app in specific contexts. For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. This will let services like Microsoft 365 call the application in the context of a document the user is working on. To construct, see NOTES section for ADDIN properties and create a hash table. [Id ]: [Property ]: [Key ]: Key. [Value ]: Value. [Type ]: -APPROLE : The roles exposed by the application which this service principal represents. For more information see the appRoles property definition on the application entity. Not nullable. +APPROLE : The roles exposed by the application which this service principal represents. For more information see the appRoles property definition on the application entity. Not nullable. To construct, see NOTES section for APPROLE properties and create a hash table. [AllowedMemberType ]: Specifies whether this app role can be assigned to users and groups (by setting to ['User']), to other application's (by setting to ['Application'], or both (by setting to ['User', 'Application']). App roles supporting assignment to other applications' service principals are also known as application permissions. The 'Application' value is only supported for app roles defined on application entities. [Description ]: The description for the app role. This is displayed when the app role is being assigned and, if the app role functions as an application permission, during consent experiences. [DisplayName ]: Display name for the permission that appears in the app role assignment and consent experiences. @@ -48,7 +48,7 @@ APPROLE : The roles exposed by the application which t [IsEnabled ]: When creating or updating an app role, this must be set to true (which is the default). To delete a role, this must first be set to false. At that point, in a subsequent call, this role may be removed. [Value ]: Specifies the value to include in the roles claim in ID tokens and access tokens authenticating an assigned user or service principal. Must not exceed 120 characters in length. Allowed characters are : ! # $ % & ' ( ) * + , - . / : ; = ? @ [ ] ^ + _ { } ~, as well as characters in the ranges 0-9, A-Z and a-z. Any other character, including the space character, are not allowed. May not begin with .. -APPROLEASSIGNEDTO : App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. +APPROLEASSIGNEDTO : App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. To construct, see NOTES section for APPROLEASSIGNEDTO properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory [AppRoleId ]: The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. Required on create. @@ -56,7 +56,7 @@ APPROLEASSIGNEDTO : App role assignments for [ResourceDisplayName ]: The display name of the resource app's service principal to which the assignment is made. [ResourceId ]: The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports $filter (eq only). -APPROLEASSIGNMENT : App role assignment for another app or service, granted to this service principal. Supports $expand. +APPROLEASSIGNMENT : App role assignment for another app or service, granted to this service principal. Supports $expand. To construct, see NOTES section for APPROLEASSIGNMENT properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory [AppRoleId ]: The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles property on the resource application's service principal (resourceId). If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. Required on create. @@ -64,7 +64,7 @@ APPROLEASSIGNMENT : App role assignment for [ResourceDisplayName ]: The display name of the resource app's service principal to which the assignment is made. [ResourceId ]: The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports $filter (eq only). -CLAIMSMAPPINGPOLICY : The claimsMappingPolicies assigned to this service principal. Supports $expand. +CLAIMSMAPPINGPOLICY : The claimsMappingPolicies assigned to this service principal. Supports $expand. To construct, see NOTES section for CLAIMSMAPPINGPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -115,7 +115,7 @@ CLAIMSMAPPINGPOLICY : The claimsMappingPol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -281,16 +281,16 @@ CLAIMSMAPPINGPOLICY : The claimsMappingPol [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -DELEGATEDPERMISSIONCLASSIFICATION : The permission classifications for delegated permissions exposed by the app that this service principal represents. Supports $expand. +DELEGATEDPERMISSIONCLASSIFICATION : The permission classifications for delegated permissions exposed by the app that this service principal represents. Supports $expand. To construct, see NOTES section for DELEGATEDPERMISSIONCLASSIFICATION properties and create a hash table. [Classification ]: permissionClassificationType [PermissionId ]: The unique identifier (id) for the delegated permission listed in the publishedPermissionScopes collection of the servicePrincipal. Required on create. Does not support $filter. [PermissionName ]: The claim value (value) for the delegated permission listed in the publishedPermissionScopes collection of the servicePrincipal. Does not support $filter. -ENDPOINT : Endpoints available for discovery. Services like Sharepoint populate this property with a tenant specific SharePoint endpoints that other applications can discover and use in their experiences. +ENDPOINT : Endpoints available for discovery. Services like Sharepoint populate this property with a tenant specific SharePoint endpoints that other applications can discover and use in their experiences. To construct, see NOTES section for ENDPOINT properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -HOMEREALMDISCOVERYPOLICY : The homeRealmDiscoveryPolicies assigned to this service principal. Supports $expand. +HOMEREALMDISCOVERYPOLICY : The homeRealmDiscoveryPolicies assigned to this service principal. Supports $expand. To construct, see NOTES section for HOMEREALMDISCOVERYPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -341,7 +341,7 @@ HOMEREALMDISCOVERYPOLICY : The homeRe [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -501,7 +501,7 @@ HOMEREALMDISCOVERYPOLICY : The homeRe [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -INFO : informationalUrl +INFO : informationalUrl To construct, see NOTES section for INFO properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [MarketingUrl ]: Link to the application's marketing page. For example, https://www.contoso.com/app/marketing [PrivacyStatementUrl ]: Link to the application's privacy statement. For example, https://www.contoso.com/app/privacy @@ -591,7 +591,7 @@ INPUTOBJECT : service principal object [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -789,7 +789,7 @@ KEYCREDENTIAL : The collection of key credential [Type ]: The type of key credential; for example, 'Symmetric'. [Usage ]: A string that describes the purpose for which the key can be used; for example, 'Verify'. -OAUTH2PERMISSIONSCOPE : The delegated permissions exposed by the application. For more information see the oauth2PermissionScopes property on the application entity's api property. Not nullable. +OAUTH2PERMISSIONSCOPE : The delegated permissions exposed by the application. For more information see the oauth2PermissionScopes property on the application entity's api property. Not nullable. To construct, see NOTES section for OAUTH2PERMISSIONSCOPE properties and create a hash table. [AdminConsentDescription ]: A description of the delegated permissions, intended to be read by an administrator granting the permission on behalf of all users. This text appears in tenant-wide admin consent experiences. [AdminConsentDisplayName ]: The permission's title, intended to be read by an administrator granting the permission on behalf of all users. [Id ]: Unique delegated permission identifier inside the collection of delegated permissions defined for a resource application. @@ -807,11 +807,11 @@ PASSWORDCREDENTIAL : The collection of pass [KeyId ]: The unique identifier for the password. [StartDateTime ]: The date and time at which the password becomes valid. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Optional. -SAMLSINGLESIGNONSETTING : samlSingleSignOnSettings +SAMLSINGLESIGNONSETTING : samlSingleSignOnSettings To construct, see NOTES section for SAMLSINGLESIGNONSETTING properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [RelayState ]: The relative URI the service provider would redirect to after completion of the single sign-on flow. -TOKENISSUANCEPOLICY : The tokenIssuancePolicies assigned to this service principal. Supports $expand. +TOKENISSUANCEPOLICY : The tokenIssuancePolicies assigned to this service principal. Supports $expand. To construct, see NOTES section for TOKENISSUANCEPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -862,7 +862,7 @@ TOKENISSUANCEPOLICY : The tokenIssuancePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -1022,7 +1022,7 @@ TOKENISSUANCEPOLICY : The tokenIssuancePol [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -TOKENLIFETIMEPOLICY : The tokenLifetimePolicies assigned to this service principal. Supports $expand. +TOKENLIFETIMEPOLICY : The tokenLifetimePolicies assigned to this service principal. Supports $expand. To construct, see NOTES section for TOKENLIFETIMEPOLICY properties and create a hash table. [AppliesTo ]: [DeletedDateTime ]: [DisplayName ]: The name displayed in directory @@ -1073,7 +1073,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -1233,7 +1233,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [DeletedDateTime ]: [DisplayName ]: The name displayed in directory -TRANSITIVEMEMBEROF : . +TRANSITIVEMEMBEROF : . To construct, see NOTES section for TRANSITIVEMEMBEROF properties and create a hash table. [DeletedDateTime ]: [DisplayName ]: The name displayed in directory .Link @@ -1259,7 +1259,6 @@ param( # Not nullable. # Supports $filter (eq, NOT, ge, le). # To construct, see NOTES section for KEYCREDENTIALS properties and create a hash table. - # To construct, see NOTES section for KEYCREDENTIAL properties and create a hash table. ${KeyCredential}, [Parameter()] @@ -1269,7 +1268,6 @@ param( # The collection of password credentials associated with the application. # Not nullable. # To construct, see NOTES section for PASSWORDCREDENTIALS properties and create a hash table. - # To construct, see NOTES section for PASSWORDCREDENTIAL properties and create a hash table. ${PasswordCredential}, [Parameter()] @@ -1570,7 +1568,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal] # service principal object - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='SPNWithDisplayNameParameterSet', Mandatory)] @@ -1649,7 +1646,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -1673,6 +1670,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Update-AzADServicePrincipalAppRoleAssignment.ps1 b/generated/Resources/MSGraph.Autorest/exports/Update-AzADServicePrincipalAppRoleAssignment.ps1 index 7273f712897e..9f1467d75c01 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Update-AzADServicePrincipalAppRoleAssignment.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Update-AzADServicePrincipalAppRoleAssignment.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Update the navigation property appRoleAssignments in servicePrincipals +update the navigation property appRoleAssignments in servicePrincipals .Description -Update the navigation property appRoleAssignments in servicePrincipals +update the navigation property appRoleAssignments in servicePrincipals .Example Update-AzADServicePrincipalAppRoleAssignment -AppRoleAssignmentId Zbm-cUeDXUmlicIc3eenIoFW9pZ_gRBIudKgu0gaMIw -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 -AppRoleId 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 @@ -63,7 +63,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment] # Represents an Azure Active Directory object. # The directoryObject type is the base type for many other directory entity types. - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='UpdateExpanded')] @@ -81,12 +80,25 @@ param( # Required on create. ${AppRoleId}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -144,7 +156,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -163,9 +175,15 @@ begin { $mapping = @{ Update = 'Az.MSGraph.private\Update-AzADServicePrincipalAppRoleAssignment_Update'; UpdateExpanded = 'Az.MSGraph.private\Update-AzADServicePrincipalAppRoleAssignment_UpdateExpanded'; + UpdateViaJsonFilePath = 'Az.MSGraph.private\Update-AzADServicePrincipalAppRoleAssignment_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.MSGraph.private\Update-AzADServicePrincipalAppRoleAssignment_UpdateViaJsonString'; } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/exports/Update-AzADUser.ps1 b/generated/Resources/MSGraph.Autorest/exports/Update-AzADUser.ps1 index 7d627e68b8a0..ce4e0f7e7767 100644 --- a/generated/Resources/MSGraph.Autorest/exports/Update-AzADUser.ps1 +++ b/generated/Resources/MSGraph.Autorest/exports/Update-AzADUser.ps1 @@ -31,7 +31,7 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -IDENTITY : Represents the identities that can be used to sign in to this user account. An identity can be provided by Microsoft (also known as a local account), by organizations, or by social identity providers such as Facebook, Google, and Microsoft, and tied to a user account. May contain multiple items with the same signInType value. Supports $filter (eq) only where the signInType is not userPrincipalName. +IDENTITY : Represents the identities that can be used to sign in to this user account. An identity can be provided by Microsoft (also known as a local account), by organizations, or by social identity providers such as Facebook, Google, and Microsoft, and tied to a user account. May contain multiple items with the same signInType value. Supports $filter (eq) only where the signInType is not userPrincipalName. To construct, see NOTES section for IDENTITY properties and create a hash table. [Issuer ]: Specifies the issuer of the identity, for example facebook.com.For local accounts (where signInType is not federated), this property is the local B2C tenant default domain name, for example contoso.onmicrosoft.com.For external users from other Azure AD organization, this will be the domain of the federated organization, for example contoso.com.Supports $filter. 512 character limit. [IssuerAssignedId ]: Specifies the unique identifier assigned to the user by the issuer. The combination of issuer and issuerAssignedId must be unique within the organization. Represents the sign-in name for the user, when signInType is set to emailAddress or userName (also known as local accounts).When signInType is set to: emailAddress, (or a custom string that starts with emailAddress like emailAddress1) issuerAssignedId must be a valid email addressuserName, issuerAssignedId must be a valid local part of an email addressSupports $filter. 100 character limit. [SignInType ]: Specifies the user sign-in types in your directory, such as emailAddress, userName or federated. Here, federated represents a unique identifier for a user from an issuer, that can be in any format chosen by the issuer. Additional validation is enforced on issuerAssignedId when the sign-in type is set to emailAddress or userName. This property can also be set to any custom string. @@ -119,7 +119,7 @@ INPUTOBJECT : user input object [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -452,7 +452,7 @@ INPUTOBJECT : user input object [UserPrincipalName ]: The user principal name (UPN) of the user. The UPN is an Internet-style login name for the user based on the Internet standard RFC 822. By convention, this should map to the user's email name. The general format is alias@domain, where domain must be present in the tenant's collection of verified domains. This property is required when a user is created. The verified domains for the tenant can be accessed from the verifiedDomains property of organization.NOTE: While this property can contain accent characters, they can cause access issues to first-party applications for the user. Supports $filter (eq, ne, NOT, ge, le, in, startsWith, endsWith) and $orderBy. [UserType ]: A string value that can be used to classify user types in your directory, such as Member and Guest. Supports $filter (eq, ne, NOT, in,). -PASSWORDPROFILE : passwordProfile +PASSWORDPROFILE : passwordProfile To construct, see NOTES section for PASSWORDPROFILE properties and create a hash table. [(Any) ]: This indicates any property can be added to this object. [ForceChangePasswordNextSignIn ]: true if the user must change her password on the next login; otherwise false. If not set, default is false. NOTE: For Azure B2C tenants, set to false and instead use custom policies and user flows to force password reset at first sign in. See Force password reset at first logon. [ForceChangePasswordNextSignInWithMfa ]: If true, at next sign-in, the user must perform a multi-factor authentication (MFA) before being forced to change their password. The behavior is identical to forceChangePasswordNextSignIn except that the user is required to first perform a multi-factor authentication before password change. After a password change, this property will be automatically reset to false. If not set, default is false. @@ -785,7 +785,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser] # user input object - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='UPNParameterSet', Mandatory)] @@ -864,7 +863,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -888,6 +887,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/generated/Resources/MSGraph.Autorest/generate-info.json b/generated/Resources/MSGraph.Autorest/generate-info.json index ddc89aa86ec3..6ef6ae36062c 100644 --- a/generated/Resources/MSGraph.Autorest/generate-info.json +++ b/generated/Resources/MSGraph.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "7d51b228-a6e5-4a62-a246-c73ecd37ffb2" + "generate_Id": "b9ad0464-6731-4e5e-a760-0d118f5e6db2" } diff --git a/generated/Resources/MSGraph.Autorest/generated/Module.cs b/generated/Resources/MSGraph.Autorest/generated/Module.cs index 00106b310944..c488abfc9ac6 100644 --- a/generated/Resources/MSGraph.Autorest/generated/Module.cs +++ b/generated/Resources/MSGraph.Autorest/generated/Module.cs @@ -20,6 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph using SignalDelegate = global::System.Func, global::System.Threading.Tasks.Task>; using EventListenerDelegate = global::System.Func, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Management.Automation.InvocationInfo, string, string, string, global::System.Exception, global::System.Threading.Tasks.Task>; using NextDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>; + using SanitizerDelegate = global::System.Action; + using GetTelemetryInfoDelegate = global::System.Func>; /// A class that contains the module-common code and data. public partial class Module @@ -33,12 +35,20 @@ public partial class Module public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler(); + private static bool _init = false; + + private static readonly global::System.Object _initLock = new global::System.Object(); + + private static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline _pipelineWithProxy; + private static readonly global::System.Object _singletonLock = new global::System.Object(); + private TokenAudienceConverterDelegate _tokenAudienceConverter = null; public bool _useProxy = false; @@ -69,11 +79,11 @@ public partial class Module /// The delegate to get the telemetry Id. public GetTelemetryIdDelegate GetTelemetryId { get; set; } - /// Backing field for property. - private static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module _instance; + /// The delegate to get the telemetry info. + public GetTelemetryInfoDelegate GetTelemetryInfo { get; set; } /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.MSGraph"; @@ -87,6 +97,9 @@ public partial class Module /// The ResourceID for this module (azure arm). public string ResourceId => @"Az.MSGraph"; + /// The delegate to call in WriteObject to sanitize the output object. + public SanitizerDelegate SanitizeOutput { get; set; } + /// The delegate for creating a telemetry. public TelemetryDelegate Telemetry { get; set; } @@ -134,9 +147,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline /// Initialization steps performed after the module is loaded. public void Init() { - OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } ); - OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } ); - CustomInit(); + if (_init == false) + { + lock (_initLock) { + if (_init == false) { + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } ); + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } ); + CustomInit(); + _init = true; + } + } + } } /// Creates the module instance. diff --git a/generated/Resources/MSGraph.Autorest/generated/api/MSGraph.cs b/generated/Resources/MSGraph.Autorest/generated/api/MSGraph.cs index c6700c2ca88e..fe08e36d0c9d 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/MSGraph.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/MSGraph.cs @@ -51,7 +51,7 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ApplicationsAddKey_Call(request,onOk,onDefault,eventListener,sender); + await this.ApplicationsAddKey_Call (request, onOk,onDefault,eventListener,sender); } } @@ -77,7 +77,7 @@ public partial class MSGraph var _match = new global::System.Text.RegularExpressions.Regex("^/applications/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}/microsoft.graph.addKey'"); + throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}'"); } // replace URI parameters with values from identity @@ -103,93 +103,111 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ApplicationsAddKey_Call(request,onOk,onDefault,eventListener,sender); + await this.ApplicationsAddKey_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). + /// Invoke action addKey + /// + /// Action parameters /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the 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 ApplicationsAddKey_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ApplicationsAddKeyViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPaths17CrvdcApplicationsApplicationIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/applications/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}'"); } + + // replace URI parameters with values from identity + var applicationId = _match.Groups["application-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/applications/" + + applicationId + + "/microsoft.graph.addKey" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ApplicationsAddKeyWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// + /// Invoke action addKey /// key: id of application - /// Action parameters + /// Json string supplied to the ApplicationsAddKey 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.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ApplicationsAddKey_Validate(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPaths17CrvdcApplicationsApplicationIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task ApplicationsAddKeyViaJsonString(string applicationId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(applicationId),applicationId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/applications/" + + global::System.Uri.EscapeDataString(applicationId) + + "/microsoft.graph.addKey" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApplicationsAddKey_Call (request, onOk,onDefault,eventListener,sender); } } - /// Invoke action addPassword + /// Invoke action addKey /// key: id of application - /// Action parameters - /// a delegate that is called 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 ApplicationsAddKey operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the 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 ApplicationsAddPassword(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPaths141Ryo0ApplicationsApplicationIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ApplicationsAddKeyViaJsonStringWithResult(string applicationId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) @@ -198,90 +216,76 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/applications/" + global::System.Uri.EscapeDataString(applicationId) - + "/microsoft.graph.addPassword" + + "/microsoft.graph.addKey" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ApplicationsAddPassword_Call(request,onOk,onDefault,eventListener,sender); + return await this.ApplicationsAddKeyWithResult_Call (request, eventListener,sender); } } - /// Invoke action addPassword - /// + /// Invoke action addKey + /// key: id of application /// Action parameters - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the 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 ApplicationsAddPasswordViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPaths141Ryo0ApplicationsApplicationIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ApplicationsAddKeyWithResult(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPaths17CrvdcApplicationsApplicationIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/applications/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}/microsoft.graph.addPassword'"); - } - - // replace URI parameters with values from identity - var applicationId = _match.Groups["application-id"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/applications/" - + applicationId - + "/microsoft.graph.addPassword" + + global::System.Uri.EscapeDataString(applicationId) + + "/microsoft.graph.addKey" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ApplicationsAddPassword_Call(request,onOk,onDefault,eventListener,sender); + return await this.ApplicationsAddKeyWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 ApplicationsAddPassword_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ApplicationsAddKeyWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -289,25 +293,37 @@ public partial class MSGraph try { var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) { case global::System.Net.HttpStatusCode.OK: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } default: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } } @@ -321,70 +337,9 @@ public partial class MSGraph } } - /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. - /// - /// key: id of application - /// Action parameters - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task ApplicationsAddPassword_Validate(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPaths141Ryo0ApplicationsApplicationIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(applicationId),applicationId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// Add new entity to applications - /// New entity - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task ApplicationsApplicationCreateApplication(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) - { - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/applications" - - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ApplicationsApplicationCreateApplication_Call(request,onCreated,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 201 (Created). + /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -392,7 +347,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ApplicationsApplicationCreateApplication_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ApplicationsAddKey_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -408,10 +363,10 @@ public partial class MSGraph switch ( _response.StatusCode ) { - case global::System.Net.HttpStatusCode.Created: + case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphApplication.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -433,38 +388,38 @@ public partial class MSGraph } /// - /// 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. /// - /// New entity + /// key: id of application + /// Action parameters /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ApplicationsApplicationCreateApplication_Validate(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ApplicationsAddKey_Validate(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPaths17CrvdcApplicationsApplicationIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(applicationId),applicationId); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// - /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity - /// types. - /// + /// Invoke action addPassword /// key: id of application - /// ETag - /// a delegate that is called when the remote service returns 204 (NoContent). + /// Action parameters + /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ApplicationsApplicationDeleteApplication(string applicationId, string ifMatch, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ApplicationsAddPassword(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPaths141Ryo0ApplicationsApplicationIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { // Constant Parameters using( NoSynchronizationContext ) @@ -473,6 +428,7 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/applications/" + global::System.Uri.EscapeDataString(applicationId) + + "/microsoft.graph.addPassword" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -480,36 +436,32 @@ public partial class MSGraph // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ApplicationsApplicationDeleteApplication_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ApplicationsAddPassword_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity - /// types. - /// + /// Invoke action addPassword /// - /// ETag - /// a delegate that is called when the remote service returns 204 (NoContent). + /// Action parameters + /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ApplicationsApplicationDeleteApplicationViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ApplicationsAddPasswordViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPaths141Ryo0ApplicationsApplicationIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { // Constant Parameters using( NoSynchronizationContext ) @@ -528,6 +480,7 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/applications/" + applicationId + + "/microsoft.graph.addPassword" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -535,109 +488,120 @@ public partial class MSGraph // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ApplicationsApplicationDeleteApplication_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ApplicationsAddPassword_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 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Invoke action addPassword + /// + /// Action parameters /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the 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 ApplicationsApplicationDeleteApplication_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ApplicationsAddPasswordViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPaths141Ryo0ApplicationsApplicationIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); 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.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/applications/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}'"); } + + // replace URI parameters with values from identity + var applicationId = _match.Groups["application-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/applications/" + + applicationId + + "/microsoft.graph.addPassword" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ApplicationsAddPasswordWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, - /// but you will get validation events back. - /// + /// Invoke action addPassword /// key: id of application - /// ETag + /// Json string supplied to the ApplicationsAddPassword 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.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ApplicationsApplicationDeleteApplication_Validate(string applicationId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task ApplicationsAddPasswordViaJsonString(string applicationId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(applicationId),applicationId); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/applications/" + + global::System.Uri.EscapeDataString(applicationId) + + "/microsoft.graph.addPassword" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApplicationsAddPassword_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity - /// types. - /// + /// Invoke action addPassword /// key: id of application - /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ - /// Select properties to be returned - /// Expand related entities - /// a delegate that is called 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 ApplicationsAddPassword operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 ApplicationsApplicationGetApplication(string applicationId, string consistencyLevel, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ApplicationsAddPasswordViaJsonStringWithResult(string applicationId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) @@ -646,94 +610,128 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/applications/" + global::System.Uri.EscapeDataString(applicationId) - + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) - + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + "/microsoft.graph.addPassword" + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // add headers parameters - if (null != consistencyLevel) - { - request.Headers.Add("ConsistencyLevel",consistencyLevel); - } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ApplicationsApplicationGetApplication_Call(request,onOk,onDefault,eventListener,sender); + return await this.ApplicationsAddPasswordWithResult_Call (request, eventListener,sender); } } - /// - /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity - /// types. - /// - /// - /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ - /// Select properties to be returned - /// Expand related entities - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Invoke action addPassword + /// key: id of application + /// Action parameters /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the 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 ApplicationsApplicationGetApplicationViaIdentity(global::System.String viaIdentity, string consistencyLevel, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ApplicationsAddPasswordWithResult(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPaths141Ryo0ApplicationsApplicationIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/applications/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}'"); - } - - // replace URI parameters with values from identity - var applicationId = _match.Groups["application-id"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/applications/" - + applicationId - + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) - + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + global::System.Uri.EscapeDataString(applicationId) + + "/microsoft.graph.addPassword" + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // add headers parameters - if (null != consistencyLevel) + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ApplicationsAddPasswordWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApplicationsAddPasswordWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try { - request.Headers.Add("ConsistencyLevel",consistencyLevel); - } + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ApplicationsApplicationGetApplication_Call(request,onOk,onDefault,eventListener,sender); + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 @@ -743,7 +741,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ApplicationsApplicationGetApplication_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ApplicationsAddPassword_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -762,7 +760,7 @@ public partial class MSGraph case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphApplication.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -784,43 +782,37 @@ public partial class MSGraph } /// - /// 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. /// /// key: id of application - /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ - /// Select properties to be returned - /// Expand related entities + /// Action parameters /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ApplicationsApplicationGetApplication_Validate(string applicationId, string consistencyLevel, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ApplicationsAddPassword_Validate(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPaths141Ryo0ApplicationsApplicationIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(applicationId),applicationId); - await eventListener.AssertNotNull(nameof(consistencyLevel),consistencyLevel); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Get entities from applications - /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ - /// Search items by search phrases - /// Filter items by property values - /// Include count of items - /// Order items by property values - /// Select properties to be returned - /// Expand related entities - /// a delegate that is called when the remote service returns 200 (OK). + /// Add new entity to applications + /// New entity + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ApplicationsApplicationListApplication(string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ApplicationsApplicationCreateApplication(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { // Constant Parameters using( NoSynchronizationContext ) @@ -828,49 +820,29 @@ public partial class MSGraph // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/applications" - + "?" - + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) - + "&" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" - + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) - + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) - + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) - + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != consistencyLevel) - { - request.Headers.Add("ConsistencyLevel",consistencyLevel); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ApplicationsApplicationListApplication_Call(request,onOk,onDefault,eventListener,sender); + await this.ApplicationsApplicationCreateApplication_Call (request, onCreated,onDefault,eventListener,sender); } } - /// Get entities from applications - /// - /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ - /// Search items by search phrases - /// Filter items by property values - /// Include count of items - /// Order items by property values - /// Select properties to be returned - /// Expand related entities - /// a delegate that is called when the remote service returns 200 (OK). + /// Add new entity to applications + /// Json string supplied to the ApplicationsApplicationCreateApplication operation + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -878,61 +850,174 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ApplicationsApplicationListApplicationViaIdentity(global::System.String viaIdentity, string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ApplicationsApplicationCreateApplicationViaJsonString(global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/applications$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/applications'"); - } - - // replace URI parameters with values from identity // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/applications" - + "?" - + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) - + "&" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" - + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) - + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) - + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) - + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != consistencyLevel) - { - request.Headers.Add("ConsistencyLevel",consistencyLevel); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApplicationsApplicationCreateApplication_Call (request, onCreated,onDefault,eventListener,sender); + } + } + + /// Add new entity to applications + /// Json string supplied to the ApplicationsApplicationCreateApplication operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApplicationsApplicationCreateApplicationViaJsonStringWithResult(global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/applications" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ApplicationsApplicationCreateApplicationWithResult_Call (request, eventListener,sender); + } + } + + /// Add new entity to applications + /// New entity + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApplicationsApplicationCreateApplicationWithResult(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/applications" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ApplicationsApplicationListApplication_Call(request,onOk,onDefault,eventListener,sender); + return await this.ApplicationsApplicationCreateApplicationWithResult_Call (request, eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApplicationsApplicationCreateApplicationWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphApplication.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -940,7 +1025,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ApplicationsApplicationListApplication_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ApplicationsApplicationCreateApplication_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -956,10 +1041,10 @@ public partial class MSGraph switch ( _response.StatusCode ) { - case global::System.Net.HttpStatusCode.OK: + case global::System.Net.HttpStatusCode.Created: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfApplication.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphApplication.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -981,27 +1066,20 @@ public partial class MSGraph } /// - /// 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. /// - /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ - /// Search items by search phrases - /// Filter items by property values - /// Include count of items - /// Order items by property values - /// Select properties to be returned - /// Expand related entities + /// New entity /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ApplicationsApplicationListApplication_Validate(string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ApplicationsApplicationCreateApplication_Validate(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(consistencyLevel),consistencyLevel); - await eventListener.AssertNotNull(nameof(Search),Search); - await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } @@ -1010,17 +1088,16 @@ public partial class MSGraph /// types. /// /// key: id of application - /// New property values + /// ETag /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ApplicationsApplicationUpdateApplication(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ApplicationsApplicationDeleteApplication(string applicationId, string ifMatch, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) @@ -1036,16 +1113,18 @@ public partial class MSGraph // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ApplicationsApplicationUpdateApplication_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ApplicationsApplicationDeleteApplication_Call (request, onNoContent,onDefault,eventListener,sender); } } @@ -1054,17 +1133,16 @@ public partial class MSGraph /// types. /// /// - /// New property values + /// ETag /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ApplicationsApplicationUpdateApplicationViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ApplicationsApplicationDeleteApplicationViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) @@ -1090,21 +1168,23 @@ public partial class MSGraph // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ApplicationsApplicationUpdateApplication_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ApplicationsApplicationDeleteApplication_Call (request, onNoContent,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 204 (NoContent). @@ -1115,7 +1195,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ApplicationsApplicationUpdateApplication_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ApplicationsApplicationDeleteApplication_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1156,38 +1236,41 @@ public partial class MSGraph } /// - /// Validation method for method. Call this like the actual call, + /// Validation method for method. Call this like the actual call, /// but you will get validation events back. /// /// key: id of application - /// New property values + /// ETag /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ApplicationsApplicationUpdateApplication_Validate(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ApplicationsApplicationDeleteApplication_Validate(string applicationId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(applicationId),applicationId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); } } - /// Create new navigation property to federatedIdentityCredentials for applications + /// + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. + /// /// key: id of application - /// New navigation property - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Select properties to be returned + /// Expand related entities + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ApplicationsCreateFederatedIdentityCredentials(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ApplicationsApplicationGetApplication(string applicationId, string consistencyLevel, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) @@ -1196,40 +1279,48 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/applications/" + global::System.Uri.EscapeDataString(applicationId) - + "/federatedIdentityCredentials" - + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != consistencyLevel) + { + request.Headers.Add("ConsistencyLevel",consistencyLevel); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ApplicationsCreateFederatedIdentityCredentials_Call(request,onCreated,onDefault,eventListener,sender); + await this.ApplicationsApplicationGetApplication_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create new navigation property to federatedIdentityCredentials for applications + /// + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. + /// /// - /// New navigation property - /// a delegate that is called when the remote service returns 201 (Created). + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Select properties to be returned + /// Expand related entities + /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ApplicationsCreateFederatedIdentityCredentialsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ApplicationsApplicationGetApplicationViaIdentity(global::System.String viaIdentity, string consistencyLevel, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) @@ -1239,7 +1330,7 @@ public partial class MSGraph var _match = new global::System.Text.RegularExpressions.Regex("^/applications/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}/federatedIdentityCredentials'"); + throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}'"); } // replace URI parameters with values from identity @@ -1248,112 +1339,104 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/applications/" + applicationId - + "/federatedIdentityCredentials" - + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != consistencyLevel) + { + request.Headers.Add("ConsistencyLevel",consistencyLevel); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ApplicationsCreateFederatedIdentityCredentials_Call(request,onCreated,onDefault,eventListener,sender); + await this.ApplicationsApplicationGetApplication_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. /// - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Select properties to be returned + /// Expand related entities /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 ApplicationsCreateFederatedIdentityCredentials_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ApplicationsApplicationGetApplicationViaIdentityWithResult(global::System.String viaIdentity, string consistencyLevel, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } + var _match = new global::System.Text.RegularExpressions.Regex("^/applications/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}'"); } - finally + + // replace URI parameters with values from identity + var applicationId = _match.Groups["application-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/applications/" + + applicationId + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != consistencyLevel) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + request.Headers.Add("ConsistencyLevel",consistencyLevel); } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ApplicationsApplicationGetApplicationWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual - /// call, but you will get validation events back. + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. /// /// key: id of application - /// New navigation property - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task ApplicationsCreateFederatedIdentityCredentials_Validate(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(applicationId),applicationId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// Delete navigation property federatedIdentityCredentials for applications - /// key: id of application - /// key: id of federatedIdentityCredential - /// ETag - /// 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). + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Select properties to be returned + /// Expand related entities /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 ApplicationsDeleteFederatedIdentityCredentials(string applicationId, string federatedIdentityCredentialId, string ifMatch, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ApplicationsApplicationGetApplicationWithResult(string applicationId, string consistencyLevel, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) @@ -1362,90 +1445,98 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/applications/" + global::System.Uri.EscapeDataString(applicationId) - + "/federatedIdentityCredentials/" - + global::System.Uri.EscapeDataString(federatedIdentityCredentialId) - + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters - if (null != ifMatch) + if (null != consistencyLevel) { - request.Headers.Add("If-Match",ifMatch); + request.Headers.Add("ConsistencyLevel",consistencyLevel); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ApplicationsDeleteFederatedIdentityCredentials_Call(request,onNoContent,onDefault,eventListener,sender); + return await this.ApplicationsApplicationGetApplicationWithResult_Call (request, eventListener,sender); } } - /// Delete navigation property federatedIdentityCredentials for applications - /// - /// ETag - /// 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). + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 ApplicationsDeleteFederatedIdentityCredentialsViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ApplicationsApplicationGetApplicationWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/applications/(?[^/]+)/federatedIdentityCredentials/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + global::System.Net.Http.HttpResponseMessage _response = null; + try { - throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}/federatedIdentityCredentials/{federatedIdentityCredential-id}'"); - } - - // replace URI parameters with values from identity - var applicationId = _match.Groups["application-id"].Value; - var federatedIdentityCredentialId = _match.Groups["federatedIdentityCredential-id"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/applications/" - + applicationId - + "/federatedIdentityCredentials/" - + federatedIdentityCredentialId - - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - // add headers parameters - if (null != ifMatch) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphApplication.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - request.Headers.Add("If-Match",ifMatch); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ApplicationsDeleteFederatedIdentityCredentials_Call(request,onNoContent,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -1453,7 +1544,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ApplicationsDeleteFederatedIdentityCredentials_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ApplicationsApplicationGetApplication_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1469,10 +1560,10 @@ public partial class MSGraph switch ( _response.StatusCode ) { - case global::System.Net.HttpStatusCode.NoContent: + case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphApplication.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -1494,29 +1585,32 @@ public partial class MSGraph } /// - /// 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. /// /// key: id of application - /// key: id of federatedIdentityCredential - /// ETag + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Select properties to be returned + /// Expand related entities /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ApplicationsDeleteFederatedIdentityCredentials_Validate(string applicationId, string federatedIdentityCredentialId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ApplicationsApplicationGetApplication_Validate(string applicationId, string consistencyLevel, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(applicationId),applicationId); - await eventListener.AssertNotNull(nameof(federatedIdentityCredentialId),federatedIdentityCredentialId); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(consistencyLevel),consistencyLevel); } } - /// Get federatedIdentityCredentials from applications - /// key: id of application - /// key: id of federatedIdentityCredential + /// Get entities from applications + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values /// Select properties to be returned /// Expand related entities /// a delegate that is called when the remote service returns 200 (OK). @@ -1527,21 +1621,26 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ApplicationsGetFederatedIdentityCredentials(string applicationId, string federatedIdentityCredentialId, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ApplicationsApplicationListApplication(string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/applications/" - + global::System.Uri.EscapeDataString(applicationId) - + "/federatedIdentityCredentials/" - + global::System.Uri.EscapeDataString(federatedIdentityCredentialId) + "/applications" + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -1551,14 +1650,25 @@ public partial class MSGraph var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != consistencyLevel) + { + request.Headers.Add("ConsistencyLevel",consistencyLevel); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ApplicationsGetFederatedIdentityCredentials_Call(request,onOk,onDefault,eventListener,sender); + await this.ApplicationsApplicationListApplication_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get federatedIdentityCredentials from applications + /// Get entities from applications /// + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values /// Select properties to be returned /// Expand related entities /// a delegate that is called when the remote service returns 200 (OK). @@ -1569,32 +1679,35 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ApplicationsGetFederatedIdentityCredentialsViaIdentity(global::System.String viaIdentity, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ApplicationsApplicationListApplicationViaIdentity(global::System.String viaIdentity, string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/applications/(?[^/]+)/federatedIdentityCredentials/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/applications$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}/federatedIdentityCredentials/{federatedIdentityCredential-id}'"); + throw new global::System.Exception("Invalid identity for URI '/applications'"); } // replace URI parameters with values from identity - var applicationId = _match.Groups["application-id"].Value; - var federatedIdentityCredentialId = _match.Groups["federatedIdentityCredential-id"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/applications/" - + applicationId - + "/federatedIdentityCredentials/" - + federatedIdentityCredentialId + "/applications" + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -1604,111 +1717,50 @@ public partial class MSGraph var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ApplicationsGetFederatedIdentityCredentials_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task ApplicationsGetFederatedIdentityCredentials_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + // add headers parameters + if (null != consistencyLevel) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + request.Headers.Add("ConsistencyLevel",consistencyLevel); } - } - } - /// - /// Validation method for method. Call this like the actual call, - /// but you will get validation events back. - /// - /// key: id of application - /// key: id of federatedIdentityCredential - /// Select properties to be returned - /// Expand related entities - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task ApplicationsGetFederatedIdentityCredentials_Validate(string applicationId, string federatedIdentityCredentialId, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(applicationId),applicationId); - await eventListener.AssertNotNull(nameof(federatedIdentityCredentialId),federatedIdentityCredentialId); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApplicationsApplicationListApplication_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get federatedIdentityCredentials from applications - /// key: id of application + /// Get entities from applications + /// + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ /// Search items by search phrases /// Filter items by property values /// Include count of items /// Order items by property values /// Select properties to be returned /// Expand related entities - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 ApplicationsListFederatedIdentityCredentials(string applicationId, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ApplicationsApplicationListApplicationViaIdentityWithResult(global::System.String viaIdentity, string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/applications$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/applications'"); + } + + // replace URI parameters with values from identity // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/applications/" - + global::System.Uri.EscapeDataString(applicationId) - + "/federatedIdentityCredentials" + "/applications" + "?" + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + "&" @@ -1716,62 +1768,54 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != consistencyLevel) + { + request.Headers.Add("ConsistencyLevel",consistencyLevel); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ApplicationsListFederatedIdentityCredentials_Call(request,onOk,onDefault,eventListener,sender); + return await this.ApplicationsApplicationListApplicationWithResult_Call (request, eventListener,sender); } } - /// Get federatedIdentityCredentials from applications - /// + /// Get entities from applications + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ /// Search items by search phrases /// Filter items by property values /// Include count of items /// Order items by property values /// Select properties to be returned /// Expand related entities - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 ApplicationsListFederatedIdentityCredentialsViaIdentity(global::System.String viaIdentity, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ApplicationsApplicationListApplicationWithResult(string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/applications/(?[^/]+)/federatedIdentityCredentials$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}/federatedIdentityCredentials'"); - } - - // replace URI parameters with values from identity - var applicationId = _match.Groups["application-id"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/applications/" - + applicationId - + "/federatedIdentityCredentials" + "/applications" + "?" + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + "&" @@ -1779,28 +1823,96 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != consistencyLevel) + { + request.Headers.Add("ConsistencyLevel",consistencyLevel); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ApplicationsListFederatedIdentityCredentials_Call(request,onOk,onDefault,eventListener,sender); + return await this.ApplicationsApplicationListApplicationWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApplicationsApplicationListApplicationWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfApplication.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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). @@ -1811,7 +1923,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ApplicationsListFederatedIdentityCredentials_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ApplicationsApplicationListApplication_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1830,7 +1942,7 @@ public partial class MSGraph case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredentialCollectionResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfApplication.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -1852,10 +1964,10 @@ public partial class MSGraph } /// - /// 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. /// - /// key: id of application + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ /// Search items by search phrases /// Filter items by property values /// Include count of items @@ -1866,19 +1978,22 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ApplicationsListFederatedIdentityCredentials_Validate(string applicationId, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ApplicationsApplicationListApplication_Validate(string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(applicationId),applicationId); + await eventListener.AssertNotNull(nameof(consistencyLevel),consistencyLevel); await eventListener.AssertNotNull(nameof(Search),Search); await eventListener.AssertNotNull(nameof(Filter),Filter); } } - /// Invoke action removeKey + /// + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. + /// /// key: id of application - /// Action parameters + /// New property values /// 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). @@ -1888,7 +2003,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ApplicationsRemoveKey(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsHxlydaApplicationsApplicationIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ApplicationsApplicationUpdateApplication(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { // Constant Parameters using( NoSynchronizationContext ) @@ -1897,7 +2012,6 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/applications/" + global::System.Uri.EscapeDataString(applicationId) - + "/microsoft.graph.removeKey" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1905,7 +2019,7 @@ public partial class MSGraph // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -1914,13 +2028,16 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ApplicationsRemoveKey_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ApplicationsApplicationUpdateApplication_Call (request, onNoContent,onDefault,eventListener,sender); } } - /// Invoke action removeKey + /// + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. + /// /// - /// Action parameters + /// New property values /// 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). @@ -1930,7 +2047,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ApplicationsRemoveKeyViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsHxlydaApplicationsApplicationIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ApplicationsApplicationUpdateApplicationViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { // Constant Parameters using( NoSynchronizationContext ) @@ -1940,7 +2057,7 @@ public partial class MSGraph var _match = new global::System.Text.RegularExpressions.Regex("^/applications/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}/microsoft.graph.removeKey'"); + throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}'"); } // replace URI parameters with values from identity @@ -1949,7 +2066,6 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/applications/" + applicationId - + "/microsoft.graph.removeKey" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1957,7 +2073,7 @@ public partial class MSGraph // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -1966,11 +2082,56 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ApplicationsRemoveKey_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ApplicationsApplicationUpdateApplication_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. + /// + /// key: id of application + /// Json string supplied to the ApplicationsApplicationUpdateApplication operation + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApplicationsApplicationUpdateApplicationViaJsonString(string applicationId, global::System.String jsonString, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/applications/" + + global::System.Uri.EscapeDataString(applicationId) + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApplicationsApplicationUpdateApplication_Call (request, onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// + /// Actual wire call for method. + /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled @@ -1980,7 +2141,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ApplicationsRemoveKey_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ApplicationsApplicationUpdateApplication_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2021,16 +2182,16 @@ public partial class MSGraph } /// - /// 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. /// /// key: id of application - /// Action parameters + /// New property values /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ApplicationsRemoveKey_Validate(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsHxlydaApplicationsApplicationIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ApplicationsApplicationUpdateApplication_Validate(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -2040,10 +2201,10 @@ public partial class MSGraph } } - /// Invoke action removePassword + /// create new navigation property to federatedIdentityCredentials for applications /// key: id of application - /// Action parameters - /// a delegate that is called when the remote service returns 204 (NoContent). + /// New navigation property + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -2052,7 +2213,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ApplicationsRemovePassword(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsHv033BApplicationsApplicationIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ApplicationsCreateFederatedIdentityCredentials(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { // Constant Parameters using( NoSynchronizationContext ) @@ -2061,7 +2222,7 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/applications/" + global::System.Uri.EscapeDataString(applicationId) - + "/microsoft.graph.removePassword" + + "/federatedIdentityCredentials" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2078,14 +2239,14 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ApplicationsRemovePassword_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ApplicationsCreateFederatedIdentityCredentials_Call (request, onCreated,onDefault,eventListener,sender); } } - /// Invoke action removePassword + /// create new navigation property to federatedIdentityCredentials for applications /// - /// Action parameters - /// a delegate that is called when the remote service returns 204 (NoContent). + /// New navigation property + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -2094,7 +2255,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ApplicationsRemovePasswordViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsHv033BApplicationsApplicationIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ApplicationsCreateFederatedIdentityCredentialsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { // Constant Parameters using( NoSynchronizationContext ) @@ -2104,7 +2265,7 @@ public partial class MSGraph var _match = new global::System.Text.RegularExpressions.Regex("^/applications/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}/microsoft.graph.removePassword'"); + throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}'"); } // replace URI parameters with values from identity @@ -2113,7 +2274,7 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/applications/" + applicationId - + "/microsoft.graph.removePassword" + + "/federatedIdentityCredentials" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2130,94 +2291,111 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ApplicationsRemovePassword_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ApplicationsCreateFederatedIdentityCredentials_Call (request, onCreated,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// create new navigation property to federatedIdentityCredentials for applications + /// + /// New navigation property /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the 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 ApplicationsRemovePassword_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ApplicationsCreateFederatedIdentityCredentialsViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); 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.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/applications/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}'"); } + + // replace URI parameters with values from identity + var applicationId = _match.Groups["application-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/applications/" + + applicationId + + "/federatedIdentityCredentials" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ApplicationsCreateFederatedIdentityCredentialsWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. - /// + /// create new navigation property to federatedIdentityCredentials for applications /// key: id of application - /// Action parameters + /// Json string supplied to the ApplicationsCreateFederatedIdentityCredentials operation + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ApplicationsRemovePassword_Validate(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsHv033BApplicationsApplicationIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task ApplicationsCreateFederatedIdentityCredentialsViaJsonString(string applicationId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(applicationId),applicationId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/applications/" + + global::System.Uri.EscapeDataString(applicationId) + + "/federatedIdentityCredentials" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApplicationsCreateFederatedIdentityCredentials_Call (request, onCreated,onDefault,eventListener,sender); } } - /// Update the navigation property federatedIdentityCredentials in applications + /// create new navigation property to federatedIdentityCredentials for applications /// key: id of application - /// key: id of federatedIdentityCredential - /// New navigation property values - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Json string supplied to the ApplicationsCreateFederatedIdentityCredentials operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the 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 ApplicationsUpdateFederatedIdentityCredentials(string applicationId, string federatedIdentityCredentialId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ApplicationsCreateFederatedIdentityCredentialsViaJsonStringWithResult(string applicationId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) @@ -2226,95 +2404,78 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/applications/" + global::System.Uri.EscapeDataString(applicationId) - + "/federatedIdentityCredentials/" - + global::System.Uri.EscapeDataString(federatedIdentityCredentialId) + + "/federatedIdentityCredentials" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ApplicationsUpdateFederatedIdentityCredentials_Call(request,onNoContent,onDefault,eventListener,sender); + return await this.ApplicationsCreateFederatedIdentityCredentialsWithResult_Call (request, eventListener,sender); } } - /// Update the navigation property federatedIdentityCredentials in applications - /// - /// New navigation property values - /// 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). + /// create new navigation property to federatedIdentityCredentials for applications + /// key: id of application + /// New navigation property /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the 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 ApplicationsUpdateFederatedIdentityCredentialsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ApplicationsCreateFederatedIdentityCredentialsWithResult(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/applications/(?[^/]+)/federatedIdentityCredentials/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}/federatedIdentityCredentials/{federatedIdentityCredential-id}'"); - } - - // replace URI parameters with values from identity - var applicationId = _match.Groups["application-id"].Value; - var federatedIdentityCredentialId = _match.Groups["federatedIdentityCredential-id"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/applications/" - + applicationId - + "/federatedIdentityCredentials/" - + federatedIdentityCredentialId + + global::System.Uri.EscapeDataString(applicationId) + + "/federatedIdentityCredentials" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ApplicationsUpdateFederatedIdentityCredentials_Call(request,onNoContent,onDefault,eventListener,sender); + return await this.ApplicationsCreateFederatedIdentityCredentialsWithResult_Call (request, eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 ApplicationsUpdateFederatedIdentityCredentials_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ApplicationsCreateFederatedIdentityCredentialsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2322,25 +2483,37 @@ public partial class MSGraph try { var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.NoContent: + case global::System.Net.HttpStatusCode.Created: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } default: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } } @@ -2355,130 +2528,10 @@ public partial class MSGraph } /// - /// Validation method for method. Call this like the actual - /// call, but you will get validation events back. + /// Actual wire call for method. /// - /// key: id of application - /// key: id of federatedIdentityCredential - /// New navigation property values - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task ApplicationsUpdateFederatedIdentityCredentials_Validate(string applicationId, string federatedIdentityCredentialId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(applicationId),applicationId); - await eventListener.AssertNotNull(nameof(federatedIdentityCredentialId),federatedIdentityCredentialId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// - /// UMembers of this group, who can be users, devices, other groups, or service principals. Supports the List members, Add - /// member, and Remove member operations. Nullable. Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=members($select=id,userPrincipalName,displayName). - /// - /// key: id of group - /// New navigation property ref value - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task GroupsCreateGraphRefMembers(string groupId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.IDictionaryOfany body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) - { - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/groups/" - + global::System.Uri.EscapeDataString(groupId) - + "/members/$ref" - - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://graph.microsoft.com/beta{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.GroupsCreateGraphRefMembers_Call(request,onNoContent,onDefault,eventListener,sender); - } - } - - /// - /// UMembers of this group, who can be users, devices, other groups, or service principals. Supports the List members, Add - /// member, and Remove member operations. Nullable. Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=members($select=id,userPrincipalName,displayName). - /// - /// - /// New navigation property ref value - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task GroupsCreateGraphRefMembersViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.IDictionaryOfany body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) - { - // Constant Parameters - using( NoSynchronizationContext ) - { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/groups/(?[^/]+)/members$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/groups/{group-id}/members/$ref'"); - } - - // replace URI parameters with values from identity - var groupId = _match.Groups["group-id"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/groups/" - + groupId - + "/members/$ref" - - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://graph.microsoft.com/beta{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.GroupsCreateGraphRefMembers_Call(request,onNoContent,onDefault,eventListener,sender); - } - } - - /// Actual wire call for method. /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -2486,7 +2539,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GroupsCreateGraphRefMembers_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ApplicationsCreateFederatedIdentityCredentials_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2502,10 +2555,10 @@ public partial class MSGraph switch ( _response.StatusCode ) { - case global::System.Net.HttpStatusCode.NoContent: + case global::System.Net.HttpStatusCode.Created: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -2527,47 +2580,48 @@ public partial class MSGraph } /// - /// 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. /// - /// key: id of group - /// New navigation property ref value + /// key: id of application + /// New navigation property /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GroupsCreateGraphRefMembers_Validate(string groupId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.IDictionaryOfany body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ApplicationsCreateFederatedIdentityCredentials_Validate(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertNotNull(nameof(applicationId),applicationId); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Create new navigation property ref to owners for groups - /// The unique identifier of group - /// New navigation property ref value + /// Delete navigation property federatedIdentityCredentials for applications + /// key: id of application + /// key: id of federatedIdentityCredential + /// ETag /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GroupsCreateOwnersGraphBPreRef(string groupId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IReferenceCreate body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ApplicationsDeleteFederatedIdentityCredentials(string applicationId, string federatedIdentityCredentialId, string ifMatch, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/groups/" - + global::System.Uri.EscapeDataString(groupId) - + "/owners/$ref" + "/applications/" + + global::System.Uri.EscapeDataString(applicationId) + + "/federatedIdentityCredentials/" + + global::System.Uri.EscapeDataString(federatedIdentityCredentialId) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2575,51 +2629,54 @@ public partial class MSGraph // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.GroupsCreateOwnersGraphBPreRef_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ApplicationsDeleteFederatedIdentityCredentials_Call (request, onNoContent,onDefault,eventListener,sender); } } - /// Create new navigation property ref to owners for groups + /// Delete navigation property federatedIdentityCredentials for applications /// - /// New navigation property ref value + /// ETag /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GroupsCreateOwnersGraphBPreRefViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IReferenceCreate body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ApplicationsDeleteFederatedIdentityCredentialsViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/groups/(?[^/]+)/owners$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/applications/(?[^/]+)/federatedIdentityCredentials/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/groups/{group-id}/owners/$ref'"); + throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}/federatedIdentityCredentials/{federatedIdentityCredential-id}'"); } // replace URI parameters with values from identity - var groupId = _match.Groups["group-id"].Value; + var applicationId = _match.Groups["application-id"].Value; + var federatedIdentityCredentialId = _match.Groups["federatedIdentityCredential-id"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/groups/" - + groupId - + "/owners/$ref" + "/applications/" + + applicationId + + "/federatedIdentityCredentials/" + + federatedIdentityCredentialId ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2627,20 +2684,24 @@ public partial class MSGraph // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.GroupsCreateOwnersGraphBPreRef_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ApplicationsDeleteFederatedIdentityCredentials_Call (request, onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// + /// Actual wire call for method. + /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled @@ -2650,7 +2711,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GroupsCreateOwnersGraphBPreRef_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ApplicationsDeleteFederatedIdentityCredentials_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2691,31 +2752,32 @@ public partial class MSGraph } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. /// - /// The unique identifier of group - /// New navigation property ref value + /// key: id of application + /// key: id of federatedIdentityCredential + /// ETag /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GroupsCreateOwnersGraphBPreRef_Validate(string groupId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IReferenceCreate body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ApplicationsDeleteFederatedIdentityCredentials_Validate(string applicationId, string federatedIdentityCredentialId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(groupId),groupId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertNotNull(nameof(applicationId),applicationId); + await eventListener.AssertNotNull(nameof(federatedIdentityCredentialId),federatedIdentityCredentialId); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); } } - /// Delete ref of navigation property owners for groups - /// The unique identifier of group - /// The unique identifier of directoryObject - /// ETag - /// Delete Uri - /// a delegate that is called when the remote service returns 204 (NoContent). + /// Get federatedIdentityCredentials from applications + /// key: id of application + /// key: id of federatedIdentityCredential + /// Select properties to be returned + /// Expand related entities + /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -2723,46 +2785,41 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GroupsDeleteOwnersGraphBPreRef(string groupId, string directoryObjectId, string ifMatch, string Id, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ApplicationsGetFederatedIdentityCredentials(string applicationId, string federatedIdentityCredentialId, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/groups/" - + global::System.Uri.EscapeDataString(groupId) - + "/owners/" - + global::System.Uri.EscapeDataString(directoryObjectId) - + "/$ref" + "/applications/" + + global::System.Uri.EscapeDataString(applicationId) + + "/federatedIdentityCredentials/" + + global::System.Uri.EscapeDataString(federatedIdentityCredentialId) + "?" - + (string.IsNullOrEmpty(Id) ? global::System.String.Empty : "@id=" + global::System.Uri.EscapeDataString(Id)) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.GroupsDeleteOwnersGraphBPreRef_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ApplicationsGetFederatedIdentityCredentials_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete ref of navigation property owners for groups + /// Get federatedIdentityCredentials from applications /// - /// ETag - /// Delete Uri - /// a delegate that is called when the remote service returns 204 (NoContent). + /// Select properties to be returned + /// Expand related entities + /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -2770,224 +2827,206 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GroupsDeleteOwnersGraphBPreRefViaIdentity(global::System.String viaIdentity, string ifMatch, string Id, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ApplicationsGetFederatedIdentityCredentialsViaIdentity(global::System.String viaIdentity, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/groups/(?[^/]+)/owners/(?[^/]+)/$ref$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/applications/(?[^/]+)/federatedIdentityCredentials/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/groups/{group-id}/owners/{directoryObject-id}/$ref'"); + throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}/federatedIdentityCredentials/{federatedIdentityCredential-id}'"); } // replace URI parameters with values from identity - var groupId = _match.Groups["group-id"].Value; - var directoryObjectId = _match.Groups["directoryObject-id"].Value; + var applicationId = _match.Groups["application-id"].Value; + var federatedIdentityCredentialId = _match.Groups["federatedIdentityCredential-id"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/groups/" - + groupId - + "/owners/" - + directoryObjectId - + "/$ref" + "/applications/" + + applicationId + + "/federatedIdentityCredentials/" + + federatedIdentityCredentialId + "?" - + (string.IsNullOrEmpty(Id) ? global::System.String.Empty : "@id=" + global::System.Uri.EscapeDataString(Id)) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.GroupsDeleteOwnersGraphBPreRef_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ApplicationsGetFederatedIdentityCredentials_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 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Get federatedIdentityCredentials from applications + /// + /// Select properties to be returned + /// Expand related entities /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 GroupsDeleteOwnersGraphBPreRef_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ApplicationsGetFederatedIdentityCredentialsViaIdentityWithResult(global::System.String viaIdentity, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); 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.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/applications/(?[^/]+)/federatedIdentityCredentials/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}/federatedIdentityCredentials/{federatedIdentityCredential-id}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// - /// The unique identifier of group - /// The unique identifier of directoryObject - /// ETag - /// Delete Uri - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task GroupsDeleteOwnersGraphBPreRef_Validate(string groupId, string directoryObjectId, string ifMatch, string Id, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(groupId),groupId); - await eventListener.AssertNotNull(nameof(directoryObjectId),directoryObjectId); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(Id),Id); + // replace URI parameters with values from identity + var applicationId = _match.Groups["application-id"].Value; + var federatedIdentityCredentialId = _match.Groups["federatedIdentityCredential-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/applications/" + + applicationId + + "/federatedIdentityCredentials/" + + federatedIdentityCredentialId + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ApplicationsGetFederatedIdentityCredentialsWithResult_Call (request, eventListener,sender); } } - /// - /// Users, contacts, and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported - /// for security groups and mail-enabled security groups), DELETE (supported only for security groups) Read-only. Nullable. - /// Supports $expand. - /// - /// key: id of group - /// key: id of member - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Get federatedIdentityCredentials from applications + /// key: id of application + /// key: id of federatedIdentityCredential + /// Select properties to be returned + /// Expand related entities /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 GroupsDeleteRefMembers(string groupId, string memberId, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ApplicationsGetFederatedIdentityCredentialsWithResult(string applicationId, string federatedIdentityCredentialId, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/groups/" - + global::System.Uri.EscapeDataString(groupId) - + "/members/" - + global::System.Uri.EscapeDataString(memberId) - + "/$ref" - + "/applications/" + + global::System.Uri.EscapeDataString(applicationId) + + "/federatedIdentityCredentials/" + + global::System.Uri.EscapeDataString(federatedIdentityCredentialId) + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object - var _url = new global::System.Uri($"https://graph.microsoft.com/beta{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.GroupsDeleteRefMembers_Call(request,onNoContent,onDefault,eventListener,sender); + return await this.ApplicationsGetFederatedIdentityCredentialsWithResult_Call (request, eventListener,sender); } } /// - /// Users, contacts, and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported - /// for security groups and mail-enabled security groups), DELETE (supported only for security groups) Read-only. Nullable. - /// Supports $expand. + /// Actual wire call for method. /// - /// - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 GroupsDeleteRefMembersViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ApplicationsGetFederatedIdentityCredentialsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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("^/groups/(?[^/]+)/members/(?[^/]+)/$ref$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 '/groups/{group-id}/members/{member-id}/$ref'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var groupId = _match.Groups["group-id"].Value; - var memberId = _match.Groups["member-id"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/groups/" - + groupId - + "/members/" - + memberId - + "/$ref" - - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://graph.microsoft.com/beta{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.GroupsDeleteRefMembers_Call(request,onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// + /// Actual wire call for method. + /// /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -2995,7 +3034,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GroupsDeleteRefMembers_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ApplicationsGetFederatedIdentityCredentials_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3011,10 +3050,10 @@ public partial class MSGraph switch ( _response.StatusCode ) { - case global::System.Net.HttpStatusCode.NoContent: + case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -3036,66 +3075,3089 @@ public partial class MSGraph } /// - /// 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. /// - /// key: id of group - /// key: id of member + /// key: id of application + /// key: id of federatedIdentityCredential + /// Select properties to be returned + /// Expand related entities /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GroupsDeleteRefMembers_Validate(string groupId, string memberId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ApplicationsGetFederatedIdentityCredentials_Validate(string applicationId, string federatedIdentityCredentialId, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(groupId),groupId); - await eventListener.AssertNotNull(nameof(memberId),memberId); + await eventListener.AssertNotNull(nameof(applicationId),applicationId); + await eventListener.AssertNotNull(nameof(federatedIdentityCredentialId),federatedIdentityCredentialId); } } - /// Add new entity to groups - /// New entity - /// a delegate that is called when the remote service returns 201 (Created). + /// Get federatedIdentityCredentials from applications + /// key: id of application + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GroupsGroupCreateGroup(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ApplicationsListFederatedIdentityCredentials(string applicationId, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/groups" - - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - + "/applications/" + + global::System.Uri.EscapeDataString(applicationId) + + "/federatedIdentityCredentials" + + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApplicationsListFederatedIdentityCredentials_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get federatedIdentityCredentials from applications + /// + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApplicationsListFederatedIdentityCredentialsViaIdentity(global::System.String viaIdentity, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/applications/(?[^/]+)/federatedIdentityCredentials$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}/federatedIdentityCredentials'"); + } + + // replace URI parameters with values from identity + var applicationId = _match.Groups["application-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/applications/" + + applicationId + + "/federatedIdentityCredentials" + + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApplicationsListFederatedIdentityCredentials_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get federatedIdentityCredentials from applications + /// + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApplicationsListFederatedIdentityCredentialsViaIdentityWithResult(global::System.String viaIdentity, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/applications/(?[^/]+)/federatedIdentityCredentials$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}/federatedIdentityCredentials'"); + } + + // replace URI parameters with values from identity + var applicationId = _match.Groups["application-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/applications/" + + applicationId + + "/federatedIdentityCredentials" + + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ApplicationsListFederatedIdentityCredentialsWithResult_Call (request, eventListener,sender); + } + } + + /// Get federatedIdentityCredentials from applications + /// key: id of application + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApplicationsListFederatedIdentityCredentialsWithResult(string applicationId, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/applications/" + + global::System.Uri.EscapeDataString(applicationId) + + "/federatedIdentityCredentials" + + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ApplicationsListFederatedIdentityCredentialsWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApplicationsListFederatedIdentityCredentialsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredentialCollectionResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApplicationsListFederatedIdentityCredentials_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredentialCollectionResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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. + /// + /// key: id of application + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApplicationsListFederatedIdentityCredentials_Validate(string applicationId, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(applicationId),applicationId); + await eventListener.AssertNotNull(nameof(Search),Search); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// Invoke action removeKey + /// key: id of application + /// Action parameters + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApplicationsRemoveKey(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsHxlydaApplicationsApplicationIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/applications/" + + global::System.Uri.EscapeDataString(applicationId) + + "/microsoft.graph.removeKey" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApplicationsRemoveKey_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// Invoke action removeKey + /// + /// Action parameters + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApplicationsRemoveKeyViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsHxlydaApplicationsApplicationIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/applications/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}'"); + } + + // replace URI parameters with values from identity + var applicationId = _match.Groups["application-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/applications/" + + applicationId + + "/microsoft.graph.removeKey" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApplicationsRemoveKey_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// Invoke action removeKey + /// key: id of application + /// Json string supplied to the ApplicationsRemoveKey operation + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApplicationsRemoveKeyViaJsonString(string applicationId, global::System.String jsonString, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/applications/" + + global::System.Uri.EscapeDataString(applicationId) + + "/microsoft.graph.removeKey" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApplicationsRemoveKey_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApplicationsRemoveKey_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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. + /// + /// key: id of application + /// Action parameters + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApplicationsRemoveKey_Validate(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsHxlydaApplicationsApplicationIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(applicationId),applicationId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Invoke action removePassword + /// key: id of application + /// Action parameters + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApplicationsRemovePassword(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsHv033BApplicationsApplicationIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/applications/" + + global::System.Uri.EscapeDataString(applicationId) + + "/microsoft.graph.removePassword" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApplicationsRemovePassword_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// Invoke action removePassword + /// + /// Action parameters + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApplicationsRemovePasswordViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsHv033BApplicationsApplicationIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/applications/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}'"); + } + + // replace URI parameters with values from identity + var applicationId = _match.Groups["application-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/applications/" + + applicationId + + "/microsoft.graph.removePassword" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApplicationsRemovePassword_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// Invoke action removePassword + /// key: id of application + /// Json string supplied to the ApplicationsRemovePassword operation + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApplicationsRemovePasswordViaJsonString(string applicationId, global::System.String jsonString, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/applications/" + + global::System.Uri.EscapeDataString(applicationId) + + "/microsoft.graph.removePassword" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApplicationsRemovePassword_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApplicationsRemovePassword_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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. + /// + /// key: id of application + /// Action parameters + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApplicationsRemovePassword_Validate(string applicationId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsHv033BApplicationsApplicationIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(applicationId),applicationId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// update the navigation property federatedIdentityCredentials in applications + /// key: id of application + /// key: id of federatedIdentityCredential + /// New navigation property values + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApplicationsUpdateFederatedIdentityCredentials(string applicationId, string federatedIdentityCredentialId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/applications/" + + global::System.Uri.EscapeDataString(applicationId) + + "/federatedIdentityCredentials/" + + global::System.Uri.EscapeDataString(federatedIdentityCredentialId) + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApplicationsUpdateFederatedIdentityCredentials_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// update the navigation property federatedIdentityCredentials in applications + /// + /// New navigation property values + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApplicationsUpdateFederatedIdentityCredentialsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/applications/(?[^/]+)/federatedIdentityCredentials/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/applications/{application-id}/federatedIdentityCredentials/{federatedIdentityCredential-id}'"); + } + + // replace URI parameters with values from identity + var applicationId = _match.Groups["application-id"].Value; + var federatedIdentityCredentialId = _match.Groups["federatedIdentityCredential-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/applications/" + + applicationId + + "/federatedIdentityCredentials/" + + federatedIdentityCredentialId + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApplicationsUpdateFederatedIdentityCredentials_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// update the navigation property federatedIdentityCredentials in applications + /// key: id of application + /// key: id of federatedIdentityCredential + /// Json string supplied to the ApplicationsUpdateFederatedIdentityCredentials operation + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ApplicationsUpdateFederatedIdentityCredentialsViaJsonString(string applicationId, string federatedIdentityCredentialId, global::System.String jsonString, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/applications/" + + global::System.Uri.EscapeDataString(applicationId) + + "/federatedIdentityCredentials/" + + global::System.Uri.EscapeDataString(federatedIdentityCredentialId) + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ApplicationsUpdateFederatedIdentityCredentials_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApplicationsUpdateFederatedIdentityCredentials_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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. + /// + /// key: id of application + /// key: id of federatedIdentityCredential + /// New navigation property values + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ApplicationsUpdateFederatedIdentityCredentials_Validate(string applicationId, string federatedIdentityCredentialId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(applicationId),applicationId); + await eventListener.AssertNotNull(nameof(federatedIdentityCredentialId),federatedIdentityCredentialId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// UMembers of this group, who can be users, devices, other groups, or service principals. Supports the List members, Add + /// member, and Remove member operations. Nullable. Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=members($select=id,userPrincipalName,displayName). + /// + /// key: id of group + /// New navigation property ref value + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsCreateGraphRefMembers(string groupId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.IDictionaryOfany body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "/members/$ref" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/beta{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupsCreateGraphRefMembers_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// UMembers of this group, who can be users, devices, other groups, or service principals. Supports the List members, Add + /// member, and Remove member operations. Nullable. Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=members($select=id,userPrincipalName,displayName). + /// + /// + /// New navigation property ref value + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsCreateGraphRefMembersViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.IDictionaryOfany body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/groups/(?[^/]+)/members$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/groups/{group-id}/members'"); + } + + // replace URI parameters with values from identity + var groupId = _match.Groups["group-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups/" + + groupId + + "/members/$ref" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/beta{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupsCreateGraphRefMembers_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// UMembers of this group, who can be users, devices, other groups, or service principals. Supports the List members, Add + /// member, and Remove member operations. Nullable. Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=members($select=id,userPrincipalName,displayName). + /// + /// key: id of group + /// Json string supplied to the GroupsCreateGraphRefMembers operation + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsCreateGraphRefMembersViaJsonString(string groupId, global::System.String jsonString, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "/members/$ref" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/beta{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupsCreateGraphRefMembers_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupsCreateGraphRefMembers_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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. + /// + /// key: id of group + /// New navigation property ref value + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupsCreateGraphRefMembers_Validate(string groupId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.IDictionaryOfany body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// create new navigation property ref to owners for groups + /// The unique identifier of group + /// New navigation property ref value + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsCreateOwnersGraphBPreRef(string groupId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IReferenceCreate body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "/owners/$ref" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupsCreateOwnersGraphBPreRef_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// create new navigation property ref to owners for groups + /// + /// New navigation property ref value + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsCreateOwnersGraphBPreRefViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IReferenceCreate body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/groups/(?[^/]+)/owners$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/groups/{group-id}/owners'"); + } + + // replace URI parameters with values from identity + var groupId = _match.Groups["group-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups/" + + groupId + + "/owners/$ref" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupsCreateOwnersGraphBPreRef_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// create new navigation property ref to owners for groups + /// The unique identifier of group + /// Json string supplied to the GroupsCreateOwnersGraphBPreRef operation + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsCreateOwnersGraphBPreRefViaJsonString(string groupId, global::System.String jsonString, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "/owners/$ref" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupsCreateOwnersGraphBPreRef_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupsCreateOwnersGraphBPreRef_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The unique identifier of group + /// New navigation property ref value + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupsCreateOwnersGraphBPreRef_Validate(string groupId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IReferenceCreate body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete ref of navigation property owners for groups + /// The unique identifier of group + /// The unique identifier of directoryObject + /// ETag + /// Delete Uri + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsDeleteOwnersGraphBPreRef(string groupId, string directoryObjectId, string ifMatch, string Id, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "/owners/" + + global::System.Uri.EscapeDataString(directoryObjectId) + + "/$ref" + + "?" + + (string.IsNullOrEmpty(Id) ? global::System.String.Empty : "@id=" + global::System.Uri.EscapeDataString(Id)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupsDeleteOwnersGraphBPreRef_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete ref of navigation property owners for groups + /// + /// ETag + /// Delete Uri + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsDeleteOwnersGraphBPreRefViaIdentity(global::System.String viaIdentity, string ifMatch, string Id, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/groups/(?[^/]+)/owners/(?[^/]+)/$ref$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/groups/{group-id}/owners/{directoryObject-id}/$ref'"); + } + + // replace URI parameters with values from identity + var groupId = _match.Groups["group-id"].Value; + var directoryObjectId = _match.Groups["directoryObject-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups/" + + groupId + + "/owners/" + + directoryObjectId + + "/$ref" + + "?" + + (string.IsNullOrEmpty(Id) ? global::System.String.Empty : "@id=" + global::System.Uri.EscapeDataString(Id)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupsDeleteOwnersGraphBPreRef_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupsDeleteOwnersGraphBPreRef_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The unique identifier of group + /// The unique identifier of directoryObject + /// ETag + /// Delete Uri + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupsDeleteOwnersGraphBPreRef_Validate(string groupId, string directoryObjectId, string ifMatch, string Id, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertNotNull(nameof(directoryObjectId),directoryObjectId); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(Id),Id); + } + } + + /// + /// Users, contacts, and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported + /// for security groups and mail-enabled security groups), DELETE (supported only for security groups) Read-only. Nullable. + /// Supports $expand. + /// + /// key: id of group + /// key: id of member + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsDeleteRefMembers(string groupId, string memberId, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "/members/" + + global::System.Uri.EscapeDataString(memberId) + + "/$ref" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/beta{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupsDeleteRefMembers_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Users, contacts, and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported + /// for security groups and mail-enabled security groups), DELETE (supported only for security groups) Read-only. Nullable. + /// Supports $expand. + /// + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsDeleteRefMembersViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/groups/(?[^/]+)/members/(?[^/]+)/$ref$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/groups/{group-id}/members/{member-id}/$ref'"); + } + + // replace URI parameters with values from identity + var groupId = _match.Groups["group-id"].Value; + var memberId = _match.Groups["member-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups/" + + groupId + + "/members/" + + memberId + + "/$ref" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/beta{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupsDeleteRefMembers_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupsDeleteRefMembers_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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. + /// + /// key: id of group + /// key: id of member + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupsDeleteRefMembers_Validate(string groupId, string memberId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertNotNull(nameof(memberId),memberId); + } + } + + /// Add new entity to groups + /// New entity + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsGroupCreateGroup(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupsGroupCreateGroup_Call (request, onCreated,onDefault,eventListener,sender); + } + } + + /// Add new entity to groups + /// Json string supplied to the GroupsGroupCreateGroup operation + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsGroupCreateGroupViaJsonString(global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupsGroupCreateGroup_Call (request, onCreated,onDefault,eventListener,sender); + } + } + + /// Add new entity to groups + /// Json string supplied to the GroupsGroupCreateGroup operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsGroupCreateGroupViaJsonStringWithResult(global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GroupsGroupCreateGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Add new entity to groups + /// New entity + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsGroupCreateGroupWithResult(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GroupsGroupCreateGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupsGroupCreateGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphGroup.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupsGroupCreateGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphGroup.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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. + /// + /// New entity + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupsGroupCreateGroup_Validate(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. + /// + /// key: id of group + /// ETag + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsGroupDeleteGroup(string groupId, string ifMatch, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupsGroupDeleteGroup_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. + /// + /// + /// ETag + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsGroupDeleteGroupViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/groups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/groups/{group-id}'"); + } + + // replace URI parameters with values from identity + var groupId = _match.Groups["group-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups/" + + groupId + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupsGroupDeleteGroup_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupsGroupDeleteGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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. + /// + /// key: id of group + /// ETag + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupsGroupDeleteGroup_Validate(string groupId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + } + } + + /// + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. + /// + /// key: id of group + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Select properties to be returned + /// Expand related entities + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsGroupGetGroup(string groupId, string consistencyLevel, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != consistencyLevel) + { + request.Headers.Add("ConsistencyLevel",consistencyLevel); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupsGroupGetGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. + /// + /// + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Select properties to be returned + /// Expand related entities + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsGroupGetGroupViaIdentity(global::System.String viaIdentity, string consistencyLevel, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/groups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/groups/{group-id}'"); + } + + // replace URI parameters with values from identity + var groupId = _match.Groups["group-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups/" + + groupId + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != consistencyLevel) + { + request.Headers.Add("ConsistencyLevel",consistencyLevel); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupsGroupGetGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. + /// + /// + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsGroupGetGroupViaIdentityWithResult(global::System.String viaIdentity, string consistencyLevel, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/groups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/groups/{group-id}'"); + } + + // replace URI parameters with values from identity + var groupId = _match.Groups["group-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups/" + + groupId + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != consistencyLevel) + { + request.Headers.Add("ConsistencyLevel",consistencyLevel); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GroupsGroupGetGroupWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. + /// + /// key: id of group + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsGroupGetGroupWithResult(string groupId, string consistencyLevel, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != consistencyLevel) + { + request.Headers.Add("ConsistencyLevel",consistencyLevel); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GroupsGroupGetGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupsGroupGetGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphGroup.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupsGroupGetGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphGroup.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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. + /// + /// key: id of group + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupsGroupGetGroup_Validate(string groupId, string consistencyLevel, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(groupId),groupId); + await eventListener.AssertNotNull(nameof(consistencyLevel),consistencyLevel); + } + } + + /// Get entities from groups + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsGroupListGroup(string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups" + + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != consistencyLevel) + { + request.Headers.Add("ConsistencyLevel",consistencyLevel); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupsGroupListGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get entities from groups + /// + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsGroupListGroupViaIdentity(global::System.String viaIdentity, string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/groups$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/groups'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups" + + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != consistencyLevel) + { + request.Headers.Add("ConsistencyLevel",consistencyLevel); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupsGroupListGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get entities from groups + /// + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsGroupListGroupViaIdentityWithResult(global::System.String viaIdentity, string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/groups$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/groups'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups" + + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != consistencyLevel) + { + request.Headers.Add("ConsistencyLevel",consistencyLevel); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GroupsGroupListGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Get entities from groups + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsGroupListGroupWithResult(string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups" + + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != consistencyLevel) + { + request.Headers.Add("ConsistencyLevel",consistencyLevel); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GroupsGroupListGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupsGroupListGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfGroup.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupsGroupListGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfGroup.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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. + /// + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupsGroupListGroup_Validate(string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(consistencyLevel),consistencyLevel); + await eventListener.AssertNotNull(nameof(Search),Search); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// update entity in groups + /// key: id of group + /// New property values + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsGroupUpdateGroup(string groupId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupsGroupUpdateGroup_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// update entity in groups + /// + /// New property values + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsGroupUpdateGroupViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/groups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/groups/{group-id}'"); + } + + // replace URI parameters with values from identity + var groupId = _match.Groups["group-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups/" + + groupId + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupsGroupUpdateGroup_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// update entity in groups + /// key: id of group + /// Json string supplied to the GroupsGroupUpdateGroup operation + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsGroupUpdateGroupViaJsonString(string groupId, global::System.String jsonString, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.GroupsGroupCreateGroup_Call(request,onCreated,onDefault,eventListener,sender); + await this.GroupsGroupUpdateGroup_Call (request, onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -3103,7 +6165,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GroupsGroupCreateGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task GroupsGroupUpdateGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3119,10 +6181,10 @@ public partial class MSGraph switch ( _response.StatusCode ) { - case global::System.Net.HttpStatusCode.Created: + case global::System.Net.HttpStatusCode.NoContent: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphGroup.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onNoContent(_response); break; } default: @@ -3144,30 +6206,37 @@ public partial class MSGraph } /// - /// 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. /// - /// New entity + /// key: id of group + /// New property values /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GroupsGroupCreateGroup_Validate(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task GroupsGroupUpdateGroup_Validate(string groupId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(groupId),groupId); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } /// - /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity - /// types. + /// UMembers of this group, who can be users, devices, other groups, or service principals. Supports the List members, Add + /// member, and Remove member operations. Nullable. Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=members($select=id,userPrincipalName,displayName). /// /// key: id of group - /// ETag - /// a delegate that is called when the remote service returns 204 (NoContent). + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -3175,7 +6244,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GroupsGroupDeleteGroup(string groupId, string ifMatch, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task GroupsListMembers(string groupId, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) @@ -3184,35 +6253,46 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/groups/" + global::System.Uri.EscapeDataString(groupId) - + + "/members" + + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object - var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); + var _url = new global::System.Uri($"https://graph.microsoft.com/beta{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.GroupsGroupDeleteGroup_Call(request,onNoContent,onDefault,eventListener,sender); + await this.GroupsListMembers_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity - /// types. + /// UMembers of this group, who can be users, devices, other groups, or service principals. Supports the List members, Add + /// member, and Remove member operations. Nullable. Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=members($select=id,userPrincipalName,displayName). /// /// - /// ETag - /// a delegate that is called when the remote service returns 204 (NoContent). + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -3220,17 +6300,17 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GroupsGroupDeleteGroupViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task GroupsListMembersViaIdentity(global::System.String viaIdentity, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/groups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/groups/(?[^/]+)/members$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/groups/{group-id}'"); + throw new global::System.Exception("Invalid identity for URI '/groups/{group-id}/members'"); } // replace URI parameters with values from identity @@ -3239,31 +6319,215 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/groups/" + groupId - + + "/members" + + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object - var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Delete, _url); + var _url = new global::System.Uri($"https://graph.microsoft.com/beta{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.GroupsListMembers_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// UMembers of this group, who can be users, devices, other groups, or service principals. Supports the List members, Add + /// member, and Remove member operations. Nullable. Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=members($select=id,userPrincipalName,displayName). + /// + /// + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsListMembersViaIdentityWithResult(global::System.String viaIdentity, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/groups/(?[^/]+)/members$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - request.Headers.Add("If-Match",ifMatch); + throw new global::System.Exception("Invalid identity for URI '/groups/{group-id}/members'"); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // replace URI parameters with values from identity + var groupId = _match.Groups["group-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups/" + + groupId + + "/members" + + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/beta{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GroupsListMembersWithResult_Call (request, eventListener,sender); + } + } + + /// + /// UMembers of this group, who can be users, devices, other groups, or service principals. Supports the List members, Add + /// member, and Remove member operations. Nullable. Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=members($select=id,userPrincipalName,displayName). + /// + /// key: id of group + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task GroupsListMembersWithResult(string groupId, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "/members" + + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/beta{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.GroupsGroupDeleteGroup_Call(request,onNoContent,onDefault,eventListener,sender); + return await this.GroupsListMembersWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 204 (NoContent). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupsListMembersWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.CollectionOfDirectoryObjectAutoGenerated.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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. @@ -3271,7 +6535,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GroupsGroupDeleteGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task GroupsListMembers_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3287,10 +6551,10 @@ public partial class MSGraph switch ( _response.StatusCode ) { - case global::System.Net.HttpStatusCode.NoContent: + case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.CollectionOfDirectoryObjectAutoGenerated.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -3312,30 +6576,41 @@ public partial class MSGraph } /// - /// 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. /// /// key: id of group - /// ETag + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GroupsGroupDeleteGroup_Validate(string groupId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task GroupsListMembers_Validate(string groupId, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(groupId),groupId); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(Search),Search); + await eventListener.AssertNotNull(nameof(Filter),Filter); } } /// - /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity - /// types. + /// The owners of the group. Limited to 100 owners. Nullable. If this property is not specified when creating a Microsoft + /// 365 group, the calling user is automatically assigned as the group owner. Supports $filter (/$count eq 0, /$count ne 0, + /// /$count eq 1, /$count ne 1). Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=owners($select=id,userPrincipalName,displayName). /// - /// key: id of group - /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// The unique identifier of group + /// Indicates the requested consistency level. Documentation URL: https://docs.microsoft.com/graph/aad-advanced-queries + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values /// Select properties to be returned /// Expand related entities /// a delegate that is called when the remote service returns 200 (OK). @@ -3346,7 +6621,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GroupsGroupGetGroup(string groupId, string consistencyLevel, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task GroupsListOwners(string groupId, string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) @@ -3355,10 +6630,19 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/groups/" + global::System.Uri.EscapeDataString(groupId) + + "/owners" + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -3376,16 +6660,21 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.GroupsGroupGetGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.GroupsListOwners_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity - /// types. + /// The owners of the group. Limited to 100 owners. Nullable. If this property is not specified when creating a Microsoft + /// 365 group, the calling user is automatically assigned as the group owner. Supports $filter (/$count eq 0, /$count ne 0, + /// /$count eq 1, /$count ne 1). Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=owners($select=id,userPrincipalName,displayName). /// /// - /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Indicates the requested consistency level. Documentation URL: https://docs.microsoft.com/graph/aad-advanced-queries + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values /// Select properties to be returned /// Expand related entities /// a delegate that is called when the remote service returns 200 (OK). @@ -3396,17 +6685,17 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GroupsGroupGetGroupViaIdentity(global::System.String viaIdentity, string consistencyLevel, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task GroupsListOwnersViaIdentity(global::System.String viaIdentity, string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/groups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/groups/(?[^/]+)/owners$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/groups/{group-id}'"); + throw new global::System.Exception("Invalid identity for URI '/groups/{group-id}/owners'"); } // replace URI parameters with values from identity @@ -3415,10 +6704,19 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/groups/" + groupId + + "/owners" + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -3436,105 +6734,49 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.GroupsGroupGetGroup_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task GroupsGroupGetGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphGroup.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } + await this.GroupsListOwners_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// The owners of the group. Limited to 100 owners. Nullable. If this property is not specified when creating a Microsoft + /// 365 group, the calling user is automatically assigned as the group owner. Supports $filter (/$count eq 0, /$count ne 0, + /// /$count eq 1, /$count ne 1). Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=owners($select=id,userPrincipalName,displayName). /// - /// key: id of group - /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ - /// Select properties to be returned - /// Expand related entities - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task GroupsGroupGetGroup_Validate(string groupId, string consistencyLevel, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(groupId),groupId); - await eventListener.AssertNotNull(nameof(consistencyLevel),consistencyLevel); - } - } - - /// Get entities from groups - /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// + /// Indicates the requested consistency level. Documentation URL: https://docs.microsoft.com/graph/aad-advanced-queries /// Search items by search phrases /// Filter items by property values /// Include count of items /// Order items by property values /// Select properties to be returned /// Expand related entities - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 GroupsGroupListGroup(string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task GroupsListOwnersViaIdentityWithResult(global::System.String viaIdentity, string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/groups/(?[^/]+)/owners$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/groups/{group-id}/owners'"); + } + + // replace URI parameters with values from identity + var groupId = _match.Groups["group-id"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/groups" + "/groups/" + + groupId + + "/owners" + "?" + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + "&" @@ -3542,19 +6784,19 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != consistencyLevel) @@ -3562,46 +6804,41 @@ public partial class MSGraph request.Headers.Add("ConsistencyLevel",consistencyLevel); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.GroupsGroupListGroup_Call(request,onOk,onDefault,eventListener,sender); + return await this.GroupsListOwnersWithResult_Call (request, eventListener,sender); } } - /// Get entities from groups - /// - /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// + /// The owners of the group. Limited to 100 owners. Nullable. If this property is not specified when creating a Microsoft + /// 365 group, the calling user is automatically assigned as the group owner. Supports $filter (/$count eq 0, /$count ne 0, + /// /$count eq 1, /$count ne 1). Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=owners($select=id,userPrincipalName,displayName). + /// + /// The unique identifier of group + /// Indicates the requested consistency level. Documentation URL: https://docs.microsoft.com/graph/aad-advanced-queries /// Search items by search phrases /// Filter items by property values /// Include count of items /// Order items by property values /// Select properties to be returned /// Expand related entities - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 GroupsGroupListGroupViaIdentity(global::System.String viaIdentity, string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task GroupsListOwnersWithResult(string groupId, string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/groups$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/groups'"); - } - - // replace URI parameters with values from identity // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/groups" + "/groups/" + + global::System.Uri.EscapeDataString(groupId) + + "/owners" + "?" + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + "&" @@ -3609,19 +6846,19 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != consistencyLevel) @@ -3629,13 +6866,73 @@ public partial class MSGraph request.Headers.Add("ConsistencyLevel",consistencyLevel); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.GroupsGroupListGroup_Call(request,onOk,onDefault,eventListener,sender); + return await this.GroupsListOwnersWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task GroupsListOwnersWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObjectCollectionResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 @@ -3645,7 +6942,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GroupsGroupListGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task GroupsListOwners_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3664,7 +6961,7 @@ public partial class MSGraph case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfGroup.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObjectCollectionResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -3686,10 +6983,11 @@ public partial class MSGraph } /// - /// 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. /// - /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// The unique identifier of group + /// Indicates the requested consistency level. Documentation URL: https://docs.microsoft.com/graph/aad-advanced-queries /// Search items by search phrases /// Filter items by property values /// Include count of items @@ -3700,37 +6998,74 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GroupsGroupListGroup_Validate(string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task GroupsListOwners_Validate(string groupId, string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { + await eventListener.AssertNotNull(nameof(groupId),groupId); await eventListener.AssertNotNull(nameof(consistencyLevel),consistencyLevel); await eventListener.AssertNotNull(nameof(Search),Search); await eventListener.AssertNotNull(nameof(Filter),Filter); } } - /// Update entity in groups - /// key: id of group - /// New property values - /// a delegate that is called when the remote service returns 204 (NoContent). + /// Add new entity to organization + /// New entity + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OrganizationCreateOrganization(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganization body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/organization" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OrganizationCreateOrganization_Call (request, onCreated,onDefault,eventListener,sender); + } + } + + /// Add new entity to organization + /// Json string supplied to the OrganizationCreateOrganization operation + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GroupsGroupUpdateGroup(string groupId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task OrganizationCreateOrganizationViaJsonString(global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/groups/" - + global::System.Uri.EscapeDataString(groupId) + "/organization" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3738,73 +7073,157 @@ public partial class MSGraph // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.GroupsGroupUpdateGroup_Call(request,onNoContent,onDefault,eventListener,sender); + await this.OrganizationCreateOrganization_Call (request, onCreated,onDefault,eventListener,sender); } } - /// Update entity in groups - /// - /// New property values - /// 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). + /// Add new entity to organization + /// Json string supplied to the OrganizationCreateOrganization operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the 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 GroupsGroupUpdateGroupViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup body, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task OrganizationCreateOrganizationViaJsonStringWithResult(global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/organization" - var _match = new global::System.Text.RegularExpressions.Regex("^/groups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/groups/{group-id}'"); - } + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // replace URI parameters with values from identity - var groupId = _match.Groups["group-id"].Value; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OrganizationCreateOrganizationWithResult_Call (request, eventListener,sender); + } + } + + /// Add new entity to organization + /// New entity + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OrganizationCreateOrganizationWithResult(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganization body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/groups/" - + groupId + "/organization" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.GroupsGroupUpdateGroup_Call(request,onNoContent,onDefault,eventListener,sender); + return await this.OrganizationCreateOrganizationWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// + /// Actual wire call for method. + /// /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 204 (NoContent). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OrganizationCreateOrganizationWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganization.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphODataErrorsOdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -3812,7 +7231,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GroupsGroupUpdateGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task OrganizationCreateOrganization_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3828,16 +7247,16 @@ public partial class MSGraph switch ( _response.StatusCode ) { - case global::System.Net.HttpStatusCode.NoContent: + case global::System.Net.HttpStatusCode.Created: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganization.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphODataErrorsOdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3853,30 +7272,24 @@ public partial class MSGraph } /// - /// 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. /// - /// key: id of group - /// New property values + /// New entity /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GroupsGroupUpdateGroup_Validate(string groupId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task OrganizationCreateOrganization_Validate(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganization body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(groupId),groupId); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// - /// UMembers of this group, who can be users, devices, other groups, or service principals. Supports the List members, Add - /// member, and Remove member operations. Nullable. Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=members($select=id,userPrincipalName,displayName). - /// - /// key: id of group + /// Retrieve a list of organization objects. /// Search items by search phrases /// Filter items by property values /// Include count of items @@ -3891,16 +7304,14 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GroupsListMembers(string groupId, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OrganizationListOrganization(string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/groups/" - + global::System.Uri.EscapeDataString(groupId) - + "/members" + "/organization" + "?" + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + "&" @@ -3908,30 +7319,27 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object - var _url = new global::System.Uri($"https://graph.microsoft.com/beta{pathAndQuery}"); + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.GroupsListMembers_Call(request,onOk,onDefault,eventListener,sender); + await this.OrganizationListOrganization_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// UMembers of this group, who can be users, devices, other groups, or service principals. Supports the List members, Add - /// member, and Remove member operations. Nullable. Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=members($select=id,userPrincipalName,displayName). - /// + /// Retrieve a list of organization objects. /// /// Search items by search phrases /// Filter items by property values @@ -3947,26 +7355,129 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GroupsListMembersViaIdentity(global::System.String viaIdentity, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OrganizationListOrganizationViaIdentity(global::System.String viaIdentity, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/groups/(?[^/]+)/members$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/organization$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/groups/{group-id}/members'"); + throw new global::System.Exception("Invalid identity for URI '/organization'"); } // replace URI parameters with values from identity - var groupId = _match.Groups["group-id"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/groups/" - + groupId - + "/members" + "/organization" + + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OrganizationListOrganization_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Retrieve a list of organization objects. + /// + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OrganizationListOrganizationViaIdentityWithResult(global::System.String viaIdentity, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/organization$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/organization'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/organization" + + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OrganizationListOrganizationWithResult_Call (request, eventListener,sender); + } + } + + /// Retrieve a list of organization objects. + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OrganizationListOrganizationWithResult(string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/organization" + "?" + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + "&" @@ -3974,27 +7485,89 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object - var _url = new global::System.Uri($"https://graph.microsoft.com/beta{pathAndQuery}"); + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.GroupsListMembers_Call(request,onOk,onDefault,eventListener,sender); + return await this.OrganizationListOrganizationWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OrganizationListOrganizationWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationCollectionResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphODataErrorsOdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 @@ -4004,7 +7577,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GroupsListMembers_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task OrganizationListOrganization_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -4023,13 +7596,13 @@ public partial class MSGraph case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.CollectionOfDirectoryObjectAutoGenerated.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationCollectionResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphODataErrorsOdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4045,10 +7618,9 @@ public partial class MSGraph } /// - /// 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. /// - /// key: id of group /// Search items by search phrases /// Filter items by property values /// Include count of items @@ -4059,155 +7631,340 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GroupsListMembers_Validate(string groupId, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task OrganizationListOrganization_Validate(string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(groupId),groupId); await eventListener.AssertNotNull(nameof(Search),Search); await eventListener.AssertNotNull(nameof(Filter),Filter); } } - /// - /// The owners of the group. Limited to 100 owners. Nullable. If this property is not specified when creating a Microsoft - /// 365 group, the calling user is automatically assigned as the group owner. Supports $filter (/$count eq 0, /$count ne 0, - /// /$count eq 1, /$count ne 1). Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=owners($select=id,userPrincipalName,displayName). - /// - /// The unique identifier of group - /// Indicates the requested consistency level. Documentation URL: https://docs.microsoft.com/graph/aad-advanced-queries - /// Search items by search phrases - /// Filter items by property values - /// Include count of items - /// Order items by property values - /// Select properties to be returned - /// Expand related entities + /// Invoke action addKey + /// key: id of servicePrincipal + /// Action parameters /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GroupsListOwners(string groupId, string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ServicePrincipalsAddKey(string servicePrincipalId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsN3Fx9GServiceprincipalsServiceprincipalIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/groups/" - + global::System.Uri.EscapeDataString(groupId) - + "/owners" - + "?" - + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) - + "&" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" - + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) - + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) - + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) - + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/microsoft.graph.addKey" + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != consistencyLevel) + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicePrincipalsAddKey_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Invoke action addKey + /// + /// Action parameters + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsAddKeyViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsN3Fx9GServiceprincipalsServiceprincipalIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - request.Headers.Add("ConsistencyLevel",consistencyLevel); + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}'"); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // replace URI parameters with values from identity + var servicePrincipalId = _match.Groups["servicePrincipal-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + servicePrincipalId + + "/microsoft.graph.addKey" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicePrincipalsAddKey_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Invoke action addKey + /// + /// Action parameters + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsAddKeyViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsN3Fx9GServiceprincipalsServiceprincipalIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}'"); + } + + // replace URI parameters with values from identity + var servicePrincipalId = _match.Groups["servicePrincipal-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + servicePrincipalId + + "/microsoft.graph.addKey" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicePrincipalsAddKeyWithResult_Call (request, eventListener,sender); + } + } + + /// Invoke action addKey + /// key: id of servicePrincipal + /// Json string supplied to the ServicePrincipalsAddKey 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.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsAddKeyViaJsonString(string servicePrincipalId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/microsoft.graph.addKey" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicePrincipalsAddKey_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Invoke action addKey + /// key: id of servicePrincipal + /// Json string supplied to the ServicePrincipalsAddKey operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsAddKeyViaJsonStringWithResult(string servicePrincipalId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/microsoft.graph.addKey" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.GroupsListOwners_Call(request,onOk,onDefault,eventListener,sender); + return await this.ServicePrincipalsAddKeyWithResult_Call (request, eventListener,sender); } } - /// - /// The owners of the group. Limited to 100 owners. Nullable. If this property is not specified when creating a Microsoft - /// 365 group, the calling user is automatically assigned as the group owner. Supports $filter (/$count eq 0, /$count ne 0, - /// /$count eq 1, /$count ne 1). Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=owners($select=id,userPrincipalName,displayName). - /// - /// - /// Indicates the requested consistency level. Documentation URL: https://docs.microsoft.com/graph/aad-advanced-queries - /// Search items by search phrases - /// Filter items by property values - /// Include count of items - /// Order items by property values - /// Select properties to be returned - /// Expand related entities - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Invoke action addKey + /// key: id of servicePrincipal + /// Action parameters /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the 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 GroupsListOwnersViaIdentity(global::System.String viaIdentity, string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ServicePrincipalsAddKeyWithResult(string servicePrincipalId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsN3Fx9GServiceprincipalsServiceprincipalIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/groups/(?[^/]+)/owners$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/groups/{group-id}/owners'"); - } - - // replace URI parameters with values from identity - var groupId = _match.Groups["group-id"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/groups/" - + groupId - + "/owners" - + "?" - + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) - + "&" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" - + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) - + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) - + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) - + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/microsoft.graph.addKey" + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // add headers parameters - if (null != consistencyLevel) + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicePrincipalsAddKeyWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicePrincipalsAddKeyWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try { - request.Headers.Add("ConsistencyLevel",consistencyLevel); - } + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.GroupsListOwners_Call(request,onOk,onDefault,eventListener,sender); + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 @@ -4217,7 +7974,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GroupsListOwners_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ServicePrincipalsAddKey_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -4236,7 +7993,7 @@ public partial class MSGraph case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObjectCollectionResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -4258,35 +8015,29 @@ public partial class MSGraph } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// - /// The unique identifier of group - /// Indicates the requested consistency level. Documentation URL: https://docs.microsoft.com/graph/aad-advanced-queries - /// Search items by search phrases - /// Filter items by property values - /// Include count of items - /// Order items by property values - /// Select properties to be returned - /// Expand related entities + /// key: id of servicePrincipal + /// Action parameters /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GroupsListOwners_Validate(string groupId, string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ServicePrincipalsAddKey_Validate(string servicePrincipalId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsN3Fx9GServiceprincipalsServiceprincipalIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(groupId),groupId); - await eventListener.AssertNotNull(nameof(consistencyLevel),consistencyLevel); - await eventListener.AssertNotNull(nameof(Search),Search); - await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(servicePrincipalId),servicePrincipalId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Add new entity to organization - /// New entity - /// a delegate that is called when the remote service returns 201 (Created). + /// Invoke action addPassword + /// key: id of servicePrincipal + /// Action parameters + /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -4295,14 +8046,16 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OrganizationCreateOrganization(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganization body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ServicePrincipalsAddPassword(string servicePrincipalId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsIeboplServiceprincipalsServiceprincipalIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/organization" + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/microsoft.graph.addPassword" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4319,85 +8072,115 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OrganizationCreateOrganization_Call(request,onCreated,onDefault,eventListener,sender); + await this.ServicePrincipalsAddPassword_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 201 (Created). + /// Invoke action addPassword + /// + /// Action parameters + /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task OrganizationCreateOrganization_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ServicePrincipalsAddPasswordViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsIeboplServiceprincipalsServiceprincipalIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganization.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphODataErrorsOdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}'"); } + + // replace URI parameters with values from identity + var servicePrincipalId = _match.Groups["servicePrincipal-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + servicePrincipalId + + "/microsoft.graph.addPassword" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicePrincipalsAddPassword_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// - /// New entity + /// Invoke action addPassword + /// + /// Action parameters /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the 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 OrganizationCreateOrganization_Validate(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganization body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task ServicePrincipalsAddPasswordViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsIeboplServiceprincipalsServiceprincipalIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}'"); + } + + // replace URI parameters with values from identity + var servicePrincipalId = _match.Groups["servicePrincipal-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + servicePrincipalId + + "/microsoft.graph.addPassword" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicePrincipalsAddPasswordWithResult_Call (request, eventListener,sender); } } - - /// Retrieve a list of organization objects. - /// Search items by search phrases - /// Filter items by property values - /// Include count of items - /// Order items by property values - /// Select properties to be returned - /// Expand related entities + + /// Invoke action addPassword + /// key: id of servicePrincipal + /// Json string supplied to the ServicePrincipalsAddPassword 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). @@ -4406,102 +8189,178 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OrganizationListOrganization(string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ServicePrincipalsAddPasswordViaJsonString(string servicePrincipalId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/organization" - + "?" - + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) - + "&" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" - + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) - + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) - + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) - + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/microsoft.graph.addPassword" + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OrganizationListOrganization_Call(request,onOk,onDefault,eventListener,sender); + await this.ServicePrincipalsAddPassword_Call (request, onOk,onDefault,eventListener,sender); } } - /// Retrieve a list of organization objects. - /// - /// Search items by search phrases - /// Filter items by property values - /// Include count of items - /// Order items by property values - /// Select properties to be returned - /// Expand related entities - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Invoke action addPassword + /// key: id of servicePrincipal + /// Json string supplied to the ServicePrincipalsAddPassword operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 OrganizationListOrganizationViaIdentity(global::System.String viaIdentity, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ServicePrincipalsAddPasswordViaJsonStringWithResult(string servicePrincipalId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/microsoft.graph.addPassword" - var _match = new global::System.Text.RegularExpressions.Regex("^/organization$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/organization'"); - } + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // replace URI parameters with values from identity + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicePrincipalsAddPasswordWithResult_Call (request, eventListener,sender); + } + } + + /// Invoke action addPassword + /// key: id of servicePrincipal + /// Action parameters + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsAddPasswordWithResult(string servicePrincipalId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsIeboplServiceprincipalsServiceprincipalIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/organization" - + "?" - + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) - + "&" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" - + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) - + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) - + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) - + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/microsoft.graph.addPassword" + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.OrganizationListOrganization_Call(request,onOk,onDefault,eventListener,sender); + return await this.ServicePrincipalsAddPasswordWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicePrincipalsAddPasswordWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 @@ -4511,7 +8370,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task OrganizationListOrganization_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ServicePrincipalsAddPassword_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -4530,13 +8389,13 @@ public partial class MSGraph case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationCollectionResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphODataErrorsOdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4552,32 +8411,29 @@ public partial class MSGraph } /// - /// Validation method for method. Call this like the actual call, but you will + /// Validation method for method. Call this like the actual call, but you will /// get validation events back. /// - /// Search items by search phrases - /// Filter items by property values - /// Include count of items - /// Order items by property values - /// Select properties to be returned - /// Expand related entities + /// key: id of servicePrincipal + /// Action parameters /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task OrganizationListOrganization_Validate(string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ServicePrincipalsAddPassword_Validate(string servicePrincipalId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsIeboplServiceprincipalsServiceprincipalIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(Search),Search); - await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(servicePrincipalId),servicePrincipalId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Invoke action addKey + /// create new navigation property to appRoleAssignments for servicePrincipals /// key: id of servicePrincipal - /// Action parameters - /// a delegate that is called when the remote service returns 200 (OK). + /// New navigation property + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -4586,7 +8442,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ServicePrincipalsAddKey(string servicePrincipalId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsN3Fx9GServiceprincipalsServiceprincipalIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ServicePrincipalsCreateAppRoleAssignments(string servicePrincipalId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { // Constant Parameters using( NoSynchronizationContext ) @@ -4595,7 +8451,7 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/servicePrincipals/" + global::System.Uri.EscapeDataString(servicePrincipalId) - + "/microsoft.graph.addKey" + + "/appRoleAssignments" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4612,14 +8468,14 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsAddKey_Call(request,onOk,onDefault,eventListener,sender); + await this.ServicePrincipalsCreateAppRoleAssignments_Call (request, onCreated,onDefault,eventListener,sender); } } - /// Invoke action addKey + /// create new navigation property to appRoleAssignments for servicePrincipals /// - /// Action parameters - /// a delegate that is called when the remote service returns 200 (OK). + /// New navigation property + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -4628,7 +8484,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ServicePrincipalsAddKeyViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsN3Fx9GServiceprincipalsServiceprincipalIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ServicePrincipalsCreateAppRoleAssignmentsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { // Constant Parameters using( NoSynchronizationContext ) @@ -4638,7 +8494,7 @@ public partial class MSGraph var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}/microsoft.graph.addKey'"); + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}'"); } // replace URI parameters with values from identity @@ -4647,7 +8503,7 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/servicePrincipals/" + servicePrincipalId - + "/microsoft.graph.addKey" + + "/appRoleAssignments" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4664,93 +8520,72 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsAddKey_Call(request,onOk,onDefault,eventListener,sender); + await this.ServicePrincipalsCreateAppRoleAssignments_Call (request, onCreated,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// create new navigation property to appRoleAssignments for servicePrincipals + /// + /// New navigation property /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the 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 ServicePrincipalsAddKey_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ServicePrincipalsCreateAppRoleAssignmentsViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. - /// - /// key: id of servicePrincipal - /// Action parameters - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task ServicePrincipalsAddKey_Validate(string servicePrincipalId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsN3Fx9GServiceprincipalsServiceprincipalIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(servicePrincipalId),servicePrincipalId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + // replace URI parameters with values from identity + var servicePrincipalId = _match.Groups["servicePrincipal-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + servicePrincipalId + + "/appRoleAssignments" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicePrincipalsCreateAppRoleAssignmentsWithResult_Call (request, eventListener,sender); } } - /// Invoke action addPassword + /// create new navigation property to appRoleAssignments for servicePrincipals /// key: id of servicePrincipal - /// Action parameters - /// a delegate that is called when the remote service returns 200 (OK). + /// Json string supplied to the ServicePrincipalsCreateAppRoleAssignments operation + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ServicePrincipalsAddPassword(string servicePrincipalId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsIeboplServiceprincipalsServiceprincipalIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ServicePrincipalsCreateAppRoleAssignmentsViaJsonString(string servicePrincipalId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) @@ -4759,7 +8594,7 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/servicePrincipals/" + global::System.Uri.EscapeDataString(servicePrincipalId) - + "/microsoft.graph.addPassword" + + "/appRoleAssignments" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4772,69 +8607,160 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsAddPassword_Call(request,onOk,onDefault,eventListener,sender); + await this.ServicePrincipalsCreateAppRoleAssignments_Call (request, onCreated,onDefault,eventListener,sender); } } - /// Invoke action addPassword - /// - /// Action parameters - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// create new navigation property to appRoleAssignments for servicePrincipals + /// key: id of servicePrincipal + /// Json string supplied to the ServicePrincipalsCreateAppRoleAssignments operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the 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 ServicePrincipalsAddPasswordViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsIeboplServiceprincipalsServiceprincipalIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ServicePrincipalsCreateAppRoleAssignmentsViaJsonStringWithResult(string servicePrincipalId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/appRoleAssignments" - var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}/microsoft.graph.addPassword'"); - } + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // replace URI parameters with values from identity - var servicePrincipalId = _match.Groups["servicePrincipal-id"].Value; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicePrincipalsCreateAppRoleAssignmentsWithResult_Call (request, eventListener,sender); + } + } + + /// create new navigation property to appRoleAssignments for servicePrincipals + /// key: id of servicePrincipal + /// New navigation property + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsCreateAppRoleAssignmentsWithResult(string servicePrincipalId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/servicePrincipals/" - + servicePrincipalId - + "/microsoft.graph.addPassword" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/appRoleAssignments" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ServicePrincipalsAddPassword_Call(request,onOk,onDefault,eventListener,sender); + return await this.ServicePrincipalsCreateAppRoleAssignmentsWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicePrincipalsCreateAppRoleAssignmentsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// + /// Actual wire call for method. + /// /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -4842,7 +8768,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ServicePrincipalsAddPassword_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ServicePrincipalsCreateAppRoleAssignments_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -4858,10 +8784,10 @@ public partial class MSGraph switch ( _response.StatusCode ) { - case global::System.Net.HttpStatusCode.OK: + case global::System.Net.HttpStatusCode.Created: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: @@ -4883,16 +8809,16 @@ public partial class MSGraph } /// - /// 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. /// /// key: id of servicePrincipal - /// Action parameters + /// New navigation property /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ServicePrincipalsAddPassword_Validate(string servicePrincipalId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsIeboplServiceprincipalsServiceprincipalIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ServicePrincipalsCreateAppRoleAssignments_Validate(string servicePrincipalId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -4902,7 +8828,9 @@ public partial class MSGraph } } - /// Create new navigation property to appRoleAssignments for servicePrincipals + /// + /// create new navigation property to federatedIdentityCredentials for servicePrincipals + /// /// key: id of servicePrincipal /// New navigation property /// a delegate that is called when the remote service returns 201 (Created). @@ -4914,7 +8842,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ServicePrincipalsCreateAppRoleAssignments(string servicePrincipalId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ServicePrincipalsCreateFederatedIdentityCredentials(string servicePrincipalId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { // Constant Parameters using( NoSynchronizationContext ) @@ -4923,7 +8851,7 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/servicePrincipals/" + global::System.Uri.EscapeDataString(servicePrincipalId) - + "/appRoleAssignments" + + "/federatedIdentityCredentials" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4940,11 +8868,13 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsCreateAppRoleAssignments_Call(request,onCreated,onDefault,eventListener,sender); + await this.ServicePrincipalsCreateFederatedIdentityCredentials_Call (request, onCreated,onDefault,eventListener,sender); } } - /// Create new navigation property to appRoleAssignments for servicePrincipals + /// + /// create new navigation property to federatedIdentityCredentials for servicePrincipals + /// /// /// New navigation property /// a delegate that is called when the remote service returns 201 (Created). @@ -4956,7 +8886,7 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ServicePrincipalsCreateAppRoleAssignmentsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ServicePrincipalsCreateFederatedIdentityCredentialsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { // Constant Parameters using( NoSynchronizationContext ) @@ -4966,7 +8896,7 @@ public partial class MSGraph var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}/appRoleAssignments'"); + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}'"); } // replace URI parameters with values from identity @@ -4975,7 +8905,7 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/servicePrincipals/" + servicePrincipalId - + "/appRoleAssignments" + + "/federatedIdentityCredentials" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4992,97 +8922,76 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsCreateAppRoleAssignments_Call(request,onCreated,onDefault,eventListener,sender); + await this.ServicePrincipalsCreateFederatedIdentityCredentials_Call (request, onCreated,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// create new navigation property to federatedIdentityCredentials for servicePrincipals /// - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// + /// New navigation property /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the 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 ServicePrincipalsCreateAppRoleAssignments_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ServicePrincipalsCreateFederatedIdentityCredentialsViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, - /// but you will get validation events back. - /// - /// key: id of servicePrincipal - /// New navigation property - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task ServicePrincipalsCreateAppRoleAssignments_Validate(string servicePrincipalId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(servicePrincipalId),servicePrincipalId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + // replace URI parameters with values from identity + var servicePrincipalId = _match.Groups["servicePrincipal-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + servicePrincipalId + + "/federatedIdentityCredentials" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicePrincipalsCreateFederatedIdentityCredentialsWithResult_Call (request, eventListener,sender); } } /// - /// Create new navigation property to federatedIdentityCredentials for servicePrincipals + /// create new navigation property to federatedIdentityCredentials for servicePrincipals /// /// key: id of servicePrincipal - /// New navigation property + /// Json string supplied to the ServicePrincipalsCreateFederatedIdentityCredentials operation /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. - /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ServicePrincipalsCreateFederatedIdentityCredentials(string servicePrincipalId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ServicePrincipalsCreateFederatedIdentityCredentialsViaJsonString(string servicePrincipalId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) @@ -5104,70 +9013,161 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsCreateFederatedIdentityCredentials_Call(request,onCreated,onDefault,eventListener,sender); + await this.ServicePrincipalsCreateFederatedIdentityCredentials_Call (request, onCreated,onDefault,eventListener,sender); } } /// - /// Create new navigation property to federatedIdentityCredentials for servicePrincipals + /// create new navigation property to federatedIdentityCredentials for servicePrincipals /// - /// - /// New navigation property - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// key: id of servicePrincipal + /// Json string supplied to the ServicePrincipalsCreateFederatedIdentityCredentials operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the 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 ServicePrincipalsCreateFederatedIdentityCredentialsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task ServicePrincipalsCreateFederatedIdentityCredentialsViaJsonStringWithResult(string servicePrincipalId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/federatedIdentityCredentials" - var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}/federatedIdentityCredentials'"); - } + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // replace URI parameters with values from identity - var servicePrincipalId = _match.Groups["servicePrincipal-id"].Value; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicePrincipalsCreateFederatedIdentityCredentialsWithResult_Call (request, eventListener,sender); + } + } + + /// + /// create new navigation property to federatedIdentityCredentials for servicePrincipals + /// + /// key: id of servicePrincipal + /// New navigation property + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsCreateFederatedIdentityCredentialsWithResult(string servicePrincipalId, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/servicePrincipals/" - + servicePrincipalId + + global::System.Uri.EscapeDataString(servicePrincipalId) + "/federatedIdentityCredentials" ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ServicePrincipalsCreateFederatedIdentityCredentials_Call(request,onCreated,onDefault,eventListener,sender); + return await this.ServicePrincipalsCreateFederatedIdentityCredentialsWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicePrincipalsCreateFederatedIdentityCredentialsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 201 (Created). @@ -5279,7 +9279,7 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsDeleteAppRoleAssignments_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ServicePrincipalsDeleteAppRoleAssignments_Call (request, onNoContent,onDefault,eventListener,sender); } } @@ -5334,12 +9334,12 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsDeleteAppRoleAssignments_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ServicePrincipalsDeleteAppRoleAssignments_Call (request, onNoContent,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 204 (NoContent). @@ -5452,7 +9452,7 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsDeleteFederatedIdentityCredentials_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ServicePrincipalsDeleteFederatedIdentityCredentials_Call (request, onNoContent,onDefault,eventListener,sender); } } @@ -5507,12 +9507,12 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsDeleteFederatedIdentityCredentials_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ServicePrincipalsDeleteFederatedIdentityCredentials_Call (request, onNoContent,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 204 (NoContent). @@ -5609,9 +9609,9 @@ public partial class MSGraph + "/appRoleAssignments/" + global::System.Uri.EscapeDataString(appRoleAssignmentId) + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -5623,7 +9623,7 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsGetAppRoleAssignments_Call(request,onOk,onDefault,eventListener,sender); + await this.ServicePrincipalsGetAppRoleAssignments_Call (request, onOk,onDefault,eventListener,sender); } } @@ -5662,9 +9662,9 @@ public partial class MSGraph + "/appRoleAssignments/" + appRoleAssignmentId + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -5676,12 +9676,166 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsGetAppRoleAssignments_Call(request,onOk,onDefault,eventListener,sender); + await this.ServicePrincipalsGetAppRoleAssignments_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get appRoleAssignments from servicePrincipals + /// + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsGetAppRoleAssignmentsViaIdentityWithResult(global::System.String viaIdentity, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)/appRoleAssignments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}/appRoleAssignments/{appRoleAssignment-id}'"); + } + + // replace URI parameters with values from identity + var servicePrincipalId = _match.Groups["servicePrincipal-id"].Value; + var appRoleAssignmentId = _match.Groups["appRoleAssignment-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + servicePrincipalId + + "/appRoleAssignments/" + + appRoleAssignmentId + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicePrincipalsGetAppRoleAssignmentsWithResult_Call (request, eventListener,sender); + } + } + + /// Get appRoleAssignments from servicePrincipals + /// key: id of servicePrincipal + /// key: id of appRoleAssignment + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsGetAppRoleAssignmentsWithResult(string servicePrincipalId, string appRoleAssignmentId, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/appRoleAssignments/" + + global::System.Uri.EscapeDataString(appRoleAssignmentId) + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicePrincipalsGetAppRoleAssignmentsWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicePrincipalsGetAppRoleAssignmentsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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). @@ -5778,9 +9932,9 @@ public partial class MSGraph + "/federatedIdentityCredentials/" + global::System.Uri.EscapeDataString(federatedIdentityCredentialId) + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -5792,7 +9946,7 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsGetFederatedIdentityCredentials_Call(request,onOk,onDefault,eventListener,sender); + await this.ServicePrincipalsGetFederatedIdentityCredentials_Call (request, onOk,onDefault,eventListener,sender); } } @@ -5831,9 +9985,9 @@ public partial class MSGraph + "/federatedIdentityCredentials/" + federatedIdentityCredentialId + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -5845,12 +9999,166 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsGetFederatedIdentityCredentials_Call(request,onOk,onDefault,eventListener,sender); + await this.ServicePrincipalsGetFederatedIdentityCredentials_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get federatedIdentityCredentials from servicePrincipals + /// + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsGetFederatedIdentityCredentialsViaIdentityWithResult(global::System.String viaIdentity, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)/federatedIdentityCredentials/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}/federatedIdentityCredentials/{federatedIdentityCredential-id}'"); + } + + // replace URI parameters with values from identity + var servicePrincipalId = _match.Groups["servicePrincipal-id"].Value; + var federatedIdentityCredentialId = _match.Groups["federatedIdentityCredential-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + servicePrincipalId + + "/federatedIdentityCredentials/" + + federatedIdentityCredentialId + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicePrincipalsGetFederatedIdentityCredentialsWithResult_Call (request, eventListener,sender); + } + } + + /// Get federatedIdentityCredentials from servicePrincipals + /// key: id of servicePrincipal + /// key: id of federatedIdentityCredential + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsGetFederatedIdentityCredentialsWithResult(string servicePrincipalId, string federatedIdentityCredentialId, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/federatedIdentityCredentials/" + + global::System.Uri.EscapeDataString(federatedIdentityCredentialId) + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicePrincipalsGetFederatedIdentityCredentialsWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicePrincipalsGetFederatedIdentityCredentialsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredential.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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). @@ -5955,11 +10263,11 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -5971,7 +10279,7 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsListAppRoleAssignments_Call(request,onOk,onDefault,eventListener,sender); + await this.ServicePrincipalsListAppRoleAssignments_Call (request, onOk,onDefault,eventListener,sender); } } @@ -6018,11 +10326,11 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -6034,12 +10342,186 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsListAppRoleAssignments_Call(request,onOk,onDefault,eventListener,sender); + await this.ServicePrincipalsListAppRoleAssignments_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get appRoleAssignments from servicePrincipals + /// + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsListAppRoleAssignmentsViaIdentityWithResult(global::System.String viaIdentity, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)/appRoleAssignments$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}/appRoleAssignments'"); + } + + // replace URI parameters with values from identity + var servicePrincipalId = _match.Groups["servicePrincipal-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + servicePrincipalId + + "/appRoleAssignments" + + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicePrincipalsListAppRoleAssignmentsWithResult_Call (request, eventListener,sender); + } + } + + /// Get appRoleAssignments from servicePrincipals + /// key: id of servicePrincipal + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsListAppRoleAssignmentsWithResult(string servicePrincipalId, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/appRoleAssignments" + + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicePrincipalsListAppRoleAssignmentsWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicePrincipalsListAppRoleAssignmentsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignmentCollectionResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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). @@ -6139,7 +10621,131 @@ public partial class MSGraph // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/servicePrincipals/" - + global::System.Uri.EscapeDataString(servicePrincipalId) + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/federatedIdentityCredentials" + + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicePrincipalsListFederatedIdentityCredentials_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get federatedIdentityCredentials from servicePrincipals + /// + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsListFederatedIdentityCredentialsViaIdentity(global::System.String viaIdentity, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)/federatedIdentityCredentials$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}/federatedIdentityCredentials'"); + } + + // replace URI parameters with values from identity + var servicePrincipalId = _match.Groups["servicePrincipal-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + servicePrincipalId + + "/federatedIdentityCredentials" + + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicePrincipalsListFederatedIdentityCredentials_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get federatedIdentityCredentials from servicePrincipals + /// + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsListFederatedIdentityCredentialsViaIdentityWithResult(global::System.String viaIdentity, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)/federatedIdentityCredentials$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}/federatedIdentityCredentials'"); + } + + // replace URI parameters with values from identity + var servicePrincipalId = _match.Groups["servicePrincipal-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + servicePrincipalId + "/federatedIdentityCredentials" + "?" + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) @@ -6148,61 +10754,49 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ServicePrincipalsListFederatedIdentityCredentials_Call(request,onOk,onDefault,eventListener,sender); + return await this.ServicePrincipalsListFederatedIdentityCredentialsWithResult_Call (request, eventListener,sender); } } /// Get federatedIdentityCredentials from servicePrincipals - /// + /// key: id of servicePrincipal /// Search items by search phrases /// Filter items by property values /// Include count of items /// Order items by property values /// Select properties to be returned /// Expand related entities - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 ServicePrincipalsListFederatedIdentityCredentialsViaIdentity(global::System.String viaIdentity, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ServicePrincipalsListFederatedIdentityCredentialsWithResult(string servicePrincipalId, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)/federatedIdentityCredentials$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}/federatedIdentityCredentials'"); - } - - // replace URI parameters with values from identity - var servicePrincipalId = _match.Groups["servicePrincipal-id"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/servicePrincipals/" - + servicePrincipalId + + global::System.Uri.EscapeDataString(servicePrincipalId) + "/federatedIdentityCredentials" + "?" + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) @@ -6211,28 +10805,90 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ServicePrincipalsListFederatedIdentityCredentials_Call(request,onOk,onDefault,eventListener,sender); + return await this.ServicePrincipalsListFederatedIdentityCredentialsWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicePrincipalsListFederatedIdentityCredentialsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredentialCollectionResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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). @@ -6346,7 +11002,7 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsRemoveKey_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ServicePrincipalsRemoveKey_Call (request, onNoContent,onDefault,eventListener,sender); } } @@ -6372,7 +11028,7 @@ public partial class MSGraph var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}/microsoft.graph.removeKey'"); + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}'"); } // replace URI parameters with values from identity @@ -6398,11 +11054,52 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsRemoveKey_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ServicePrincipalsRemoveKey_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// Invoke action removeKey + /// key: id of servicePrincipal + /// Json string supplied to the ServicePrincipalsRemoveKey operation + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsRemoveKeyViaJsonString(string servicePrincipalId, global::System.String jsonString, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/microsoft.graph.removeKey" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicePrincipalsRemoveKey_Call (request, onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled @@ -6510,7 +11207,7 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsRemovePassword_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ServicePrincipalsRemovePassword_Call (request, onNoContent,onDefault,eventListener,sender); } } @@ -6536,7 +11233,7 @@ public partial class MSGraph var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}/microsoft.graph.removePassword'"); + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}'"); } // replace URI parameters with values from identity @@ -6562,11 +11259,52 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsRemovePassword_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ServicePrincipalsRemovePassword_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// Invoke action removePassword + /// key: id of servicePrincipal + /// Json string supplied to the ServicePrincipalsRemovePassword operation + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsRemovePasswordViaJsonString(string servicePrincipalId, global::System.String jsonString, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/microsoft.graph.removePassword" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicePrincipalsRemovePassword_Call (request, onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled @@ -6671,12 +11409,185 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsServicePrincipalCreateServicePrincipal_Call(request,onCreated,onDefault,eventListener,sender); + await this.ServicePrincipalsServicePrincipalCreateServicePrincipal_Call (request, onCreated,onDefault,eventListener,sender); + } + } + + /// Add new entity to servicePrincipals + /// Json string supplied to the ServicePrincipalsServicePrincipalCreateServicePrincipal operation + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsServicePrincipalCreateServicePrincipalViaJsonString(global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicePrincipalsServicePrincipalCreateServicePrincipal_Call (request, onCreated,onDefault,eventListener,sender); + } + } + + /// Add new entity to servicePrincipals + /// Json string supplied to the ServicePrincipalsServicePrincipalCreateServicePrincipal operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsServicePrincipalCreateServicePrincipalViaJsonStringWithResult(global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicePrincipalsServicePrincipalCreateServicePrincipalWithResult_Call (request, eventListener,sender); + } + } + + /// Add new entity to servicePrincipals + /// New entity + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsServicePrincipalCreateServicePrincipalWithResult(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicePrincipalsServicePrincipalCreateServicePrincipalWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicePrincipalsServicePrincipalCreateServicePrincipalWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphServicePrincipal.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 201 (Created). @@ -6786,7 +11697,7 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsServicePrincipalDeleteServicePrincipal_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ServicePrincipalsServicePrincipalDeleteServicePrincipal_Call (request, onNoContent,onDefault,eventListener,sender); } } @@ -6841,12 +11752,12 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsServicePrincipalDeleteServicePrincipal_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ServicePrincipalsServicePrincipalDeleteServicePrincipal_Call (request, onNoContent,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 204 (NoContent). @@ -6942,9 +11853,9 @@ public partial class MSGraph "/servicePrincipals/" + global::System.Uri.EscapeDataString(servicePrincipalId) + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -6962,7 +11873,7 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsServicePrincipalGetServicePrincipal_Call(request,onOk,onDefault,eventListener,sender); + await this.ServicePrincipalsServicePrincipalGetServicePrincipal_Call (request, onOk,onDefault,eventListener,sender); } } @@ -7002,9 +11913,9 @@ public partial class MSGraph "/servicePrincipals/" + servicePrincipalId + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -7022,12 +11933,180 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsServicePrincipalGetServicePrincipal_Call(request,onOk,onDefault,eventListener,sender); + await this.ServicePrincipalsServicePrincipalGetServicePrincipal_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. + /// + /// + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsServicePrincipalGetServicePrincipalViaIdentityWithResult(global::System.String viaIdentity, string consistencyLevel, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals/{servicePrincipal-id}'"); + } + + // replace URI parameters with values from identity + var servicePrincipalId = _match.Groups["servicePrincipal-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + servicePrincipalId + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != consistencyLevel) + { + request.Headers.Add("ConsistencyLevel",consistencyLevel); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicePrincipalsServicePrincipalGetServicePrincipalWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. + /// + /// key: id of servicePrincipal + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsServicePrincipalGetServicePrincipalWithResult(string servicePrincipalId, string consistencyLevel, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != consistencyLevel) + { + request.Headers.Add("ConsistencyLevel",consistencyLevel); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicePrincipalsServicePrincipalGetServicePrincipalWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicePrincipalsServicePrincipalGetServicePrincipalWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphServicePrincipal.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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). @@ -7130,11 +12209,78 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != consistencyLevel) + { + request.Headers.Add("ConsistencyLevel",consistencyLevel); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicePrincipalsServicePrincipalListServicePrincipal_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get entities from servicePrincipals + /// + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsServicePrincipalListServicePrincipalViaIdentity(global::System.String viaIdentity, string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals" + + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -7152,7 +12298,7 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsServicePrincipalListServicePrincipal_Call(request,onOk,onDefault,eventListener,sender); + await this.ServicePrincipalsServicePrincipalListServicePrincipal_Call (request, onOk,onDefault,eventListener,sender); } } @@ -7165,28 +12311,81 @@ public partial class MSGraph /// Order items by property values /// Select properties to be returned /// Expand related entities - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 ServicePrincipalsServicePrincipalListServicePrincipalViaIdentityWithResult(global::System.String viaIdentity, string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/servicePrincipals'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals" + + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != consistencyLevel) + { + request.Headers.Add("ConsistencyLevel",consistencyLevel); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ServicePrincipalsServicePrincipalListServicePrincipalWithResult_Call (request, eventListener,sender); + } + } + + /// Get entities from servicePrincipals + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ServicePrincipalsServicePrincipalListServicePrincipalViaIdentity(global::System.String viaIdentity, string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ServicePrincipalsServicePrincipalListServicePrincipalWithResult(string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/servicePrincipals$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/servicePrincipals'"); - } - - // replace URI parameters with values from identity // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/servicePrincipals" @@ -7197,19 +12396,19 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != consistencyLevel) @@ -7217,14 +12416,76 @@ public partial class MSGraph request.Headers.Add("ConsistencyLevel",consistencyLevel); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ServicePrincipalsServicePrincipalListServicePrincipal_Call(request,onOk,onDefault,eventListener,sender); + return await this.ServicePrincipalsServicePrincipalListServicePrincipalWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ServicePrincipalsServicePrincipalListServicePrincipalWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfServicePrincipal.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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). @@ -7340,7 +12601,7 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsServicePrincipalUpdateServicePrincipal_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ServicePrincipalsServicePrincipalUpdateServicePrincipal_Call (request, onNoContent,onDefault,eventListener,sender); } } @@ -7394,12 +12655,55 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsServicePrincipalUpdateServicePrincipal_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ServicePrincipalsServicePrincipalUpdateServicePrincipal_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. + /// + /// key: id of servicePrincipal + /// Json string supplied to the ServicePrincipalsServicePrincipalUpdateServicePrincipal operation + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsServicePrincipalUpdateServicePrincipalViaJsonString(string servicePrincipalId, global::System.String jsonString, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicePrincipalsServicePrincipalUpdateServicePrincipal_Call (request, onNoContent,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 204 (NoContent). @@ -7470,7 +12774,7 @@ public partial class MSGraph } } - /// Update the navigation property appRoleAssignments in servicePrincipals + /// update the navigation property appRoleAssignments in servicePrincipals /// key: id of servicePrincipal /// key: id of appRoleAssignment /// New navigation property values @@ -7510,11 +12814,11 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsUpdateAppRoleAssignments_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ServicePrincipalsUpdateAppRoleAssignments_Call (request, onNoContent,onDefault,eventListener,sender); } } - /// Update the navigation property appRoleAssignments in servicePrincipals + /// update the navigation property appRoleAssignments in servicePrincipals /// /// New navigation property values /// a delegate that is called when the remote service returns 204 (NoContent). @@ -7564,12 +12868,55 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsUpdateAppRoleAssignments_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ServicePrincipalsUpdateAppRoleAssignments_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// update the navigation property appRoleAssignments in servicePrincipals + /// key: id of servicePrincipal + /// key: id of appRoleAssignment + /// Json string supplied to the ServicePrincipalsUpdateAppRoleAssignments operation + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsUpdateAppRoleAssignmentsViaJsonString(string servicePrincipalId, string appRoleAssignmentId, global::System.String jsonString, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/appRoleAssignments/" + + global::System.Uri.EscapeDataString(appRoleAssignmentId) + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicePrincipalsUpdateAppRoleAssignments_Call (request, onNoContent,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 204 (NoContent). @@ -7643,7 +12990,7 @@ public partial class MSGraph } /// - /// Update the navigation property federatedIdentityCredentials in servicePrincipals + /// update the navigation property federatedIdentityCredentials in servicePrincipals /// /// key: id of servicePrincipal /// key: id of federatedIdentityCredential @@ -7684,12 +13031,12 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsUpdateFederatedIdentityCredentials_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ServicePrincipalsUpdateFederatedIdentityCredentials_Call (request, onNoContent,onDefault,eventListener,sender); } } /// - /// Update the navigation property federatedIdentityCredentials in servicePrincipals + /// update the navigation property federatedIdentityCredentials in servicePrincipals /// /// /// New navigation property values @@ -7740,12 +13087,57 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ServicePrincipalsUpdateFederatedIdentityCredentials_Call(request,onNoContent,onDefault,eventListener,sender); + await this.ServicePrincipalsUpdateFederatedIdentityCredentials_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// update the navigation property federatedIdentityCredentials in servicePrincipals + /// + /// key: id of servicePrincipal + /// key: id of federatedIdentityCredential + /// Json string supplied to the ServicePrincipalsUpdateFederatedIdentityCredentials operation + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ServicePrincipalsUpdateFederatedIdentityCredentialsViaJsonString(string servicePrincipalId, string federatedIdentityCredentialId, global::System.String jsonString, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/servicePrincipals/" + + global::System.Uri.EscapeDataString(servicePrincipalId) + + "/federatedIdentityCredentials/" + + global::System.Uri.EscapeDataString(federatedIdentityCredentialId) + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ServicePrincipalsUpdateFederatedIdentityCredentials_Call (request, onNoContent,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// Actual wire call for method. /// /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 204 (NoContent). @@ -7832,89 +13224,243 @@ public partial class MSGraph /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task UsersListOwnedApplications(string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task UsersListOwnedApplications(string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/me/ownedObjects/$/Microsoft.Graph.Application" + + "?" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UsersListOwnedApplications_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Directory objects that are owned by the user. Read-only. Nullable. Supports $expand. + /// + /// + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UsersListOwnedApplicationsViaIdentity(global::System.String viaIdentity, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/me/ownedObjects/$/Microsoft.Graph.Application$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/me/ownedObjects/$/Microsoft.Graph.Application'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/me/ownedObjects/$/Microsoft.Graph.Application" + + "?" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UsersListOwnedApplications_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Directory objects that are owned by the user. Read-only. Nullable. Supports $expand. + /// + /// + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UsersListOwnedApplicationsViaIdentityWithResult(global::System.String viaIdentity, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/me/ownedObjects/$/Microsoft.Graph.Application$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/me/ownedObjects/$/Microsoft.Graph.Application'"); + } + + // replace URI parameters with values from identity // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/me/ownedObjects/$/Microsoft.Graph.Application" + "?" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.UsersListOwnedApplications_Call(request,onOk,onDefault,eventListener,sender); + return await this.UsersListOwnedApplicationsWithResult_Call (request, eventListener,sender); } } /// /// Directory objects that are owned by the user. Read-only. Nullable. Supports $expand. /// - /// /// Order items by property values /// Select properties to be returned /// Expand related entities - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 UsersListOwnedApplicationsViaIdentity(global::System.String viaIdentity, string[] Orderby, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task UsersListOwnedApplicationsWithResult(string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/me/ownedObjects/$/Microsoft.Graph.Application$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/me/ownedObjects/$/Microsoft.Graph.Application'"); - } - - // replace URI parameters with values from identity // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/me/ownedObjects/$/Microsoft.Graph.Application" + "?" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.UsersListOwnedApplications_Call(request,onOk,onDefault,eventListener,sender); + return await this.UsersListOwnedApplicationsWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UsersListOwnedApplicationsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfDirectoryObject.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 @@ -8006,11 +13552,11 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/me/ownedObjects/$/Microsoft.Graph.Application" + "?" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -8022,7 +13568,7 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.UsersListOwnedObjects_Call(request,onOk,onDefault,eventListener,sender); + await this.UsersListOwnedObjects_Call (request, onOk,onDefault,eventListener,sender); } } @@ -8059,11 +13605,11 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/me/ownedObjects/$/Microsoft.Graph.Application" + "?" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -8075,11 +13621,163 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.UsersListOwnedObjects_Call(request,onOk,onDefault,eventListener,sender); + await this.UsersListOwnedObjects_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Directory objects that are owned by the user. Read-only. Nullable. Supports $expand. + /// + /// + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UsersListOwnedObjectsViaIdentityWithResult(global::System.String viaIdentity, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/me/ownedObjects/$/Microsoft.Graph.Application$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/me/ownedObjects/$/Microsoft.Graph.Application'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/me/ownedObjects/$/Microsoft.Graph.Application" + + "?" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.UsersListOwnedObjectsWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Directory objects that are owned by the user. Read-only. Nullable. Supports $expand. + /// + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UsersListOwnedObjectsWithResult(string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/me/ownedObjects/$/Microsoft.Graph.Application" + + "?" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.UsersListOwnedObjectsWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UsersListOwnedObjectsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfDirectoryObjectAutoGenerated2.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 @@ -8138,28 +13836,139 @@ public partial class MSGraph /// Expand related entities /// an instance that will receive events. /// - /// 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 UsersListOwnedObjects_Validate(string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + + } + } + + /// Add new entity to users + /// New entity + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UsersUserCreateUser(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/users" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UsersUserCreateUser_Call (request, onCreated,onDefault,eventListener,sender); + } + } + + /// Add new entity to users + /// Json string supplied to the UsersUserCreateUser operation + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UsersUserCreateUserViaJsonString(global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/users" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UsersUserCreateUser_Call (request, onCreated,onDefault,eventListener,sender); + } + } + + /// Add new entity to users + /// Json string supplied to the UsersUserCreateUser operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task UsersListOwnedObjects_Validate(string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task UsersUserCreateUserViaJsonStringWithResult(global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { + // Constant Parameters using( NoSynchronizationContext ) { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/users" + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.UsersUserCreateUserWithResult_Call (request, eventListener,sender); } } /// Add new entity to users /// New entity - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the 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 UsersUserCreateUser(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser body, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) + public async global::System.Threading.Tasks.Task UsersUserCreateUserWithResult(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser body, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate) { // Constant Parameters using( NoSynchronizationContext ) @@ -8170,24 +13979,84 @@ public partial class MSGraph ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.UsersUserCreateUser_Call(request,onCreated,onDefault,eventListener,sender); + return await this.UsersUserCreateUserWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UsersUserCreateUserWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphUser.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled @@ -8293,7 +14162,7 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.UsersUserDeleteUser_Call(request,onNoContent,onDefault,eventListener,sender); + await this.UsersUserDeleteUser_Call (request, onNoContent,onDefault,eventListener,sender); } } @@ -8345,11 +14214,11 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.UsersUserDeleteUser_Call(request,onNoContent,onDefault,eventListener,sender); + await this.UsersUserDeleteUser_Call (request, onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled @@ -8438,9 +14307,9 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/me" + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -8452,7 +14321,7 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.UsersUserGetSignedInUser_Call(request,onOk,onDefault,eventListener,sender); + await this.UsersUserGetSignedInUser_Call (request, onOk,onDefault,eventListener,sender); } } @@ -8486,9 +14355,9 @@ public partial class MSGraph var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/me" + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -8500,11 +14369,153 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.UsersUserGetSignedInUser_Call(request,onOk,onDefault,eventListener,sender); + await this.UsersUserGetSignedInUser_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Represents current signed-in user object. + /// + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UsersUserGetSignedInUserViaIdentityWithResult(global::System.String viaIdentity, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/me$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/me'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/me" + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.UsersUserGetSignedInUserWithResult_Call (request, eventListener,sender); + } + } + + /// Represents current signed-in user object. + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UsersUserGetSignedInUserWithResult(string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/me" + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.UsersUserGetSignedInUserWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UsersUserGetSignedInUserWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphUser.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 @@ -8573,39 +14584,151 @@ public partial class MSGraph } /// Represents an Azure Active Directory user object. - /// key: id of user + /// key: id of user + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Select properties to be returned + /// Expand related entities + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UsersUserGetUser(string userId, string consistencyLevel, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/users/" + + global::System.Uri.EscapeDataString(userId) + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != consistencyLevel) + { + request.Headers.Add("ConsistencyLevel",consistencyLevel); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UsersUserGetUser_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Represents an Azure Active Directory user object. + /// + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Select properties to be returned + /// Expand related entities + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UsersUserGetUserViaIdentity(global::System.String viaIdentity, string consistencyLevel, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/users/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/users/{user-id}'"); + } + + // replace URI parameters with values from identity + var userId = _match.Groups["user-id"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/users/" + + userId + + "?" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != consistencyLevel) + { + request.Headers.Add("ConsistencyLevel",consistencyLevel); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UsersUserGetUser_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Represents an Azure Active Directory user object. + /// /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ /// Select properties to be returned /// Expand related entities - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 UsersUserGetUser(string userId, string consistencyLevel, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task UsersUserGetUserViaIdentityWithResult(global::System.String viaIdentity, string consistencyLevel, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/users/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/users/{user-id}'"); + } + + // replace URI parameters with values from identity + var userId = _match.Groups["user-id"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/users/" - + global::System.Uri.EscapeDataString(userId) + + userId + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != consistencyLevel) @@ -8613,56 +14736,44 @@ public partial class MSGraph request.Headers.Add("ConsistencyLevel",consistencyLevel); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.UsersUserGetUser_Call(request,onOk,onDefault,eventListener,sender); + return await this.UsersUserGetUserWithResult_Call (request, eventListener,sender); } } /// Represents an Azure Active Directory user object. - /// + /// key: id of user /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ /// Select properties to be returned /// Expand related entities - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 UsersUserGetUserViaIdentity(global::System.String viaIdentity, string consistencyLevel, string[] Select, string[] Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task UsersUserGetUserWithResult(string userId, string consistencyLevel, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) { // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/users/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/users/{user-id}'"); - } - - // replace URI parameters with values from identity - var userId = _match.Groups["user-id"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/users/" - + userId + + global::System.Uri.EscapeDataString(userId) + "?" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != consistencyLevel) @@ -8670,13 +14781,73 @@ public partial class MSGraph request.Headers.Add("ConsistencyLevel",consistencyLevel); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.UsersUserGetUser_Call(request,onOk,onDefault,eventListener,sender); + return await this.UsersUserGetUserWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UsersUserGetUserWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphUser.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 @@ -8778,11 +14949,11 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -8800,7 +14971,7 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.UsersUserListUser_Call(request,onOk,onDefault,eventListener,sender); + await this.UsersUserListUser_Call (request, onOk,onDefault,eventListener,sender); } } @@ -8845,11 +15016,11 @@ public partial class MSGraph + "&" + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + "&" - + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + "&" - + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( global::System.Uri.EscapeDataString(null == each ? global::System.String.Empty : each.ToString()) ))) : global::System.String.Empty) + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -8867,11 +15038,191 @@ public partial class MSGraph await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.UsersUserListUser_Call(request,onOk,onDefault,eventListener,sender); + await this.UsersUserListUser_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get entities from users + /// + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UsersUserListUserViaIdentityWithResult(global::System.String viaIdentity, string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/users$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/users'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/users" + + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != consistencyLevel) + { + request.Headers.Add("ConsistencyLevel",consistencyLevel); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.UsersUserListUserWithResult_Call (request, eventListener,sender); + } + } + + /// Get entities from users + /// Indicates the requested consistency level. Documentation URL: https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/ + /// Search items by search phrases + /// Filter items by property values + /// Include count of items + /// Order items by property values + /// Select properties to be returned + /// Expand related entities + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UsersUserListUserWithResult(string consistencyLevel, string Search, string Filter, bool? Count, string[] Orderby, string[] Select, string[] Expand, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/users" + + "?" + + (string.IsNullOrEmpty(Search) ? global::System.String.Empty : "$search=" + global::System.Uri.EscapeDataString(Search)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Count ? global::System.String.Empty : "$count=" + global::System.Uri.EscapeDataString(Count.ToString().ToLower())) + + "&" + + (null != Orderby && Orderby.Length > 0 ? "$orderby=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Orderby, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Select && Select.Length > 0 ? "$select=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Select, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + + "&" + + (null != Expand && Expand.Length > 0 ? "$expand=" + global::System.Uri.EscapeDataString(global::System.Linq.Enumerable.Aggregate(Expand, (current, each) => current + "," + ( null == each ? global::System.String.Empty : each.ToString()) )) : global::System.String.Empty) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != consistencyLevel) + { + request.Headers.Add("ConsistencyLevel",consistencyLevel); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.UsersUserListUserWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UsersUserListUserWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.CollectionOfUser.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Error?.Code; + var message = (await _result)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 @@ -8983,7 +15334,7 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.UsersUserUpdateUser_Call(request,onNoContent,onDefault,eventListener,sender); + await this.UsersUserUpdateUser_Call (request, onNoContent,onDefault,eventListener,sender); } } @@ -9034,11 +15385,51 @@ public partial class MSGraph request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.UsersUserUpdateUser_Call(request,onNoContent,onDefault,eventListener,sender); + await this.UsersUserUpdateUser_Call (request, onNoContent,onDefault,eventListener,sender); + } + } + + /// Represents an Azure Active Directory user object. + /// key: id of user + /// Json string supplied to the UsersUserUpdateUser operation + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UsersUserUpdateUserViaJsonString(string userId, global::System.String jsonString, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.ISendAsync sender) + { + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/users/" + + global::System.Uri.EscapeDataString(userId) + + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://graph.microsoft.com/v1.0{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UsersUserUpdateUser_Call (request, onNoContent,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfApplication.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfApplication.json.cs index 34aab75d78a8..46392086b2f6 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfApplication.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfApplication.json.cs @@ -67,9 +67,9 @@ internal CollectionOfApplication(Microsoft.Azure.PowerShell.Cmdlets.Resources.MS return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphApplication.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} - {_odataCount = If( json?.PropertyT("@odata.count"), out var __jsonOdataCount) ? (int?)__jsonOdataCount : OdataCount;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphApplication.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} + {_odataCount = If( json?.PropertyT("@odata.count"), out var __jsonOdataCount) ? (int?)__jsonOdataCount : _odataCount;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfDirectoryObject.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfDirectoryObject.json.cs index 40cdac4dc6b5..3314dc155973 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfDirectoryObject.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfDirectoryObject.json.cs @@ -67,8 +67,8 @@ internal CollectionOfDirectoryObject(Microsoft.Azure.PowerShell.Cmdlets.Resource return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphApplication.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphApplication.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfDirectoryObjectAutoGenerated2.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfDirectoryObjectAutoGenerated2.json.cs index 712d9f7de7f8..62e0716a8892 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfDirectoryObjectAutoGenerated2.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfDirectoryObjectAutoGenerated2.json.cs @@ -67,8 +67,8 @@ internal CollectionOfDirectoryObjectAutoGenerated2(Microsoft.Azure.PowerShell.Cm return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfGroup.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfGroup.json.cs index 4ef6806bc8c4..0ef4d479ce1b 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfGroup.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfGroup.json.cs @@ -67,9 +67,9 @@ internal CollectionOfGroup(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph. return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphGroup.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} - {_odataCount = If( json?.PropertyT("@odata.count"), out var __jsonOdataCount) ? (int?)__jsonOdataCount : OdataCount;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphGroup.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} + {_odataCount = If( json?.PropertyT("@odata.count"), out var __jsonOdataCount) ? (int?)__jsonOdataCount : _odataCount;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfServicePrincipal.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfServicePrincipal.json.cs index a174a5876574..8aeacf9343d3 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfServicePrincipal.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfServicePrincipal.json.cs @@ -67,9 +67,9 @@ internal CollectionOfServicePrincipal(Microsoft.Azure.PowerShell.Cmdlets.Resourc return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphServicePrincipal.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} - {_odataCount = If( json?.PropertyT("@odata.count"), out var __jsonOdataCount) ? (int?)__jsonOdataCount : OdataCount;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphServicePrincipal.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} + {_odataCount = If( json?.PropertyT("@odata.count"), out var __jsonOdataCount) ? (int?)__jsonOdataCount : _odataCount;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfUser.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfUser.json.cs index 7290142f44e7..e7a369f9c65b 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfUser.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/CollectionOfUser.json.cs @@ -67,9 +67,9 @@ internal CollectionOfUser(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.R return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphUser.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} - {_odataCount = If( json?.PropertyT("@odata.count"), out var __jsonOdataCount) ? (int?)__jsonOdataCount : OdataCount;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphUser.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} + {_odataCount = If( json?.PropertyT("@odata.count"), out var __jsonOdataCount) ? (int?)__jsonOdataCount : _odataCount;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAddIn.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAddIn.json.cs index a266db1dd673..008a1f335893 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAddIn.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAddIn.json.cs @@ -79,9 +79,9 @@ internal MicrosoftGraphAddIn(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGrap return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? If( __jsonProperties as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyValue) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyValue.FromJson(__u) )) ))() : null : Property;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? If( __jsonProperties as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyValue) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyValue.FromJson(__u) )) ))() : null : _property;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAdministrativeUnit.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAdministrativeUnit.cs index 7bcd60510193..d7b54149d53a 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAdministrativeUnit.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAdministrativeUnit.cs @@ -60,9 +60,6 @@ public partial class MicrosoftGraphAdministrativeUnit : /// Internal Acessors for OdataId string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId = value; } - /// Internal Acessors for OdataType - string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = value; } - /// Internal Acessors for Id string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id = value; } @@ -71,8 +68,9 @@ public partial class MicrosoftGraphAdministrativeUnit : public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; } /// The type of object in directory + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; } + public string OdataType { get => "microsoft.graph.administrativeUnit"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = "microsoft.graph.administrativeUnit"; } /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphScopedRoleMembership[] _scopedRoleMember; diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAdministrativeUnit.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAdministrativeUnit.json.cs index 67ef48c80c24..0a2dfcdf4419 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAdministrativeUnit.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAdministrativeUnit.json.cs @@ -62,7 +62,7 @@ public partial class MicrosoftGraphAdministrativeUnit /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAdministrativeUnit FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphAdministrativeUnit(json, new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"visibility",@"members",@"scopedRoleMembers",@"extensions" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphAdministrativeUnit(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"visibility",@"members",@"scopedRoleMembers",@"extensions" }) : null; } /// @@ -80,11 +80,11 @@ internal MicrosoftGraphAdministrativeUnit(Microsoft.Azure.PowerShell.Cmdlets.Res } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); __microsoftGraphDirectoryObject = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject(json); - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_visibility = If( json?.PropertyT("visibility"), out var __jsonVisibility) ? (string)__jsonVisibility : (string)Visibility;} - {_member = If( json?.PropertyT("members"), out var __jsonMembers) ? If( __jsonMembers as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__u) )) ))() : null : Member;} - {_scopedRoleMember = If( json?.PropertyT("scopedRoleMembers"), out var __jsonScopedRoleMembers) ? If( __jsonScopedRoleMembers as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphScopedRoleMembership) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphScopedRoleMembership.FromJson(__p) )) ))() : null : ScopedRoleMember;} - {_extension = If( json?.PropertyT("extensions"), out var __jsonExtensions) ? If( __jsonExtensions as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphExtension) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphExtension.FromJson(__k) )) ))() : null : Extension;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_visibility = If( json?.PropertyT("visibility"), out var __jsonVisibility) ? (string)__jsonVisibility : (string)_visibility;} + {_member = If( json?.PropertyT("members"), out var __jsonMembers) ? If( __jsonMembers as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__u) )) ))() : null : _member;} + {_scopedRoleMember = If( json?.PropertyT("scopedRoleMembers"), out var __jsonScopedRoleMembers) ? If( __jsonScopedRoleMembers as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphScopedRoleMembership) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphScopedRoleMembership.FromJson(__p) )) ))() : null : _scopedRoleMember;} + {_extension = If( json?.PropertyT("extensions"), out var __jsonExtensions) ? If( __jsonExtensions as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphExtension) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphExtension.FromJson(__k) )) ))() : null : _extension;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAdministrativeUnitCollectionResponse.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAdministrativeUnitCollectionResponse.json.cs index e24802f3a22f..959f496246a2 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAdministrativeUnitCollectionResponse.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAdministrativeUnitCollectionResponse.json.cs @@ -80,8 +80,8 @@ internal MicrosoftGraphAdministrativeUnitCollectionResponse(Microsoft.Azure.Powe return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAdministrativeUnit) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAdministrativeUnit.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAdministrativeUnit) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAdministrativeUnit.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAlternativeSecurityId.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAlternativeSecurityId.json.cs index ecfb2d088b53..0d2df7a46ea2 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAlternativeSecurityId.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAlternativeSecurityId.json.cs @@ -79,9 +79,9 @@ internal MicrosoftGraphAlternativeSecurityId(Microsoft.Azure.PowerShell.Cmdlets. return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_identityProvider = If( json?.PropertyT("identityProvider"), out var __jsonIdentityProvider) ? (string)__jsonIdentityProvider : (string)IdentityProvider;} + {_identityProvider = If( json?.PropertyT("identityProvider"), out var __jsonIdentityProvider) ? (string)__jsonIdentityProvider : (string)_identityProvider;} {_key = If( json?.PropertyT("key"), out var __w) ? System.Convert.FromBase64String( ((string)__w).Replace("_","/").Replace("-","+").PadRight( ((string)__w).Length + ((string)__w).Length * 3 % 4, '=') ) : null;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (int?)__jsonType : Type;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (int?)__jsonType : _type;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphApiApplication.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphApiApplication.json.cs index ecf5c3752050..71e6e4f99391 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphApiApplication.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphApiApplication.json.cs @@ -79,11 +79,11 @@ internal MicrosoftGraphApiApplication(Microsoft.Azure.PowerShell.Cmdlets.Resourc return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_acceptMappedClaim = If( json?.PropertyT("acceptMappedClaims"), out var __jsonAcceptMappedClaims) ? (bool?)__jsonAcceptMappedClaims : AcceptMappedClaim;} - {_knownClientApplication = If( json?.PropertyT("knownClientApplications"), out var __jsonKnownClientApplications) ? If( __jsonKnownClientApplications as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : KnownClientApplication;} - {_oauth2PermissionScope = If( json?.PropertyT("oauth2PermissionScopes"), out var __jsonOauth2PermissionScopes) ? If( __jsonOauth2PermissionScopes as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPermissionScope) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPermissionScope.FromJson(__p) )) ))() : null : Oauth2PermissionScope;} - {_preAuthorizedApplication = If( json?.PropertyT("preAuthorizedApplications"), out var __jsonPreAuthorizedApplications) ? If( __jsonPreAuthorizedApplications as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPreAuthorizedApplication) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPreAuthorizedApplication.FromJson(__k) )) ))() : null : PreAuthorizedApplication;} - {_requestedAccessTokenVersion = If( json?.PropertyT("requestedAccessTokenVersion"), out var __jsonRequestedAccessTokenVersion) ? (int?)__jsonRequestedAccessTokenVersion : RequestedAccessTokenVersion;} + {_acceptMappedClaim = If( json?.PropertyT("acceptMappedClaims"), out var __jsonAcceptMappedClaims) ? (bool?)__jsonAcceptMappedClaims : _acceptMappedClaim;} + {_knownClientApplication = If( json?.PropertyT("knownClientApplications"), out var __jsonKnownClientApplications) ? If( __jsonKnownClientApplications as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _knownClientApplication;} + {_oauth2PermissionScope = If( json?.PropertyT("oauth2PermissionScopes"), out var __jsonOauth2PermissionScopes) ? If( __jsonOauth2PermissionScopes as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPermissionScope) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPermissionScope.FromJson(__p) )) ))() : null : _oauth2PermissionScope;} + {_preAuthorizedApplication = If( json?.PropertyT("preAuthorizedApplications"), out var __jsonPreAuthorizedApplications) ? If( __jsonPreAuthorizedApplications as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPreAuthorizedApplication) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPreAuthorizedApplication.FromJson(__k) )) ))() : null : _preAuthorizedApplication;} + {_requestedAccessTokenVersion = If( json?.PropertyT("requestedAccessTokenVersion"), out var __jsonRequestedAccessTokenVersion) ? (int?)__jsonRequestedAccessTokenVersion : _requestedAccessTokenVersion;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRole.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRole.json.cs index 765621f9197f..bd20f9364cd2 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRole.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRole.json.cs @@ -79,13 +79,13 @@ internal MicrosoftGraphAppRole(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGr return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_allowedMemberType = If( json?.PropertyT("allowedMemberTypes"), out var __jsonAllowedMemberTypes) ? If( __jsonAllowedMemberTypes as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AllowedMemberType;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool?)__jsonIsEnabled : IsEnabled;} - {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)Origin;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_allowedMemberType = If( json?.PropertyT("allowedMemberTypes"), out var __jsonAllowedMemberTypes) ? If( __jsonAllowedMemberTypes as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _allowedMemberType;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool?)__jsonIsEnabled : _isEnabled;} + {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)_origin;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)_value;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignment.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignment.cs index 3bd4037ffb59..ad7d3de69aa6 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignment.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignment.cs @@ -72,9 +72,6 @@ public partial class MicrosoftGraphAppRoleAssignment : /// Internal Acessors for OdataId string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId = value; } - /// Internal Acessors for OdataType - string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = value; } - /// Internal Acessors for Id string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id = value; } @@ -84,9 +81,10 @@ public partial class MicrosoftGraphAppRoleAssignment : public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; } /// The type of object in directory + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] - public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; } + public string OdataType { get => "microsoft.graph.appRoleAssignment"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = "microsoft.graph.appRoleAssignment"; } /// Backing field for property. private string _principalDisplayName; @@ -129,6 +127,11 @@ public partial class MicrosoftGraphAppRoleAssignment : [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] public string ResourceDisplayName { get => this._resourceDisplayName; set => this._resourceDisplayName = value; } + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + /// Backing field for property. private string _resourceId; diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignment.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignment.json.cs index a12059291d8a..68b4e65a4eb1 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignment.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignment.json.cs @@ -65,7 +65,7 @@ public partial class MicrosoftGraphAppRoleAssignment /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphAppRoleAssignment(json, new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"appRoleId",@"createdDateTime",@"principalDisplayName",@"principalId",@"principalType",@"resourceDisplayName",@"resourceId" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphAppRoleAssignment(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"appRoleId",@"createdDateTime",@"principalDisplayName",@"principalId",@"principalType",@"resourceDisplayName",@"resourceId" }) : null; } /// @@ -83,13 +83,13 @@ internal MicrosoftGraphAppRoleAssignment(Microsoft.Azure.PowerShell.Cmdlets.Reso } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); __microsoftGraphDirectoryObject = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject(json); - {_appRoleId = If( json?.PropertyT("appRoleId"), out var __jsonAppRoleId) ? (string)__jsonAppRoleId : (string)AppRoleId;} - {_createdDateTime = If( json?.PropertyT("createdDateTime"), out var __jsonCreatedDateTime) ? global::System.DateTime.TryParse((string)__jsonCreatedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedDateTimeValue) ? __jsonCreatedDateTimeValue : CreatedDateTime : CreatedDateTime;} - {_principalDisplayName = If( json?.PropertyT("principalDisplayName"), out var __jsonPrincipalDisplayName) ? (string)__jsonPrincipalDisplayName : (string)PrincipalDisplayName;} - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)PrincipalType;} - {_resourceDisplayName = If( json?.PropertyT("resourceDisplayName"), out var __jsonResourceDisplayName) ? (string)__jsonResourceDisplayName : (string)ResourceDisplayName;} - {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_appRoleId = If( json?.PropertyT("appRoleId"), out var __jsonAppRoleId) ? (string)__jsonAppRoleId : (string)_appRoleId;} + {_createdDateTime = If( json?.PropertyT("createdDateTime"), out var __jsonCreatedDateTime) ? global::System.DateTime.TryParse((string)__jsonCreatedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedDateTimeValue) ? __jsonCreatedDateTimeValue : _createdDateTime : _createdDateTime;} + {_principalDisplayName = If( json?.PropertyT("principalDisplayName"), out var __jsonPrincipalDisplayName) ? (string)__jsonPrincipalDisplayName : (string)_principalDisplayName;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)_principalType;} + {_resourceDisplayName = If( json?.PropertyT("resourceDisplayName"), out var __jsonResourceDisplayName) ? (string)__jsonResourceDisplayName : (string)_resourceDisplayName;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)_resourceId;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentAutoGenerated.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentAutoGenerated.cs index f839b037fc3b..e7b537ad85be 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentAutoGenerated.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentAutoGenerated.cs @@ -58,9 +58,6 @@ public partial class MicrosoftGraphAppRoleAssignmentAutoGenerated : /// Internal Acessors for OdataId string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId = value; } - /// Internal Acessors for OdataType - string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = value; } - /// Internal Acessors for Id string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id = value; } @@ -69,8 +66,9 @@ public partial class MicrosoftGraphAppRoleAssignmentAutoGenerated : public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; } /// The type of object in directory + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; } + public string OdataType { get => "microsoft.graph.appRoleAssignment"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = "microsoft.graph.appRoleAssignment"; } /// Backing field for property. private string _principalDisplayName; diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentAutoGenerated.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentAutoGenerated.json.cs index 9df60a98b276..6f7d878449a1 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentAutoGenerated.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentAutoGenerated.json.cs @@ -65,7 +65,7 @@ public partial class MicrosoftGraphAppRoleAssignmentAutoGenerated /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentAutoGenerated FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphAppRoleAssignmentAutoGenerated(json, new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"appRoleId",@"createdDateTime",@"principalDisplayName",@"principalId",@"principalType",@"resourceDisplayName",@"resourceId" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphAppRoleAssignmentAutoGenerated(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"appRoleId",@"createdDateTime",@"principalDisplayName",@"principalId",@"principalType",@"resourceDisplayName",@"resourceId" }) : null; } /// @@ -84,13 +84,13 @@ internal MicrosoftGraphAppRoleAssignmentAutoGenerated(Microsoft.Azure.PowerShell } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); __microsoftGraphDirectoryObject = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject(json); - {_appRoleId = If( json?.PropertyT("appRoleId"), out var __jsonAppRoleId) ? (string)__jsonAppRoleId : (string)AppRoleId;} - {_createdDateTime = If( json?.PropertyT("createdDateTime"), out var __jsonCreatedDateTime) ? global::System.DateTime.TryParse((string)__jsonCreatedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedDateTimeValue) ? __jsonCreatedDateTimeValue : CreatedDateTime : CreatedDateTime;} - {_principalDisplayName = If( json?.PropertyT("principalDisplayName"), out var __jsonPrincipalDisplayName) ? (string)__jsonPrincipalDisplayName : (string)PrincipalDisplayName;} - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)PrincipalType;} - {_resourceDisplayName = If( json?.PropertyT("resourceDisplayName"), out var __jsonResourceDisplayName) ? (string)__jsonResourceDisplayName : (string)ResourceDisplayName;} - {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + {_appRoleId = If( json?.PropertyT("appRoleId"), out var __jsonAppRoleId) ? (string)__jsonAppRoleId : (string)_appRoleId;} + {_createdDateTime = If( json?.PropertyT("createdDateTime"), out var __jsonCreatedDateTime) ? global::System.DateTime.TryParse((string)__jsonCreatedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedDateTimeValue) ? __jsonCreatedDateTimeValue : _createdDateTime : _createdDateTime;} + {_principalDisplayName = If( json?.PropertyT("principalDisplayName"), out var __jsonPrincipalDisplayName) ? (string)__jsonPrincipalDisplayName : (string)_principalDisplayName;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_principalType = If( json?.PropertyT("principalType"), out var __jsonPrincipalType) ? (string)__jsonPrincipalType : (string)_principalType;} + {_resourceDisplayName = If( json?.PropertyT("resourceDisplayName"), out var __jsonResourceDisplayName) ? (string)__jsonResourceDisplayName : (string)_resourceDisplayName;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)_resourceId;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentCollectionResponse.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentCollectionResponse.json.cs index 619b1ce43296..d1c3eda2978f 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentCollectionResponse.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAppRoleAssignmentCollectionResponse.json.cs @@ -80,8 +80,8 @@ internal MicrosoftGraphAppRoleAssignmentCollectionResponse(Microsoft.Azure.Power return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignment.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignment.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphApplication.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphApplication.cs index a6e44efaef14..2fe2e2717d20 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphApplication.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphApplication.cs @@ -92,7 +92,7 @@ public partial class MicrosoftGraphApplication : /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject CreatedOnBehalfOf { get => (this._createdOnBehalfOf = this._createdOnBehalfOf ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject()); set => this._createdOnBehalfOf = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject CreatedOnBehalfOf { get => (this._createdOnBehalfOf = this._createdOnBehalfOf ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject()); set => this._createdOnBehalfOf = value; } [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] @@ -284,9 +284,6 @@ public partial class MicrosoftGraphApplication : /// Internal Acessors for OdataId string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId = value; } - /// Internal Acessors for OdataType - string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = value; } - /// Internal Acessors for Id string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id = value; } @@ -311,9 +308,10 @@ public partial class MicrosoftGraphApplication : public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; } /// The type of object in directory + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] - public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; } + public string OdataType { get => "#microsoft.graph.application"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = "#microsoft.graph.application"; } /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOptionalClaims _optionalClaim; @@ -381,6 +379,11 @@ public partial class MicrosoftGraphApplication : [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphRequiredResourceAccess[] RequiredResourceAccess { get => this._requiredResourceAccess; set => this._requiredResourceAccess = value; } + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + /// Backing field for property. private string _serviceManagementReference; @@ -590,7 +593,7 @@ public partial interface IMicrosoftGraphApplication : Create = false, Update = false, Description = @"Read-only.", - SerializedName = @"id", + SerializedName = @"ResourceGroupName", PossibleTypes = new [] { typeof(string) })] string CreatedOnBehalfOfId { get; } /// The full id of object in directory diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphApplication.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphApplication.json.cs index 589ca538b515..9536a71cd7e4 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphApplication.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphApplication.json.cs @@ -65,7 +65,7 @@ public partial class MicrosoftGraphApplication /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphApplication(json, new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"addIns",@"api",@"appId",@"applicationTemplateId",@"appRoles",@"createdDateTime",@"description",@"disabledByMicrosoftStatus",@"groupMembershipClaims",@"identifierUris",@"info",@"isDeviceOnlyAuthSupported",@"isFallbackPublicClient",@"keyCredentials",@"logo",@"notes",@"oauth2RequirePostResponse",@"optionalClaims",@"parentalControlSettings",@"passwordCredentials",@"publicClient",@"publisherDomain",@"requiredResourceAccess",@"serviceManagementReference",@"signInAudience",@"spa",@"tags",@"tokenEncryptionKeyId",@"web",@"createdOnBehalfOf",@"extensionProperties",@"federatedIdentityCredentials",@"homeRealmDiscoveryPolicies",@"owners",@"tokenIssuancePolicies",@"tokenLifetimePolicies" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphApplication(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"addIns",@"api",@"appId",@"applicationTemplateId",@"appRoles",@"createdDateTime",@"description",@"disabledByMicrosoftStatus",@"groupMembershipClaims",@"identifierUris",@"info",@"isDeviceOnlyAuthSupported",@"isFallbackPublicClient",@"keyCredentials",@"logo",@"notes",@"oauth2RequirePostResponse",@"optionalClaims",@"parentalControlSettings",@"passwordCredentials",@"publicClient",@"publisherDomain",@"requiredResourceAccess",@"serviceManagementReference",@"signInAudience",@"spa",@"tags",@"tokenEncryptionKeyId",@"web",@"createdOnBehalfOf",@"extensionProperties",@"federatedIdentityCredentials",@"homeRealmDiscoveryPolicies",@"owners",@"tokenIssuancePolicies",@"tokenLifetimePolicies" }) : null; } /// @@ -83,42 +83,42 @@ internal MicrosoftGraphApplication(Microsoft.Azure.PowerShell.Cmdlets.Resources. } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); __microsoftGraphDirectoryObject = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject(json); - {_createdOnBehalfOf = If( json?.PropertyT("createdOnBehalfOf"), out var __jsonCreatedOnBehalfOf) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__jsonCreatedOnBehalfOf) : CreatedOnBehalfOf;} - {_addIn = If( json?.PropertyT("addIns"), out var __jsonAddIns) ? If( __jsonAddIns as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAddIn.FromJson(__u) )) ))() : null : AddIn;} - {_appId = If( json?.PropertyT("appId"), out var __jsonAppId) ? (string)__jsonAppId : (string)AppId;} - {_applicationTemplateId = If( json?.PropertyT("applicationTemplateId"), out var __jsonApplicationTemplateId) ? (string)__jsonApplicationTemplateId : (string)ApplicationTemplateId;} - {_appRole = If( json?.PropertyT("appRoles"), out var __jsonAppRoles) ? If( __jsonAppRoles as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRole.FromJson(__p) )) ))() : null : AppRole;} - {_createdDateTime = If( json?.PropertyT("createdDateTime"), out var __jsonCreatedDateTime) ? global::System.DateTime.TryParse((string)__jsonCreatedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedDateTimeValue) ? __jsonCreatedDateTimeValue : CreatedDateTime : CreatedDateTime;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_disabledByMicrosoftStatus = If( json?.PropertyT("disabledByMicrosoftStatus"), out var __jsonDisabledByMicrosoftStatus) ? (string)__jsonDisabledByMicrosoftStatus : (string)DisabledByMicrosoftStatus;} - {_groupMembershipClaim = If( json?.PropertyT("groupMembershipClaims"), out var __jsonGroupMembershipClaims) ? (string)__jsonGroupMembershipClaims : (string)GroupMembershipClaim;} - {_identifierUri = If( json?.PropertyT("identifierUris"), out var __jsonIdentifierUris) ? If( __jsonIdentifierUris as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : IdentifierUri;} - {_isDeviceOnlyAuthSupported = If( json?.PropertyT("isDeviceOnlyAuthSupported"), out var __jsonIsDeviceOnlyAuthSupported) ? (bool?)__jsonIsDeviceOnlyAuthSupported : IsDeviceOnlyAuthSupported;} - {_isFallbackPublicClient = If( json?.PropertyT("isFallbackPublicClient"), out var __jsonIsFallbackPublicClient) ? (bool?)__jsonIsFallbackPublicClient : IsFallbackPublicClient;} - {_keyCredentials = If( json?.PropertyT("keyCredentials"), out var __jsonKeyCredentials) ? If( __jsonKeyCredentials as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential.FromJson(__f) )) ))() : null : KeyCredentials;} + {_createdOnBehalfOf = If( json?.PropertyT("createdOnBehalfOf"), out var __jsonCreatedOnBehalfOf) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__jsonCreatedOnBehalfOf) : _createdOnBehalfOf;} + {_addIn = If( json?.PropertyT("addIns"), out var __jsonAddIns) ? If( __jsonAddIns as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAddIn.FromJson(__u) )) ))() : null : _addIn;} + {_appId = If( json?.PropertyT("appId"), out var __jsonAppId) ? (string)__jsonAppId : (string)_appId;} + {_applicationTemplateId = If( json?.PropertyT("applicationTemplateId"), out var __jsonApplicationTemplateId) ? (string)__jsonApplicationTemplateId : (string)_applicationTemplateId;} + {_appRole = If( json?.PropertyT("appRoles"), out var __jsonAppRoles) ? If( __jsonAppRoles as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRole.FromJson(__p) )) ))() : null : _appRole;} + {_createdDateTime = If( json?.PropertyT("createdDateTime"), out var __jsonCreatedDateTime) ? global::System.DateTime.TryParse((string)__jsonCreatedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedDateTimeValue) ? __jsonCreatedDateTimeValue : _createdDateTime : _createdDateTime;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_disabledByMicrosoftStatus = If( json?.PropertyT("disabledByMicrosoftStatus"), out var __jsonDisabledByMicrosoftStatus) ? (string)__jsonDisabledByMicrosoftStatus : (string)_disabledByMicrosoftStatus;} + {_groupMembershipClaim = If( json?.PropertyT("groupMembershipClaims"), out var __jsonGroupMembershipClaims) ? (string)__jsonGroupMembershipClaims : (string)_groupMembershipClaim;} + {_identifierUri = If( json?.PropertyT("identifierUris"), out var __jsonIdentifierUris) ? If( __jsonIdentifierUris as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : _identifierUri;} + {_isDeviceOnlyAuthSupported = If( json?.PropertyT("isDeviceOnlyAuthSupported"), out var __jsonIsDeviceOnlyAuthSupported) ? (bool?)__jsonIsDeviceOnlyAuthSupported : _isDeviceOnlyAuthSupported;} + {_isFallbackPublicClient = If( json?.PropertyT("isFallbackPublicClient"), out var __jsonIsFallbackPublicClient) ? (bool?)__jsonIsFallbackPublicClient : _isFallbackPublicClient;} + {_keyCredentials = If( json?.PropertyT("keyCredentials"), out var __jsonKeyCredentials) ? If( __jsonKeyCredentials as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential.FromJson(__f) )) ))() : null : _keyCredentials;} {_logo = If( json?.PropertyT("logo"), out var __c) ? System.Convert.FromBase64String( ((string)__c).Replace("_","/").Replace("-","+").PadRight( ((string)__c).Length + ((string)__c).Length * 3 % 4, '=') ) : null;} - {_note = If( json?.PropertyT("notes"), out var __jsonNotes) ? (string)__jsonNotes : (string)Note;} - {_oauth2RequirePostResponse = If( json?.PropertyT("oauth2RequirePostResponse"), out var __jsonOauth2RequirePostResponse) ? (bool?)__jsonOauth2RequirePostResponse : Oauth2RequirePostResponse;} - {_passwordCredentials = If( json?.PropertyT("passwordCredentials"), out var __jsonPasswordCredentials) ? If( __jsonPasswordCredentials as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___z) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___z, (___y)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential.FromJson(___y) )) ))() : null : PasswordCredentials;} - {_publisherDomain = If( json?.PropertyT("publisherDomain"), out var __jsonPublisherDomain) ? (string)__jsonPublisherDomain : (string)PublisherDomain;} - {_requiredResourceAccess = If( json?.PropertyT("requiredResourceAccess"), out var __jsonRequiredResourceAccess) ? If( __jsonRequiredResourceAccess as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___u) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___u, (___t)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphRequiredResourceAccess) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphRequiredResourceAccess.FromJson(___t) )) ))() : null : RequiredResourceAccess;} - {_serviceManagementReference = If( json?.PropertyT("serviceManagementReference"), out var __jsonServiceManagementReference) ? (string)__jsonServiceManagementReference : (string)ServiceManagementReference;} - {_signInAudience = If( json?.PropertyT("signInAudience"), out var __jsonSignInAudience) ? (string)__jsonSignInAudience : (string)SignInAudience;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? If( __jsonTags as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___p) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___p, (___o)=>(string) (___o is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString ___n ? (string)(___n.ToString()) : null)) ))() : null : Tag;} - {_tokenEncryptionKeyId = If( json?.PropertyT("tokenEncryptionKeyId"), out var __jsonTokenEncryptionKeyId) ? (string)__jsonTokenEncryptionKeyId : (string)TokenEncryptionKeyId;} - {_extensionProperty = If( json?.PropertyT("extensionProperties"), out var __jsonExtensionProperties) ? If( __jsonExtensionProperties as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___k) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___k, (___j)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphExtensionProperty) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphExtensionProperty.FromJson(___j) )) ))() : null : ExtensionProperty;} - {_federatedIdentityCredentials = If( json?.PropertyT("federatedIdentityCredentials"), out var __jsonFederatedIdentityCredentials) ? If( __jsonFederatedIdentityCredentials as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___f) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___f, (___e)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredential.FromJson(___e) )) ))() : null : FederatedIdentityCredentials;} - {_homeRealmDiscoveryPolicy = If( json?.PropertyT("homeRealmDiscoveryPolicies"), out var __jsonHomeRealmDiscoveryPolicies) ? If( __jsonHomeRealmDiscoveryPolicies as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___a) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___a, (____z)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphHomeRealmDiscoveryPolicy.FromJson(____z) )) ))() : null : HomeRealmDiscoveryPolicy;} - {_owner = If( json?.PropertyT("owners"), out var __jsonOwners) ? If( __jsonOwners as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ____v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(____v, (____u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(____u) )) ))() : null : Owner;} - {_tokenIssuancePolicy = If( json?.PropertyT("tokenIssuancePolicies"), out var __jsonTokenIssuancePolicies) ? If( __jsonTokenIssuancePolicies as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ____q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(____q, (____p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphTokenIssuancePolicy.FromJson(____p) )) ))() : null : TokenIssuancePolicy;} - {_tokenLifetimePolicy = If( json?.PropertyT("tokenLifetimePolicies"), out var __jsonTokenLifetimePolicies) ? If( __jsonTokenLifetimePolicies as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ____l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(____l, (____k)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphTokenLifetimePolicy.FromJson(____k) )) ))() : null : TokenLifetimePolicy;} - {_api = If( json?.PropertyT("api"), out var __jsonApi) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphApiApplication.FromJson(__jsonApi) : Api;} - {_info = If( json?.PropertyT("info"), out var __jsonInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphInformationalUrl.FromJson(__jsonInfo) : Info;} - {_optionalClaim = If( json?.PropertyT("optionalClaims"), out var __jsonOptionalClaims) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOptionalClaims.FromJson(__jsonOptionalClaims) : OptionalClaim;} - {_parentalControlSetting = If( json?.PropertyT("parentalControlSettings"), out var __jsonParentalControlSettings) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphParentalControlSettings.FromJson(__jsonParentalControlSettings) : ParentalControlSetting;} - {_publicClient = If( json?.PropertyT("publicClient"), out var __jsonPublicClient) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPublicClientApplication.FromJson(__jsonPublicClient) : PublicClient;} - {_spa = If( json?.PropertyT("spa"), out var __jsonSpa) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSpaApplication.FromJson(__jsonSpa) : Spa;} - {_web = If( json?.PropertyT("web"), out var __jsonWeb) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphWebApplication.FromJson(__jsonWeb) : Web;} + {_note = If( json?.PropertyT("notes"), out var __jsonNotes) ? (string)__jsonNotes : (string)_note;} + {_oauth2RequirePostResponse = If( json?.PropertyT("oauth2RequirePostResponse"), out var __jsonOauth2RequirePostResponse) ? (bool?)__jsonOauth2RequirePostResponse : _oauth2RequirePostResponse;} + {_passwordCredentials = If( json?.PropertyT("passwordCredentials"), out var __jsonPasswordCredentials) ? If( __jsonPasswordCredentials as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___z) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___z, (___y)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential.FromJson(___y) )) ))() : null : _passwordCredentials;} + {_publisherDomain = If( json?.PropertyT("publisherDomain"), out var __jsonPublisherDomain) ? (string)__jsonPublisherDomain : (string)_publisherDomain;} + {_requiredResourceAccess = If( json?.PropertyT("requiredResourceAccess"), out var __jsonRequiredResourceAccess) ? If( __jsonRequiredResourceAccess as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___u) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___u, (___t)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphRequiredResourceAccess) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphRequiredResourceAccess.FromJson(___t) )) ))() : null : _requiredResourceAccess;} + {_serviceManagementReference = If( json?.PropertyT("serviceManagementReference"), out var __jsonServiceManagementReference) ? (string)__jsonServiceManagementReference : (string)_serviceManagementReference;} + {_signInAudience = If( json?.PropertyT("signInAudience"), out var __jsonSignInAudience) ? (string)__jsonSignInAudience : (string)_signInAudience;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? If( __jsonTags as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___p) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___p, (___o)=>(string) (___o is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString ___n ? (string)(___n.ToString()) : null)) ))() : null : _tag;} + {_tokenEncryptionKeyId = If( json?.PropertyT("tokenEncryptionKeyId"), out var __jsonTokenEncryptionKeyId) ? (string)__jsonTokenEncryptionKeyId : (string)_tokenEncryptionKeyId;} + {_extensionProperty = If( json?.PropertyT("extensionProperties"), out var __jsonExtensionProperties) ? If( __jsonExtensionProperties as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___k) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___k, (___j)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphExtensionProperty) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphExtensionProperty.FromJson(___j) )) ))() : null : _extensionProperty;} + {_federatedIdentityCredentials = If( json?.PropertyT("federatedIdentityCredentials"), out var __jsonFederatedIdentityCredentials) ? If( __jsonFederatedIdentityCredentials as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___f) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___f, (___e)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredential.FromJson(___e) )) ))() : null : _federatedIdentityCredentials;} + {_homeRealmDiscoveryPolicy = If( json?.PropertyT("homeRealmDiscoveryPolicies"), out var __jsonHomeRealmDiscoveryPolicies) ? If( __jsonHomeRealmDiscoveryPolicies as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___a) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___a, (____z)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphHomeRealmDiscoveryPolicy.FromJson(____z) )) ))() : null : _homeRealmDiscoveryPolicy;} + {_owner = If( json?.PropertyT("owners"), out var __jsonOwners) ? If( __jsonOwners as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ____v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(____v, (____u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(____u) )) ))() : null : _owner;} + {_tokenIssuancePolicy = If( json?.PropertyT("tokenIssuancePolicies"), out var __jsonTokenIssuancePolicies) ? If( __jsonTokenIssuancePolicies as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ____q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(____q, (____p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphTokenIssuancePolicy.FromJson(____p) )) ))() : null : _tokenIssuancePolicy;} + {_tokenLifetimePolicy = If( json?.PropertyT("tokenLifetimePolicies"), out var __jsonTokenLifetimePolicies) ? If( __jsonTokenLifetimePolicies as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ____l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(____l, (____k)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphTokenLifetimePolicy.FromJson(____k) )) ))() : null : _tokenLifetimePolicy;} + {_api = If( json?.PropertyT("api"), out var __jsonApi) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphApiApplication.FromJson(__jsonApi) : _api;} + {_info = If( json?.PropertyT("info"), out var __jsonInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphInformationalUrl.FromJson(__jsonInfo) : _info;} + {_optionalClaim = If( json?.PropertyT("optionalClaims"), out var __jsonOptionalClaims) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOptionalClaims.FromJson(__jsonOptionalClaims) : _optionalClaim;} + {_parentalControlSetting = If( json?.PropertyT("parentalControlSettings"), out var __jsonParentalControlSettings) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphParentalControlSettings.FromJson(__jsonParentalControlSettings) : _parentalControlSetting;} + {_publicClient = If( json?.PropertyT("publicClient"), out var __jsonPublicClient) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPublicClientApplication.FromJson(__jsonPublicClient) : _publicClient;} + {_spa = If( json?.PropertyT("spa"), out var __jsonSpa) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSpaApplication.FromJson(__jsonSpa) : _spa;} + {_web = If( json?.PropertyT("web"), out var __jsonWeb) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphWebApplication.FromJson(__jsonWeb) : _web;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAssignedPlan.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAssignedPlan.json.cs index 2f8169e7c7aa..7ce102e80542 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAssignedPlan.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphAssignedPlan.json.cs @@ -79,10 +79,10 @@ internal MicrosoftGraphAssignedPlan(Microsoft.Azure.PowerShell.Cmdlets.Resources return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_assignedDateTime = If( json?.PropertyT("assignedDateTime"), out var __jsonAssignedDateTime) ? global::System.DateTime.TryParse((string)__jsonAssignedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonAssignedDateTimeValue) ? __jsonAssignedDateTimeValue : AssignedDateTime : AssignedDateTime;} - {_capabilityStatus = If( json?.PropertyT("capabilityStatus"), out var __jsonCapabilityStatus) ? (string)__jsonCapabilityStatus : (string)CapabilityStatus;} - {_service = If( json?.PropertyT("service"), out var __jsonService) ? (string)__jsonService : (string)Service;} - {_servicePlanId = If( json?.PropertyT("servicePlanId"), out var __jsonServicePlanId) ? (string)__jsonServicePlanId : (string)ServicePlanId;} + {_assignedDateTime = If( json?.PropertyT("assignedDateTime"), out var __jsonAssignedDateTime) ? global::System.DateTime.TryParse((string)__jsonAssignedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonAssignedDateTimeValue) ? __jsonAssignedDateTimeValue : _assignedDateTime : _assignedDateTime;} + {_capabilityStatus = If( json?.PropertyT("capabilityStatus"), out var __jsonCapabilityStatus) ? (string)__jsonCapabilityStatus : (string)_capabilityStatus;} + {_service = If( json?.PropertyT("service"), out var __jsonService) ? (string)__jsonService : (string)_service;} + {_servicePlanId = If( json?.PropertyT("servicePlanId"), out var __jsonServicePlanId) ? (string)__jsonServicePlanId : (string)_servicePlanId;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphCertificateAuthority.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphCertificateAuthority.json.cs index be6f21252c4e..b3a3a897f09c 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphCertificateAuthority.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphCertificateAuthority.json.cs @@ -80,11 +80,11 @@ internal MicrosoftGraphCertificateAuthority(Microsoft.Azure.PowerShell.Cmdlets.R } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); {_certificate = If( json?.PropertyT("certificate"), out var __w) ? System.Convert.FromBase64String( ((string)__w).Replace("_","/").Replace("-","+").PadRight( ((string)__w).Length + ((string)__w).Length * 3 % 4, '=') ) : null;} - {_certificateRevocationListUrl = If( json?.PropertyT("certificateRevocationListUrl"), out var __jsonCertificateRevocationListUrl) ? (string)__jsonCertificateRevocationListUrl : (string)CertificateRevocationListUrl;} - {_deltaCertificateRevocationListUrl = If( json?.PropertyT("deltaCertificateRevocationListUrl"), out var __jsonDeltaCertificateRevocationListUrl) ? (string)__jsonDeltaCertificateRevocationListUrl : (string)DeltaCertificateRevocationListUrl;} - {_isRootAuthority = If( json?.PropertyT("isRootAuthority"), out var __jsonIsRootAuthority) ? (bool?)__jsonIsRootAuthority : IsRootAuthority;} - {_issuer = If( json?.PropertyT("issuer"), out var __jsonIssuer) ? (string)__jsonIssuer : (string)Issuer;} - {_issuerSki = If( json?.PropertyT("issuerSki"), out var __jsonIssuerSki) ? (string)__jsonIssuerSki : (string)IssuerSki;} + {_certificateRevocationListUrl = If( json?.PropertyT("certificateRevocationListUrl"), out var __jsonCertificateRevocationListUrl) ? (string)__jsonCertificateRevocationListUrl : (string)_certificateRevocationListUrl;} + {_deltaCertificateRevocationListUrl = If( json?.PropertyT("deltaCertificateRevocationListUrl"), out var __jsonDeltaCertificateRevocationListUrl) ? (string)__jsonDeltaCertificateRevocationListUrl : (string)_deltaCertificateRevocationListUrl;} + {_isRootAuthority = If( json?.PropertyT("isRootAuthority"), out var __jsonIsRootAuthority) ? (bool?)__jsonIsRootAuthority : _isRootAuthority;} + {_issuer = If( json?.PropertyT("issuer"), out var __jsonIssuer) ? (string)__jsonIssuer : (string)_issuer;} + {_issuerSki = If( json?.PropertyT("issuerSki"), out var __jsonIssuerSki) ? (string)__jsonIssuerSki : (string)_issuerSki;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphCertificateBasedAuthConfiguration.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphCertificateBasedAuthConfiguration.json.cs index 72f1010d04e5..8929552d9fd6 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphCertificateBasedAuthConfiguration.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphCertificateBasedAuthConfiguration.json.cs @@ -80,7 +80,7 @@ internal MicrosoftGraphCertificateBasedAuthConfiguration(Microsoft.Azure.PowerSh return; } __microsoftGraphEntity = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEntity(json,new global::System.Collections.Generic.HashSet(){ @"id",@"certificateAuthorities" }); - {_certificateAuthority = If( json?.PropertyT("certificateAuthorities"), out var __jsonCertificateAuthorities) ? If( __jsonCertificateAuthorities as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphCertificateAuthority) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphCertificateAuthority.FromJson(__u) )) ))() : null : CertificateAuthority;} + {_certificateAuthority = If( json?.PropertyT("certificateAuthorities"), out var __jsonCertificateAuthorities) ? If( __jsonCertificateAuthorities as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphCertificateAuthority) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphCertificateAuthority.FromJson(__u) )) ))() : null : _certificateAuthority;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphClaimsMappingPolicy.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphClaimsMappingPolicy.cs index 513ea606968c..c8990d95b840 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphClaimsMappingPolicy.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphClaimsMappingPolicy.cs @@ -23,14 +23,14 @@ public partial class MicrosoftGraphClaimsMappingPolicy : private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicy __microsoftGraphStsPolicy = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphStsPolicy(); [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject[] AppliesTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).AppliesTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).AppliesTo = value ?? null /* arrayOf */; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject[] AppliesTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).AppliesTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).AppliesTo = value ?? null /* fixedArrayOf */; } /// /// A string collection containing a JSON string that defines the rules and settings for a policy. The syntax for the definition /// differs for each derived policy type. Required. /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string[] Definition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).Definition = value ?? null /* arrayOf */; } + public string[] Definition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).Definition = value ?? null /* fixedArrayOf */; } [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] public global::System.DateTime? DeletedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).DeletedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).DeletedDateTime = value ?? default(global::System.DateTime); } @@ -57,9 +57,6 @@ public partial class MicrosoftGraphClaimsMappingPolicy : /// Internal Acessors for OdataId string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataId = value; } - /// Internal Acessors for OdataType - string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataType = value; } - /// Internal Acessors for Id string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphStsPolicy).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphStsPolicy).Id = value; } @@ -68,8 +65,9 @@ public partial class MicrosoftGraphClaimsMappingPolicy : public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataId; } /// The type of object in directory + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataType; } + public string OdataType { get => "microsoft.graph.claimsMappingPolicy"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataType = "microsoft.graph.claimsMappingPolicy"; } /// Creates an new instance. public MicrosoftGraphClaimsMappingPolicy() diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphClaimsMappingPolicy.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphClaimsMappingPolicy.json.cs index 458ce8075c28..9a3caa623cc5 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphClaimsMappingPolicy.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphClaimsMappingPolicy.json.cs @@ -65,7 +65,7 @@ public partial class MicrosoftGraphClaimsMappingPolicy /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphClaimsMappingPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphClaimsMappingPolicy(json, new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"definition",@"isOrganizationDefault",@"appliesTo" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphClaimsMappingPolicy(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"definition",@"isOrganizationDefault",@"appliesTo" }) : null; } /// @@ -81,7 +81,7 @@ internal MicrosoftGraphClaimsMappingPolicy(Microsoft.Azure.PowerShell.Cmdlets.Re { return; } - __microsoftGraphStsPolicy = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphStsPolicy(json,new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"definition",@"isOrganizationDefault",@"appliesTo" }); + __microsoftGraphStsPolicy = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphStsPolicy(json,new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"definition",@"isOrganizationDefault",@"appliesTo" }); AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphContract.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphContract.cs index e1fa3987dc38..e2e64e38d427 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphContract.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphContract.cs @@ -62,9 +62,6 @@ public partial class MicrosoftGraphContract : /// Internal Acessors for OdataId string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId = value; } - /// Internal Acessors for OdataType - string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = value; } - /// Internal Acessors for Id string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id = value; } @@ -73,8 +70,9 @@ public partial class MicrosoftGraphContract : public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; } /// The type of object in directory + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; } + public string OdataType { get => "microsoft.graph.contract"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = "microsoft.graph.contract"; } /// Creates an new instance. public MicrosoftGraphContract() diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphContract.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphContract.json.cs index f651b979a444..80c266066f00 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphContract.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphContract.json.cs @@ -62,7 +62,7 @@ public partial class MicrosoftGraphContract /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphContract FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphContract(json, new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"contractType",@"customerId",@"defaultDomainName" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphContract(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"contractType",@"customerId",@"defaultDomainName" }) : null; } /// @@ -80,9 +80,9 @@ internal MicrosoftGraphContract(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSG } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); __microsoftGraphDirectoryObject = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject(json); - {_contractType = If( json?.PropertyT("contractType"), out var __jsonContractType) ? (string)__jsonContractType : (string)ContractType;} - {_customerId = If( json?.PropertyT("customerId"), out var __jsonCustomerId) ? (string)__jsonCustomerId : (string)CustomerId;} - {_defaultDomainName = If( json?.PropertyT("defaultDomainName"), out var __jsonDefaultDomainName) ? (string)__jsonDefaultDomainName : (string)DefaultDomainName;} + {_contractType = If( json?.PropertyT("contractType"), out var __jsonContractType) ? (string)__jsonContractType : (string)_contractType;} + {_customerId = If( json?.PropertyT("customerId"), out var __jsonCustomerId) ? (string)__jsonCustomerId : (string)_customerId;} + {_defaultDomainName = If( json?.PropertyT("defaultDomainName"), out var __jsonDefaultDomainName) ? (string)__jsonDefaultDomainName : (string)_defaultDomainName;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphContractCollectionResponse.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphContractCollectionResponse.json.cs index fa95f1e1c549..35dd044c46ee 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphContractCollectionResponse.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphContractCollectionResponse.json.cs @@ -79,8 +79,8 @@ internal MicrosoftGraphContractCollectionResponse(Microsoft.Azure.PowerShell.Cmd return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphContract) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphContract.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphContract) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphContract.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDelegatedPermissionClassification.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDelegatedPermissionClassification.json.cs index a4b64b25682c..0868f4fb8979 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDelegatedPermissionClassification.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDelegatedPermissionClassification.json.cs @@ -62,7 +62,7 @@ public partial class MicrosoftGraphDelegatedPermissionClassification /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDelegatedPermissionClassification FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphDelegatedPermissionClassification(json, new global::System.Collections.Generic.HashSet(){ @"id",@"classification",@"permissionId",@"permissionName" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphDelegatedPermissionClassification(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"classification",@"permissionId",@"permissionName" }) : null; } /// @@ -81,9 +81,9 @@ internal MicrosoftGraphDelegatedPermissionClassification(Microsoft.Azure.PowerSh } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); __microsoftGraphEntityAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEntityAutoGenerated(json); - {_classification = If( json?.PropertyT("classification"), out var __jsonClassification) ? (string)__jsonClassification : (string)Classification;} - {_permissionId = If( json?.PropertyT("permissionId"), out var __jsonPermissionId) ? (string)__jsonPermissionId : (string)PermissionId;} - {_permissionName = If( json?.PropertyT("permissionName"), out var __jsonPermissionName) ? (string)__jsonPermissionName : (string)PermissionName;} + {_classification = If( json?.PropertyT("classification"), out var __jsonClassification) ? (string)__jsonClassification : (string)_classification;} + {_permissionId = If( json?.PropertyT("permissionId"), out var __jsonPermissionId) ? (string)__jsonPermissionId : (string)_permissionId;} + {_permissionName = If( json?.PropertyT("permissionName"), out var __jsonPermissionName) ? (string)__jsonPermissionName : (string)_permissionName;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDevice.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDevice.cs index af25a8b52dd6..13868494080f 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDevice.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDevice.cs @@ -140,9 +140,6 @@ public partial class MicrosoftGraphDevice : /// Internal Acessors for OdataId string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId = value; } - /// Internal Acessors for OdataType - string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = value; } - /// Internal Acessors for Id string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id = value; } @@ -151,8 +148,9 @@ public partial class MicrosoftGraphDevice : public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; } /// The type of object in directory + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; } + public string OdataType { get => "microsoft.graph.device"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = "microsoft.graph.device"; } /// Backing field for property. private global::System.DateTime? _onPremisesLastSyncDateTime; diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDevice.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDevice.json.cs index c851f907092e..f5336b6cd8b4 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDevice.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDevice.json.cs @@ -62,7 +62,7 @@ public partial class MicrosoftGraphDevice /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDevice FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphDevice(json, new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"accountEnabled",@"alternativeSecurityIds",@"approximateLastSignInDateTime",@"complianceExpirationDateTime",@"deviceId",@"deviceMetadata",@"deviceVersion",@"isCompliant",@"isManaged",@"mdmAppId",@"onPremisesLastSyncDateTime",@"onPremisesSyncEnabled",@"operatingSystem",@"operatingSystemVersion",@"physicalIds",@"profileType",@"systemLabels",@"trustType",@"memberOf",@"registeredOwners",@"registeredUsers",@"transitiveMemberOf",@"extensions" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphDevice(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"accountEnabled",@"alternativeSecurityIds",@"approximateLastSignInDateTime",@"complianceExpirationDateTime",@"deviceId",@"deviceMetadata",@"deviceVersion",@"isCompliant",@"isManaged",@"mdmAppId",@"onPremisesLastSyncDateTime",@"onPremisesSyncEnabled",@"operatingSystem",@"operatingSystemVersion",@"physicalIds",@"profileType",@"systemLabels",@"trustType",@"memberOf",@"registeredOwners",@"registeredUsers",@"transitiveMemberOf",@"extensions" }) : null; } /// @@ -80,29 +80,29 @@ internal MicrosoftGraphDevice(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGra } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); __microsoftGraphDirectoryObject = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject(json); - {_accountEnabled = If( json?.PropertyT("accountEnabled"), out var __jsonAccountEnabled) ? (bool?)__jsonAccountEnabled : AccountEnabled;} - {_alternativeSecurityId = If( json?.PropertyT("alternativeSecurityIds"), out var __jsonAlternativeSecurityIds) ? If( __jsonAlternativeSecurityIds as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAlternativeSecurityId) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAlternativeSecurityId.FromJson(__u) )) ))() : null : AlternativeSecurityId;} - {_approximateLastSignInDateTime = If( json?.PropertyT("approximateLastSignInDateTime"), out var __jsonApproximateLastSignInDateTime) ? global::System.DateTime.TryParse((string)__jsonApproximateLastSignInDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonApproximateLastSignInDateTimeValue) ? __jsonApproximateLastSignInDateTimeValue : ApproximateLastSignInDateTime : ApproximateLastSignInDateTime;} - {_complianceExpirationDateTime = If( json?.PropertyT("complianceExpirationDateTime"), out var __jsonComplianceExpirationDateTime) ? global::System.DateTime.TryParse((string)__jsonComplianceExpirationDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonComplianceExpirationDateTimeValue) ? __jsonComplianceExpirationDateTimeValue : ComplianceExpirationDateTime : ComplianceExpirationDateTime;} - {_deviceId = If( json?.PropertyT("deviceId"), out var __jsonDeviceId) ? (string)__jsonDeviceId : (string)DeviceId;} - {_deviceMetadata = If( json?.PropertyT("deviceMetadata"), out var __jsonDeviceMetadata) ? (string)__jsonDeviceMetadata : (string)DeviceMetadata;} - {_deviceVersion = If( json?.PropertyT("deviceVersion"), out var __jsonDeviceVersion) ? (int?)__jsonDeviceVersion : DeviceVersion;} - {_isCompliant = If( json?.PropertyT("isCompliant"), out var __jsonIsCompliant) ? (bool?)__jsonIsCompliant : IsCompliant;} - {_isManaged = If( json?.PropertyT("isManaged"), out var __jsonIsManaged) ? (bool?)__jsonIsManaged : IsManaged;} - {_mdmAppId = If( json?.PropertyT("mdmAppId"), out var __jsonMdmAppId) ? (string)__jsonMdmAppId : (string)MdmAppId;} - {_onPremisesLastSyncDateTime = If( json?.PropertyT("onPremisesLastSyncDateTime"), out var __jsonOnPremisesLastSyncDateTime) ? global::System.DateTime.TryParse((string)__jsonOnPremisesLastSyncDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonOnPremisesLastSyncDateTimeValue) ? __jsonOnPremisesLastSyncDateTimeValue : OnPremisesLastSyncDateTime : OnPremisesLastSyncDateTime;} - {_onPremisesSyncEnabled = If( json?.PropertyT("onPremisesSyncEnabled"), out var __jsonOnPremisesSyncEnabled) ? (bool?)__jsonOnPremisesSyncEnabled : OnPremisesSyncEnabled;} - {_operatingSystem = If( json?.PropertyT("operatingSystem"), out var __jsonOperatingSystem) ? (string)__jsonOperatingSystem : (string)OperatingSystem;} - {_operatingSystemVersion = If( json?.PropertyT("operatingSystemVersion"), out var __jsonOperatingSystemVersion) ? (string)__jsonOperatingSystemVersion : (string)OperatingSystemVersion;} - {_physicalId = If( json?.PropertyT("physicalIds"), out var __jsonPhysicalIds) ? If( __jsonPhysicalIds as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : PhysicalId;} - {_profileType = If( json?.PropertyT("profileType"), out var __jsonProfileType) ? (string)__jsonProfileType : (string)ProfileType;} - {_systemLabel = If( json?.PropertyT("systemLabels"), out var __jsonSystemLabels) ? If( __jsonSystemLabels as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : SystemLabel;} - {_trustType = If( json?.PropertyT("trustType"), out var __jsonTrustType) ? (string)__jsonTrustType : (string)TrustType;} - {_memberOf = If( json?.PropertyT("memberOf"), out var __jsonMemberOf) ? If( __jsonMemberOf as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__f) )) ))() : null : MemberOf;} - {_registeredOwner = If( json?.PropertyT("registeredOwners"), out var __jsonRegisteredOwners) ? If( __jsonRegisteredOwners as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__a) )) ))() : null : RegisteredOwner;} - {_registeredUser = If( json?.PropertyT("registeredUsers"), out var __jsonRegisteredUsers) ? If( __jsonRegisteredUsers as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___w) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___w, (___v)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(___v) )) ))() : null : RegisteredUser;} - {_transitiveMemberOf = If( json?.PropertyT("transitiveMemberOf"), out var __jsonTransitiveMemberOf) ? If( __jsonTransitiveMemberOf as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___r) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___r, (___q)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(___q) )) ))() : null : TransitiveMemberOf;} - {_extension = If( json?.PropertyT("extensions"), out var __jsonExtensions) ? If( __jsonExtensions as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___m) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___m, (___l)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphExtension) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphExtension.FromJson(___l) )) ))() : null : Extension;} + {_accountEnabled = If( json?.PropertyT("accountEnabled"), out var __jsonAccountEnabled) ? (bool?)__jsonAccountEnabled : _accountEnabled;} + {_alternativeSecurityId = If( json?.PropertyT("alternativeSecurityIds"), out var __jsonAlternativeSecurityIds) ? If( __jsonAlternativeSecurityIds as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAlternativeSecurityId) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAlternativeSecurityId.FromJson(__u) )) ))() : null : _alternativeSecurityId;} + {_approximateLastSignInDateTime = If( json?.PropertyT("approximateLastSignInDateTime"), out var __jsonApproximateLastSignInDateTime) ? global::System.DateTime.TryParse((string)__jsonApproximateLastSignInDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonApproximateLastSignInDateTimeValue) ? __jsonApproximateLastSignInDateTimeValue : _approximateLastSignInDateTime : _approximateLastSignInDateTime;} + {_complianceExpirationDateTime = If( json?.PropertyT("complianceExpirationDateTime"), out var __jsonComplianceExpirationDateTime) ? global::System.DateTime.TryParse((string)__jsonComplianceExpirationDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonComplianceExpirationDateTimeValue) ? __jsonComplianceExpirationDateTimeValue : _complianceExpirationDateTime : _complianceExpirationDateTime;} + {_deviceId = If( json?.PropertyT("deviceId"), out var __jsonDeviceId) ? (string)__jsonDeviceId : (string)_deviceId;} + {_deviceMetadata = If( json?.PropertyT("deviceMetadata"), out var __jsonDeviceMetadata) ? (string)__jsonDeviceMetadata : (string)_deviceMetadata;} + {_deviceVersion = If( json?.PropertyT("deviceVersion"), out var __jsonDeviceVersion) ? (int?)__jsonDeviceVersion : _deviceVersion;} + {_isCompliant = If( json?.PropertyT("isCompliant"), out var __jsonIsCompliant) ? (bool?)__jsonIsCompliant : _isCompliant;} + {_isManaged = If( json?.PropertyT("isManaged"), out var __jsonIsManaged) ? (bool?)__jsonIsManaged : _isManaged;} + {_mdmAppId = If( json?.PropertyT("mdmAppId"), out var __jsonMdmAppId) ? (string)__jsonMdmAppId : (string)_mdmAppId;} + {_onPremisesLastSyncDateTime = If( json?.PropertyT("onPremisesLastSyncDateTime"), out var __jsonOnPremisesLastSyncDateTime) ? global::System.DateTime.TryParse((string)__jsonOnPremisesLastSyncDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonOnPremisesLastSyncDateTimeValue) ? __jsonOnPremisesLastSyncDateTimeValue : _onPremisesLastSyncDateTime : _onPremisesLastSyncDateTime;} + {_onPremisesSyncEnabled = If( json?.PropertyT("onPremisesSyncEnabled"), out var __jsonOnPremisesSyncEnabled) ? (bool?)__jsonOnPremisesSyncEnabled : _onPremisesSyncEnabled;} + {_operatingSystem = If( json?.PropertyT("operatingSystem"), out var __jsonOperatingSystem) ? (string)__jsonOperatingSystem : (string)_operatingSystem;} + {_operatingSystemVersion = If( json?.PropertyT("operatingSystemVersion"), out var __jsonOperatingSystemVersion) ? (string)__jsonOperatingSystemVersion : (string)_operatingSystemVersion;} + {_physicalId = If( json?.PropertyT("physicalIds"), out var __jsonPhysicalIds) ? If( __jsonPhysicalIds as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _physicalId;} + {_profileType = If( json?.PropertyT("profileType"), out var __jsonProfileType) ? (string)__jsonProfileType : (string)_profileType;} + {_systemLabel = If( json?.PropertyT("systemLabels"), out var __jsonSystemLabels) ? If( __jsonSystemLabels as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : _systemLabel;} + {_trustType = If( json?.PropertyT("trustType"), out var __jsonTrustType) ? (string)__jsonTrustType : (string)_trustType;} + {_memberOf = If( json?.PropertyT("memberOf"), out var __jsonMemberOf) ? If( __jsonMemberOf as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__f) )) ))() : null : _memberOf;} + {_registeredOwner = If( json?.PropertyT("registeredOwners"), out var __jsonRegisteredOwners) ? If( __jsonRegisteredOwners as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__a) )) ))() : null : _registeredOwner;} + {_registeredUser = If( json?.PropertyT("registeredUsers"), out var __jsonRegisteredUsers) ? If( __jsonRegisteredUsers as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___w) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___w, (___v)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(___v) )) ))() : null : _registeredUser;} + {_transitiveMemberOf = If( json?.PropertyT("transitiveMemberOf"), out var __jsonTransitiveMemberOf) ? If( __jsonTransitiveMemberOf as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___r) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___r, (___q)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(___q) )) ))() : null : _transitiveMemberOf;} + {_extension = If( json?.PropertyT("extensions"), out var __jsonExtensions) ? If( __jsonExtensions as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___m) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___m, (___l)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphExtension) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphExtension.FromJson(___l) )) ))() : null : _extension;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDeviceCollectionResponse.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDeviceCollectionResponse.json.cs index b2d16bdbaa4c..2d2742b79c34 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDeviceCollectionResponse.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDeviceCollectionResponse.json.cs @@ -79,8 +79,8 @@ internal MicrosoftGraphDeviceCollectionResponse(Microsoft.Azure.PowerShell.Cmdle return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDevice) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDevice.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDevice) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDevice.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectory.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectory.json.cs index c42cfb56016c..991a0bbd6579 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectory.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectory.json.cs @@ -79,9 +79,9 @@ internal MicrosoftGraphDirectory(Microsoft.Azure.PowerShell.Cmdlets.Resources.MS return; } __microsoftGraphEntity = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEntity(json,new global::System.Collections.Generic.HashSet(){ @"id",@"administrativeUnits",@"deletedItems",@"federationConfigurations" }); - {_administrativeUnit = If( json?.PropertyT("administrativeUnits"), out var __jsonAdministrativeUnits) ? If( __jsonAdministrativeUnits as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAdministrativeUnit) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAdministrativeUnit.FromJson(__u) )) ))() : null : AdministrativeUnit;} - {_deletedItem = If( json?.PropertyT("deletedItems"), out var __jsonDeletedItems) ? If( __jsonDeletedItems as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__p) )) ))() : null : DeletedItem;} - {_federationConfiguration = If( json?.PropertyT("federationConfigurations"), out var __jsonFederationConfigurations) ? If( __jsonFederationConfigurations as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphIdentityProviderBase) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphIdentityProviderBase.FromJson(__k) )) ))() : null : FederationConfiguration;} + {_administrativeUnit = If( json?.PropertyT("administrativeUnits"), out var __jsonAdministrativeUnits) ? If( __jsonAdministrativeUnits as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAdministrativeUnit) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAdministrativeUnit.FromJson(__u) )) ))() : null : _administrativeUnit;} + {_deletedItem = If( json?.PropertyT("deletedItems"), out var __jsonDeletedItems) ? If( __jsonDeletedItems as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__p) )) ))() : null : _deletedItem;} + {_federationConfiguration = If( json?.PropertyT("federationConfigurations"), out var __jsonFederationConfigurations) ? If( __jsonFederationConfigurations as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphIdentityProviderBase) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphIdentityProviderBase.FromJson(__k) )) ))() : null : _federationConfiguration;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryObject.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryObject.json.cs index f30e637bf269..f70e4f2e5869 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryObject.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryObject.json.cs @@ -176,10 +176,10 @@ internal MicrosoftGraphDirectoryObject(Microsoft.Azure.PowerShell.Cmdlets.Resour return; } __microsoftGraphEntityAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEntityAutoGenerated(json); - {_deletedDateTime = If( json?.PropertyT("deletedDateTime"), out var __jsonDeletedDateTime) ? global::System.DateTime.TryParse((string)__jsonDeletedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonDeletedDateTimeValue) ? __jsonDeletedDateTimeValue : DeletedDateTime : DeletedDateTime;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_odataType = If( json?.PropertyT("@odata.type"), out var __jsonOdataType) ? (string)__jsonOdataType : (string)OdataType;} - {_odataId = If( json?.PropertyT("@odata.id"), out var __jsonOdataId) ? (string)__jsonOdataId : (string)OdataId;} + {_deletedDateTime = If( json?.PropertyT("deletedDateTime"), out var __jsonDeletedDateTime) ? global::System.DateTime.TryParse((string)__jsonDeletedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonDeletedDateTimeValue) ? __jsonDeletedDateTimeValue : _deletedDateTime : _deletedDateTime;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_odataType = If( json?.PropertyT("@odata.type"), out var __jsonOdataType) ? (string)__jsonOdataType : (string)_odataType;} + {_odataId = If( json?.PropertyT("@odata.id"), out var __jsonOdataId) ? (string)__jsonOdataId : (string)_odataId;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryObjectCollectionResponse.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryObjectCollectionResponse.json.cs index eca6cbcea3d3..4380d872464c 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryObjectCollectionResponse.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryObjectCollectionResponse.json.cs @@ -80,8 +80,8 @@ internal MicrosoftGraphDirectoryObjectCollectionResponse(Microsoft.Azure.PowerSh return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRole.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRole.cs index c3ab322754d6..8fc29624a678 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRole.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRole.cs @@ -51,9 +51,6 @@ public partial class MicrosoftGraphDirectoryRole : /// Internal Acessors for OdataId string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId = value; } - /// Internal Acessors for OdataType - string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = value; } - /// Internal Acessors for Id string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id = value; } @@ -62,8 +59,9 @@ public partial class MicrosoftGraphDirectoryRole : public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; } /// The type of object in directory + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; } + public string OdataType { get => "microsoft.graph.directoryRole"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = "microsoft.graph.directoryRole"; } /// Backing field for property. private string _roleTemplateId; diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRole.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRole.json.cs index bcdedba6e9c4..d47bab3d6a97 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRole.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRole.json.cs @@ -62,7 +62,7 @@ public partial class MicrosoftGraphDirectoryRole /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryRole FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphDirectoryRole(json, new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"roleTemplateId",@"members",@"scopedMembers" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphDirectoryRole(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"roleTemplateId",@"members",@"scopedMembers" }) : null; } /// @@ -80,10 +80,10 @@ internal MicrosoftGraphDirectoryRole(Microsoft.Azure.PowerShell.Cmdlets.Resource } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); __microsoftGraphDirectoryObject = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject(json); - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_roleTemplateId = If( json?.PropertyT("roleTemplateId"), out var __jsonRoleTemplateId) ? (string)__jsonRoleTemplateId : (string)RoleTemplateId;} - {_member = If( json?.PropertyT("members"), out var __jsonMembers) ? If( __jsonMembers as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__u) )) ))() : null : Member;} - {_scopedMember = If( json?.PropertyT("scopedMembers"), out var __jsonScopedMembers) ? If( __jsonScopedMembers as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphScopedRoleMembership) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphScopedRoleMembership.FromJson(__p) )) ))() : null : ScopedMember;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_roleTemplateId = If( json?.PropertyT("roleTemplateId"), out var __jsonRoleTemplateId) ? (string)__jsonRoleTemplateId : (string)_roleTemplateId;} + {_member = If( json?.PropertyT("members"), out var __jsonMembers) ? If( __jsonMembers as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__u) )) ))() : null : _member;} + {_scopedMember = If( json?.PropertyT("scopedMembers"), out var __jsonScopedMembers) ? If( __jsonScopedMembers as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphScopedRoleMembership) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphScopedRoleMembership.FromJson(__p) )) ))() : null : _scopedMember;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRoleCollectionResponse.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRoleCollectionResponse.json.cs index 03779141b56d..2c11296ac4f2 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRoleCollectionResponse.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRoleCollectionResponse.json.cs @@ -80,8 +80,8 @@ internal MicrosoftGraphDirectoryRoleCollectionResponse(Microsoft.Azure.PowerShel return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryRole) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryRole.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryRole) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryRole.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRoleTemplate.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRoleTemplate.cs index 6225d2fa4a0e..2756b953bf21 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRoleTemplate.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRoleTemplate.cs @@ -40,9 +40,6 @@ public partial class MicrosoftGraphDirectoryRoleTemplate : /// Internal Acessors for OdataId string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId = value; } - /// Internal Acessors for OdataType - string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = value; } - /// Internal Acessors for Id string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id = value; } @@ -51,8 +48,9 @@ public partial class MicrosoftGraphDirectoryRoleTemplate : public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; } /// The type of object in directory + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; } + public string OdataType { get => "microsoft.graph.directoryRoleTemplate"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = "microsoft.graph.directoryRoleTemplate"; } /// Creates an new instance. public MicrosoftGraphDirectoryRoleTemplate() diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRoleTemplate.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRoleTemplate.json.cs index 70656370e2e1..3fbfdf12dfa5 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRoleTemplate.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRoleTemplate.json.cs @@ -62,7 +62,7 @@ public partial class MicrosoftGraphDirectoryRoleTemplate /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryRoleTemplate FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphDirectoryRoleTemplate(json, new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphDirectoryRoleTemplate(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description" }) : null; } /// @@ -80,7 +80,7 @@ internal MicrosoftGraphDirectoryRoleTemplate(Microsoft.Azure.PowerShell.Cmdlets. } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); __microsoftGraphDirectoryObject = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject(json); - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRoleTemplateCollectionResponse.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRoleTemplateCollectionResponse.json.cs index 3199fd6c9cd8..07a56796cb94 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRoleTemplateCollectionResponse.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDirectoryRoleTemplateCollectionResponse.json.cs @@ -80,8 +80,8 @@ internal MicrosoftGraphDirectoryRoleTemplateCollectionResponse(Microsoft.Azure.P return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryRoleTemplate) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryRoleTemplate.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryRoleTemplate) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryRoleTemplate.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDomain.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDomain.json.cs index 8135a7877ae4..899cd1106715 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDomain.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDomain.json.cs @@ -79,23 +79,23 @@ internal MicrosoftGraphDomain(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGra return; } __microsoftGraphEntity = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEntity(json,new global::System.Collections.Generic.HashSet(){ @"id",@"authenticationType",@"availabilityStatus",@"isAdminManaged",@"isDefault",@"isInitial",@"isRoot",@"isVerified",@"manufacturer",@"model",@"passwordNotificationWindowInDays",@"passwordValidityPeriodInDays",@"state",@"supportedServices",@"domainNameReferences",@"federationConfiguration",@"serviceConfigurationRecords",@"verificationDnsRecords" }); - {_authenticationType = If( json?.PropertyT("authenticationType"), out var __jsonAuthenticationType) ? (string)__jsonAuthenticationType : (string)AuthenticationType;} - {_availabilityStatus = If( json?.PropertyT("availabilityStatus"), out var __jsonAvailabilityStatus) ? (string)__jsonAvailabilityStatus : (string)AvailabilityStatus;} - {_isAdminManaged = If( json?.PropertyT("isAdminManaged"), out var __jsonIsAdminManaged) ? (bool?)__jsonIsAdminManaged : IsAdminManaged;} - {_isDefault = If( json?.PropertyT("isDefault"), out var __jsonIsDefault) ? (bool?)__jsonIsDefault : IsDefault;} - {_isInitial = If( json?.PropertyT("isInitial"), out var __jsonIsInitial) ? (bool?)__jsonIsInitial : IsInitial;} - {_isRoot = If( json?.PropertyT("isRoot"), out var __jsonIsRoot) ? (bool?)__jsonIsRoot : IsRoot;} - {_isVerified = If( json?.PropertyT("isVerified"), out var __jsonIsVerified) ? (bool?)__jsonIsVerified : IsVerified;} - {_manufacturer = If( json?.PropertyT("manufacturer"), out var __jsonManufacturer) ? (string)__jsonManufacturer : (string)Manufacturer;} - {_model = If( json?.PropertyT("model"), out var __jsonModel) ? (string)__jsonModel : (string)Model;} - {_passwordNotificationWindowInDay = If( json?.PropertyT("passwordNotificationWindowInDays"), out var __jsonPasswordNotificationWindowInDays) ? (int?)__jsonPasswordNotificationWindowInDays : PasswordNotificationWindowInDay;} - {_passwordValidityPeriodInDay = If( json?.PropertyT("passwordValidityPeriodInDays"), out var __jsonPasswordValidityPeriodInDays) ? (int?)__jsonPasswordValidityPeriodInDays : PasswordValidityPeriodInDay;} - {_supportedService = If( json?.PropertyT("supportedServices"), out var __jsonSupportedServices) ? If( __jsonSupportedServices as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : SupportedService;} - {_domainNameReference = If( json?.PropertyT("domainNameReferences"), out var __jsonDomainNameReferences) ? If( __jsonDomainNameReferences as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__p) )) ))() : null : DomainNameReference;} - {_federationConfiguration = If( json?.PropertyT("federationConfiguration"), out var __jsonFederationConfiguration) ? If( __jsonFederationConfiguration as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphInternalDomainFederation) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphInternalDomainFederation.FromJson(__k) )) ))() : null : FederationConfiguration;} - {_serviceConfigurationRecord = If( json?.PropertyT("serviceConfigurationRecords"), out var __jsonServiceConfigurationRecords) ? If( __jsonServiceConfigurationRecords as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDomainDnsRecord) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomainDnsRecord.FromJson(__f) )) ))() : null : ServiceConfigurationRecord;} - {_verificationDnsRecord = If( json?.PropertyT("verificationDnsRecords"), out var __jsonVerificationDnsRecords) ? If( __jsonVerificationDnsRecords as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDomainDnsRecord) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomainDnsRecord.FromJson(__a) )) ))() : null : VerificationDnsRecord;} - {_state = If( json?.PropertyT("state"), out var __jsonState) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomainState.FromJson(__jsonState) : State;} + {_authenticationType = If( json?.PropertyT("authenticationType"), out var __jsonAuthenticationType) ? (string)__jsonAuthenticationType : (string)_authenticationType;} + {_availabilityStatus = If( json?.PropertyT("availabilityStatus"), out var __jsonAvailabilityStatus) ? (string)__jsonAvailabilityStatus : (string)_availabilityStatus;} + {_isAdminManaged = If( json?.PropertyT("isAdminManaged"), out var __jsonIsAdminManaged) ? (bool?)__jsonIsAdminManaged : _isAdminManaged;} + {_isDefault = If( json?.PropertyT("isDefault"), out var __jsonIsDefault) ? (bool?)__jsonIsDefault : _isDefault;} + {_isInitial = If( json?.PropertyT("isInitial"), out var __jsonIsInitial) ? (bool?)__jsonIsInitial : _isInitial;} + {_isRoot = If( json?.PropertyT("isRoot"), out var __jsonIsRoot) ? (bool?)__jsonIsRoot : _isRoot;} + {_isVerified = If( json?.PropertyT("isVerified"), out var __jsonIsVerified) ? (bool?)__jsonIsVerified : _isVerified;} + {_manufacturer = If( json?.PropertyT("manufacturer"), out var __jsonManufacturer) ? (string)__jsonManufacturer : (string)_manufacturer;} + {_model = If( json?.PropertyT("model"), out var __jsonModel) ? (string)__jsonModel : (string)_model;} + {_passwordNotificationWindowInDay = If( json?.PropertyT("passwordNotificationWindowInDays"), out var __jsonPasswordNotificationWindowInDays) ? (int?)__jsonPasswordNotificationWindowInDays : _passwordNotificationWindowInDay;} + {_passwordValidityPeriodInDay = If( json?.PropertyT("passwordValidityPeriodInDays"), out var __jsonPasswordValidityPeriodInDays) ? (int?)__jsonPasswordValidityPeriodInDays : _passwordValidityPeriodInDay;} + {_supportedService = If( json?.PropertyT("supportedServices"), out var __jsonSupportedServices) ? If( __jsonSupportedServices as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _supportedService;} + {_domainNameReference = If( json?.PropertyT("domainNameReferences"), out var __jsonDomainNameReferences) ? If( __jsonDomainNameReferences as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__p) )) ))() : null : _domainNameReference;} + {_federationConfiguration = If( json?.PropertyT("federationConfiguration"), out var __jsonFederationConfiguration) ? If( __jsonFederationConfiguration as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphInternalDomainFederation) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphInternalDomainFederation.FromJson(__k) )) ))() : null : _federationConfiguration;} + {_serviceConfigurationRecord = If( json?.PropertyT("serviceConfigurationRecords"), out var __jsonServiceConfigurationRecords) ? If( __jsonServiceConfigurationRecords as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDomainDnsRecord) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomainDnsRecord.FromJson(__f) )) ))() : null : _serviceConfigurationRecord;} + {_verificationDnsRecord = If( json?.PropertyT("verificationDnsRecords"), out var __jsonVerificationDnsRecords) ? If( __jsonVerificationDnsRecords as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDomainDnsRecord) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomainDnsRecord.FromJson(__a) )) ))() : null : _verificationDnsRecord;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomainState.FromJson(__jsonState) : _state;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDomainCollectionResponse.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDomainCollectionResponse.json.cs index 49d5237dcd51..7758ffb82b57 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDomainCollectionResponse.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDomainCollectionResponse.json.cs @@ -79,8 +79,8 @@ internal MicrosoftGraphDomainCollectionResponse(Microsoft.Azure.PowerShell.Cmdle return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDomain) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomain.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDomain) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomain.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDomainDnsRecord.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDomainDnsRecord.json.cs index b101cadac5e1..c1db21c9147f 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDomainDnsRecord.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDomainDnsRecord.json.cs @@ -79,11 +79,11 @@ internal MicrosoftGraphDomainDnsRecord(Microsoft.Azure.PowerShell.Cmdlets.Resour return; } __microsoftGraphEntity = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEntity(json,new global::System.Collections.Generic.HashSet(){ @"id",@"isOptional",@"label",@"recordType",@"supportedService",@"ttl" }); - {_isOptional = If( json?.PropertyT("isOptional"), out var __jsonIsOptional) ? (bool?)__jsonIsOptional : IsOptional;} - {_label = If( json?.PropertyT("label"), out var __jsonLabel) ? (string)__jsonLabel : (string)Label;} - {_recordType = If( json?.PropertyT("recordType"), out var __jsonRecordType) ? (string)__jsonRecordType : (string)RecordType;} - {_supportedService = If( json?.PropertyT("supportedService"), out var __jsonSupportedService) ? (string)__jsonSupportedService : (string)SupportedService;} - {_ttl = If( json?.PropertyT("ttl"), out var __jsonTtl) ? (int?)__jsonTtl : Ttl;} + {_isOptional = If( json?.PropertyT("isOptional"), out var __jsonIsOptional) ? (bool?)__jsonIsOptional : _isOptional;} + {_label = If( json?.PropertyT("label"), out var __jsonLabel) ? (string)__jsonLabel : (string)_label;} + {_recordType = If( json?.PropertyT("recordType"), out var __jsonRecordType) ? (string)__jsonRecordType : (string)_recordType;} + {_supportedService = If( json?.PropertyT("supportedService"), out var __jsonSupportedService) ? (string)__jsonSupportedService : (string)_supportedService;} + {_ttl = If( json?.PropertyT("ttl"), out var __jsonTtl) ? (int?)__jsonTtl : _ttl;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDomainDnsRecordCollectionResponse.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDomainDnsRecordCollectionResponse.json.cs index 506fe662f93d..391d55af034f 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDomainDnsRecordCollectionResponse.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDomainDnsRecordCollectionResponse.json.cs @@ -80,8 +80,8 @@ internal MicrosoftGraphDomainDnsRecordCollectionResponse(Microsoft.Azure.PowerSh return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDomainDnsRecord) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomainDnsRecord.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDomainDnsRecord) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDomainDnsRecord.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDomainState.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDomainState.json.cs index 469b283f8847..fa62b46b3762 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDomainState.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphDomainState.json.cs @@ -79,9 +79,9 @@ internal MicrosoftGraphDomainState(Microsoft.Azure.PowerShell.Cmdlets.Resources. return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_lastActionDateTime = If( json?.PropertyT("lastActionDateTime"), out var __jsonLastActionDateTime) ? global::System.DateTime.TryParse((string)__jsonLastActionDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastActionDateTimeValue) ? __jsonLastActionDateTimeValue : LastActionDateTime : LastActionDateTime;} - {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_lastActionDateTime = If( json?.PropertyT("lastActionDateTime"), out var __jsonLastActionDateTime) ? global::System.DateTime.TryParse((string)__jsonLastActionDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastActionDateTimeValue) ? __jsonLastActionDateTimeValue : _lastActionDateTime : _lastActionDateTime;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)_operation;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphEmployeeOrgData.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphEmployeeOrgData.json.cs index aa9efd92a122..3f0302e10d3a 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphEmployeeOrgData.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphEmployeeOrgData.json.cs @@ -79,8 +79,8 @@ internal MicrosoftGraphEmployeeOrgData(Microsoft.Azure.PowerShell.Cmdlets.Resour return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_costCenter = If( json?.PropertyT("costCenter"), out var __jsonCostCenter) ? (string)__jsonCostCenter : (string)CostCenter;} - {_division = If( json?.PropertyT("division"), out var __jsonDivision) ? (string)__jsonDivision : (string)Division;} + {_costCenter = If( json?.PropertyT("costCenter"), out var __jsonCostCenter) ? (string)__jsonCostCenter : (string)_costCenter;} + {_division = If( json?.PropertyT("division"), out var __jsonDivision) ? (string)__jsonDivision : (string)_division;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphEndpoint.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphEndpoint.cs index ada8c0bd767b..6d6ca7481a0c 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphEndpoint.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphEndpoint.cs @@ -45,9 +45,6 @@ public partial class MicrosoftGraphEndpoint : /// Internal Acessors for OdataId string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId = value; } - /// Internal Acessors for OdataType - string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = value; } - /// Internal Acessors for Capability string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEndpointInternal.Capability { get => this._capability; set { {_capability = value;} } } @@ -71,8 +68,9 @@ public partial class MicrosoftGraphEndpoint : public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; } /// The type of object in directory + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; } + public string OdataType { get => "microsoft.graph.endpoint"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = "microsoft.graph.endpoint"; } /// Backing field for property. private string _providerId; diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphEndpoint.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphEndpoint.json.cs index 3adc0f610c42..f770070e8555 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphEndpoint.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphEndpoint.json.cs @@ -65,7 +65,7 @@ public partial class MicrosoftGraphEndpoint /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEndpoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphEndpoint(json, new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"capability",@"providerId",@"providerName",@"providerResourceId",@"uri" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphEndpoint(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"capability",@"providerId",@"providerName",@"providerResourceId",@"uri" }) : null; } /// @@ -83,11 +83,11 @@ internal MicrosoftGraphEndpoint(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSG } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); __microsoftGraphDirectoryObject = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject(json); - {_capability = If( json?.PropertyT("capability"), out var __jsonCapability) ? (string)__jsonCapability : (string)Capability;} - {_providerId = If( json?.PropertyT("providerId"), out var __jsonProviderId) ? (string)__jsonProviderId : (string)ProviderId;} - {_providerName = If( json?.PropertyT("providerName"), out var __jsonProviderName) ? (string)__jsonProviderName : (string)ProviderName;} - {_providerResourceId = If( json?.PropertyT("providerResourceId"), out var __jsonProviderResourceId) ? (string)__jsonProviderResourceId : (string)ProviderResourceId;} - {_uri = If( json?.PropertyT("uri"), out var __jsonUri) ? (string)__jsonUri : (string)Uri;} + {_capability = If( json?.PropertyT("capability"), out var __jsonCapability) ? (string)__jsonCapability : (string)_capability;} + {_providerId = If( json?.PropertyT("providerId"), out var __jsonProviderId) ? (string)__jsonProviderId : (string)_providerId;} + {_providerName = If( json?.PropertyT("providerName"), out var __jsonProviderName) ? (string)__jsonProviderName : (string)_providerName;} + {_providerResourceId = If( json?.PropertyT("providerResourceId"), out var __jsonProviderResourceId) ? (string)__jsonProviderResourceId : (string)_providerResourceId;} + {_uri = If( json?.PropertyT("uri"), out var __jsonUri) ? (string)__jsonUri : (string)_uri;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphEntity.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphEntity.json.cs index f4c4f8febf36..d33bc60e7fe7 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphEntity.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphEntity.json.cs @@ -79,7 +79,7 @@ internal MicrosoftGraphEntity(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGra return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphEntityAutoGenerated.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphEntityAutoGenerated.json.cs index 7d0a7f883696..f48d39dc22ad 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphEntityAutoGenerated.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphEntityAutoGenerated.json.cs @@ -77,7 +77,7 @@ internal MicrosoftGraphEntityAutoGenerated(Microsoft.Azure.PowerShell.Cmdlets.Re { return; } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphExtensionCollectionResponse.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphExtensionCollectionResponse.json.cs index 5aa037991edd..b0fd57d591ef 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphExtensionCollectionResponse.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphExtensionCollectionResponse.json.cs @@ -79,8 +79,8 @@ internal MicrosoftGraphExtensionCollectionResponse(Microsoft.Azure.PowerShell.Cm return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphExtension) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphExtension.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphExtension) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphExtension.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphExtensionProperty.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphExtensionProperty.cs index 315ea1d39cd0..4b97302eab6f 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphExtensionProperty.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphExtensionProperty.cs @@ -65,9 +65,6 @@ public partial class MicrosoftGraphExtensionProperty : /// Internal Acessors for OdataId string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId = value; } - /// Internal Acessors for OdataType - string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = value; } - /// Internal Acessors for Id string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id = value; } @@ -89,8 +86,9 @@ public partial class MicrosoftGraphExtensionProperty : public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; } /// The type of object in directory + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; } + public string OdataType { get => "microsoft.graph.extensionProperty"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = "microsoft.graph.extensionProperty"; } /// Backing field for property. private string[] _targetObject; diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphExtensionProperty.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphExtensionProperty.json.cs index bf42fc1620f7..13d5d1d5de67 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphExtensionProperty.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphExtensionProperty.json.cs @@ -65,7 +65,7 @@ public partial class MicrosoftGraphExtensionProperty /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphExtensionProperty FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphExtensionProperty(json, new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"appDisplayName",@"dataType",@"isSyncedFromOnPremises",@"name",@"targetObjects" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphExtensionProperty(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"appDisplayName",@"dataType",@"isSyncedFromOnPremises",@"name",@"targetObjects" }) : null; } /// @@ -83,11 +83,11 @@ internal MicrosoftGraphExtensionProperty(Microsoft.Azure.PowerShell.Cmdlets.Reso } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); __microsoftGraphDirectoryObject = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject(json); - {_appDisplayName = If( json?.PropertyT("appDisplayName"), out var __jsonAppDisplayName) ? (string)__jsonAppDisplayName : (string)AppDisplayName;} - {_dataType = If( json?.PropertyT("dataType"), out var __jsonDataType) ? (string)__jsonDataType : (string)DataType;} - {_isSyncedFromOnPremise = If( json?.PropertyT("isSyncedFromOnPremises"), out var __jsonIsSyncedFromOnPremises) ? (bool?)__jsonIsSyncedFromOnPremises : IsSyncedFromOnPremise;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_targetObject = If( json?.PropertyT("targetObjects"), out var __jsonTargetObjects) ? If( __jsonTargetObjects as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : TargetObject;} + {_appDisplayName = If( json?.PropertyT("appDisplayName"), out var __jsonAppDisplayName) ? (string)__jsonAppDisplayName : (string)_appDisplayName;} + {_dataType = If( json?.PropertyT("dataType"), out var __jsonDataType) ? (string)__jsonDataType : (string)_dataType;} + {_isSyncedFromOnPremise = If( json?.PropertyT("isSyncedFromOnPremises"), out var __jsonIsSyncedFromOnPremises) ? (bool?)__jsonIsSyncedFromOnPremises : _isSyncedFromOnPremise;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_targetObject = If( json?.PropertyT("targetObjects"), out var __jsonTargetObjects) ? If( __jsonTargetObjects as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _targetObject;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphExtensionPropertyAutoGenerated.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphExtensionPropertyAutoGenerated.cs index c5465d3584ba..cf6b6f433de0 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphExtensionPropertyAutoGenerated.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphExtensionPropertyAutoGenerated.cs @@ -62,9 +62,6 @@ public partial class MicrosoftGraphExtensionPropertyAutoGenerated : /// Internal Acessors for OdataId string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId = value; } - /// Internal Acessors for OdataType - string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = value; } - /// Internal Acessors for Id string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id = value; } @@ -80,8 +77,9 @@ public partial class MicrosoftGraphExtensionPropertyAutoGenerated : public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; } /// The type of object in directory + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; } + public string OdataType { get => "microsoft.graph.extensionProperty"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = "microsoft.graph.extensionProperty"; } /// Backing field for property. private string[] _targetObject; diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphExtensionPropertyAutoGenerated.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphExtensionPropertyAutoGenerated.json.cs index fae9efae103c..ed24bc37acc4 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphExtensionPropertyAutoGenerated.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphExtensionPropertyAutoGenerated.json.cs @@ -62,7 +62,7 @@ public partial class MicrosoftGraphExtensionPropertyAutoGenerated /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphExtensionPropertyAutoGenerated FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphExtensionPropertyAutoGenerated(json, new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"appDisplayName",@"dataType",@"isSyncedFromOnPremises",@"name",@"targetObjects" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphExtensionPropertyAutoGenerated(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"appDisplayName",@"dataType",@"isSyncedFromOnPremises",@"name",@"targetObjects" }) : null; } /// @@ -81,11 +81,11 @@ internal MicrosoftGraphExtensionPropertyAutoGenerated(Microsoft.Azure.PowerShell } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); __microsoftGraphDirectoryObject = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject(json); - {_appDisplayName = If( json?.PropertyT("appDisplayName"), out var __jsonAppDisplayName) ? (string)__jsonAppDisplayName : (string)AppDisplayName;} - {_dataType = If( json?.PropertyT("dataType"), out var __jsonDataType) ? (string)__jsonDataType : (string)DataType;} - {_isSyncedFromOnPremise = If( json?.PropertyT("isSyncedFromOnPremises"), out var __jsonIsSyncedFromOnPremises) ? (bool?)__jsonIsSyncedFromOnPremises : IsSyncedFromOnPremise;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_targetObject = If( json?.PropertyT("targetObjects"), out var __jsonTargetObjects) ? If( __jsonTargetObjects as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : TargetObject;} + {_appDisplayName = If( json?.PropertyT("appDisplayName"), out var __jsonAppDisplayName) ? (string)__jsonAppDisplayName : (string)_appDisplayName;} + {_dataType = If( json?.PropertyT("dataType"), out var __jsonDataType) ? (string)__jsonDataType : (string)_dataType;} + {_isSyncedFromOnPremise = If( json?.PropertyT("isSyncedFromOnPremises"), out var __jsonIsSyncedFromOnPremises) ? (bool?)__jsonIsSyncedFromOnPremises : _isSyncedFromOnPremise;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_targetObject = If( json?.PropertyT("targetObjects"), out var __jsonTargetObjects) ? If( __jsonTargetObjects as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _targetObject;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphFederatedIdentityCredential.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphFederatedIdentityCredential.cs index 4254707a01fe..9dc54e95055f 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphFederatedIdentityCredential.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphFederatedIdentityCredential.cs @@ -67,6 +67,10 @@ public partial class MicrosoftGraphFederatedIdentityCredential : [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Owned)] public string Name { get => this._name; set => this._name = value; } + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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); } + /// Backing field for property. private string _subject; diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphFederatedIdentityCredential.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphFederatedIdentityCredential.json.cs index ce75f39bfe49..2e4ab08d1070 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphFederatedIdentityCredential.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphFederatedIdentityCredential.json.cs @@ -62,7 +62,7 @@ public partial class MicrosoftGraphFederatedIdentityCredential /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphFederatedIdentityCredential(json, new global::System.Collections.Generic.HashSet(){ @"id",@"audiences",@"description",@"issuer",@"name",@"subject" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphFederatedIdentityCredential(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"audiences",@"description",@"issuer",@"name",@"subject" }) : null; } /// @@ -80,11 +80,11 @@ internal MicrosoftGraphFederatedIdentityCredential(Microsoft.Azure.PowerShell.Cm } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); __microsoftGraphEntityAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEntityAutoGenerated(json); - {_audience = If( json?.PropertyT("audiences"), out var __jsonAudiences) ? If( __jsonAudiences as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Audience;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_issuer = If( json?.PropertyT("issuer"), out var __jsonIssuer) ? (string)__jsonIssuer : (string)Issuer;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_subject = If( json?.PropertyT("subject"), out var __jsonSubject) ? (string)__jsonSubject : (string)Subject;} + {_audience = If( json?.PropertyT("audiences"), out var __jsonAudiences) ? If( __jsonAudiences as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _audience;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_issuer = If( json?.PropertyT("issuer"), out var __jsonIssuer) ? (string)__jsonIssuer : (string)_issuer;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_subject = If( json?.PropertyT("subject"), out var __jsonSubject) ? (string)__jsonSubject : (string)_subject;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphFederatedIdentityCredentialCollectionResponse.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphFederatedIdentityCredentialCollectionResponse.json.cs index 0ecbab164745..4ccae929aff4 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphFederatedIdentityCredentialCollectionResponse.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphFederatedIdentityCredentialCollectionResponse.json.cs @@ -80,8 +80,8 @@ internal MicrosoftGraphFederatedIdentityCredentialCollectionResponse(Microsoft.A return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredential.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredential.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphGroup.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphGroup.cs index 587945f1d092..74b8914b799e 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphGroup.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphGroup.cs @@ -251,9 +251,6 @@ public partial class MicrosoftGraphGroup : /// Internal Acessors for OdataId string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId = value; } - /// Internal Acessors for OdataType - string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = value; } - /// Internal Acessors for Id string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id = value; } @@ -293,9 +290,10 @@ public partial class MicrosoftGraphGroup : public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; } /// The type of object in directory + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] - public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; } + public string OdataType { get => "#microsoft.graph.group"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = "#microsoft.graph.group"; } /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject[] _owner; @@ -365,6 +363,11 @@ public partial class MicrosoftGraphGroup : [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] public global::System.DateTime? RenewedDateTime { get => this._renewedDateTime; } + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + /// Backing field for property. private bool? _securityEnabled; diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphGroup.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphGroup.json.cs index 5f478a3aed9a..17448249c716 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphGroup.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphGroup.json.cs @@ -65,7 +65,7 @@ public partial class MicrosoftGraphGroup /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphGroup(json, new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"classification",@"createdDateTime",@"description",@"expirationDateTime",@"groupTypes",@"hasMembersWithLicenseErrors",@"isAssignableToRole",@"mail",@"mailEnabled",@"mailNickname",@"membershipRule",@"membershipRuleProcessingState",@"preferredDataLocation",@"preferredLanguage",@"proxyAddresses",@"renewedDateTime",@"securityEnabled",@"securityIdentifier",@"theme",@"visibility",@"isArchived",@"appRoleAssignments",@"createdOnBehalfOf",@"memberOf",@"members",@"membersWithLicenseErrors",@"owners",@"permissionGrants",@"groupLifecyclePolicies" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphGroup(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"classification",@"createdDateTime",@"description",@"expirationDateTime",@"groupTypes",@"hasMembersWithLicenseErrors",@"isAssignableToRole",@"mail",@"mailEnabled",@"mailNickname",@"membershipRule",@"membershipRuleProcessingState",@"preferredDataLocation",@"preferredLanguage",@"proxyAddresses",@"renewedDateTime",@"securityEnabled",@"securityIdentifier",@"theme",@"visibility",@"isArchived",@"appRoleAssignments",@"createdOnBehalfOf",@"memberOf",@"members",@"membersWithLicenseErrors",@"owners",@"permissionGrants",@"groupLifecyclePolicies" }) : null; } /// @@ -83,35 +83,35 @@ internal MicrosoftGraphGroup(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGrap } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); __microsoftGraphDirectoryObject = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject(json); - {_classification = If( json?.PropertyT("classification"), out var __jsonClassification) ? (string)__jsonClassification : (string)Classification;} - {_createdDateTime = If( json?.PropertyT("createdDateTime"), out var __jsonCreatedDateTime) ? global::System.DateTime.TryParse((string)__jsonCreatedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedDateTimeValue) ? __jsonCreatedDateTimeValue : CreatedDateTime : CreatedDateTime;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_expirationDateTime = If( json?.PropertyT("expirationDateTime"), out var __jsonExpirationDateTime) ? global::System.DateTime.TryParse((string)__jsonExpirationDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationDateTimeValue) ? __jsonExpirationDateTimeValue : ExpirationDateTime : ExpirationDateTime;} - {_groupType = If( json?.PropertyT("groupTypes"), out var __jsonGroupTypes) ? If( __jsonGroupTypes as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : GroupType;} - {_hasMembersWithLicenseError = If( json?.PropertyT("hasMembersWithLicenseErrors"), out var __jsonHasMembersWithLicenseErrors) ? (bool?)__jsonHasMembersWithLicenseErrors : HasMembersWithLicenseError;} - {_isAssignableToRole = If( json?.PropertyT("isAssignableToRole"), out var __jsonIsAssignableToRole) ? (bool?)__jsonIsAssignableToRole : IsAssignableToRole;} - {_mail = If( json?.PropertyT("mail"), out var __jsonMail) ? (string)__jsonMail : (string)Mail;} - {_mailEnabled = If( json?.PropertyT("mailEnabled"), out var __jsonMailEnabled) ? (bool?)__jsonMailEnabled : MailEnabled;} - {_mailNickname = If( json?.PropertyT("mailNickname"), out var __jsonMailNickname) ? (string)__jsonMailNickname : (string)MailNickname;} - {_membershipRule = If( json?.PropertyT("membershipRule"), out var __jsonMembershipRule) ? (string)__jsonMembershipRule : (string)MembershipRule;} - {_membershipRuleProcessingState = If( json?.PropertyT("membershipRuleProcessingState"), out var __jsonMembershipRuleProcessingState) ? (string)__jsonMembershipRuleProcessingState : (string)MembershipRuleProcessingState;} - {_preferredDataLocation = If( json?.PropertyT("preferredDataLocation"), out var __jsonPreferredDataLocation) ? (string)__jsonPreferredDataLocation : (string)PreferredDataLocation;} - {_preferredLanguage = If( json?.PropertyT("preferredLanguage"), out var __jsonPreferredLanguage) ? (string)__jsonPreferredLanguage : (string)PreferredLanguage;} - {_proxyAddress = If( json?.PropertyT("proxyAddresses"), out var __jsonProxyAddresses) ? If( __jsonProxyAddresses as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : ProxyAddress;} - {_renewedDateTime = If( json?.PropertyT("renewedDateTime"), out var __jsonRenewedDateTime) ? global::System.DateTime.TryParse((string)__jsonRenewedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonRenewedDateTimeValue) ? __jsonRenewedDateTimeValue : RenewedDateTime : RenewedDateTime;} - {_securityEnabled = If( json?.PropertyT("securityEnabled"), out var __jsonSecurityEnabled) ? (bool?)__jsonSecurityEnabled : SecurityEnabled;} - {_securityIdentifier = If( json?.PropertyT("securityIdentifier"), out var __jsonSecurityIdentifier) ? (string)__jsonSecurityIdentifier : (string)SecurityIdentifier;} - {_theme = If( json?.PropertyT("theme"), out var __jsonTheme) ? (string)__jsonTheme : (string)Theme;} - {_visibility = If( json?.PropertyT("visibility"), out var __jsonVisibility) ? (string)__jsonVisibility : (string)Visibility;} - {_isArchived = If( json?.PropertyT("isArchived"), out var __jsonIsArchived) ? (bool?)__jsonIsArchived : IsArchived;} - {_appRoleAssignment = If( json?.PropertyT("appRoleAssignments"), out var __jsonAppRoleAssignments) ? If( __jsonAppRoleAssignments as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentAutoGenerated) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignmentAutoGenerated.FromJson(__k) )) ))() : null : AppRoleAssignment;} - {_createdOnBehalfOf = If( json?.PropertyT("createdOnBehalfOf"), out var __jsonCreatedOnBehalfOf) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__jsonCreatedOnBehalfOf) : CreatedOnBehalfOf;} - {_memberOf = If( json?.PropertyT("memberOf"), out var __jsonMemberOf) ? If( __jsonMemberOf as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__f) )) ))() : null : MemberOf;} - {_member = If( json?.PropertyT("members"), out var __jsonMembers) ? If( __jsonMembers as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__a) )) ))() : null : Member;} - {_membersWithLicenseError = If( json?.PropertyT("membersWithLicenseErrors"), out var __jsonMembersWithLicenseErrors) ? If( __jsonMembersWithLicenseErrors as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___w) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___w, (___v)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(___v) )) ))() : null : MembersWithLicenseError;} - {_owner = If( json?.PropertyT("owners"), out var __jsonOwners) ? If( __jsonOwners as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___r) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___r, (___q)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(___q) )) ))() : null : Owner;} - {_permissionGrant = If( json?.PropertyT("permissionGrants"), out var __jsonPermissionGrants) ? If( __jsonPermissionGrants as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___m) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___m, (___l)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphResourceSpecificPermissionGrant) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphResourceSpecificPermissionGrant.FromJson(___l) )) ))() : null : PermissionGrant;} - {_groupLifecyclePolicy = If( json?.PropertyT("groupLifecyclePolicies"), out var __jsonGroupLifecyclePolicies) ? If( __jsonGroupLifecyclePolicies as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___h) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___h, (___g)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroupLifecyclePolicy) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphGroupLifecyclePolicy.FromJson(___g) )) ))() : null : GroupLifecyclePolicy;} + {_classification = If( json?.PropertyT("classification"), out var __jsonClassification) ? (string)__jsonClassification : (string)_classification;} + {_createdDateTime = If( json?.PropertyT("createdDateTime"), out var __jsonCreatedDateTime) ? global::System.DateTime.TryParse((string)__jsonCreatedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedDateTimeValue) ? __jsonCreatedDateTimeValue : _createdDateTime : _createdDateTime;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_expirationDateTime = If( json?.PropertyT("expirationDateTime"), out var __jsonExpirationDateTime) ? global::System.DateTime.TryParse((string)__jsonExpirationDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationDateTimeValue) ? __jsonExpirationDateTimeValue : _expirationDateTime : _expirationDateTime;} + {_groupType = If( json?.PropertyT("groupTypes"), out var __jsonGroupTypes) ? If( __jsonGroupTypes as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _groupType;} + {_hasMembersWithLicenseError = If( json?.PropertyT("hasMembersWithLicenseErrors"), out var __jsonHasMembersWithLicenseErrors) ? (bool?)__jsonHasMembersWithLicenseErrors : _hasMembersWithLicenseError;} + {_isAssignableToRole = If( json?.PropertyT("isAssignableToRole"), out var __jsonIsAssignableToRole) ? (bool?)__jsonIsAssignableToRole : _isAssignableToRole;} + {_mail = If( json?.PropertyT("mail"), out var __jsonMail) ? (string)__jsonMail : (string)_mail;} + {_mailEnabled = If( json?.PropertyT("mailEnabled"), out var __jsonMailEnabled) ? (bool?)__jsonMailEnabled : _mailEnabled;} + {_mailNickname = If( json?.PropertyT("mailNickname"), out var __jsonMailNickname) ? (string)__jsonMailNickname : (string)_mailNickname;} + {_membershipRule = If( json?.PropertyT("membershipRule"), out var __jsonMembershipRule) ? (string)__jsonMembershipRule : (string)_membershipRule;} + {_membershipRuleProcessingState = If( json?.PropertyT("membershipRuleProcessingState"), out var __jsonMembershipRuleProcessingState) ? (string)__jsonMembershipRuleProcessingState : (string)_membershipRuleProcessingState;} + {_preferredDataLocation = If( json?.PropertyT("preferredDataLocation"), out var __jsonPreferredDataLocation) ? (string)__jsonPreferredDataLocation : (string)_preferredDataLocation;} + {_preferredLanguage = If( json?.PropertyT("preferredLanguage"), out var __jsonPreferredLanguage) ? (string)__jsonPreferredLanguage : (string)_preferredLanguage;} + {_proxyAddress = If( json?.PropertyT("proxyAddresses"), out var __jsonProxyAddresses) ? If( __jsonProxyAddresses as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _proxyAddress;} + {_renewedDateTime = If( json?.PropertyT("renewedDateTime"), out var __jsonRenewedDateTime) ? global::System.DateTime.TryParse((string)__jsonRenewedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonRenewedDateTimeValue) ? __jsonRenewedDateTimeValue : _renewedDateTime : _renewedDateTime;} + {_securityEnabled = If( json?.PropertyT("securityEnabled"), out var __jsonSecurityEnabled) ? (bool?)__jsonSecurityEnabled : _securityEnabled;} + {_securityIdentifier = If( json?.PropertyT("securityIdentifier"), out var __jsonSecurityIdentifier) ? (string)__jsonSecurityIdentifier : (string)_securityIdentifier;} + {_theme = If( json?.PropertyT("theme"), out var __jsonTheme) ? (string)__jsonTheme : (string)_theme;} + {_visibility = If( json?.PropertyT("visibility"), out var __jsonVisibility) ? (string)__jsonVisibility : (string)_visibility;} + {_isArchived = If( json?.PropertyT("isArchived"), out var __jsonIsArchived) ? (bool?)__jsonIsArchived : _isArchived;} + {_appRoleAssignment = If( json?.PropertyT("appRoleAssignments"), out var __jsonAppRoleAssignments) ? If( __jsonAppRoleAssignments as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentAutoGenerated) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignmentAutoGenerated.FromJson(__k) )) ))() : null : _appRoleAssignment;} + {_createdOnBehalfOf = If( json?.PropertyT("createdOnBehalfOf"), out var __jsonCreatedOnBehalfOf) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__jsonCreatedOnBehalfOf) : _createdOnBehalfOf;} + {_memberOf = If( json?.PropertyT("memberOf"), out var __jsonMemberOf) ? If( __jsonMemberOf as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__f) )) ))() : null : _memberOf;} + {_member = If( json?.PropertyT("members"), out var __jsonMembers) ? If( __jsonMembers as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__a) )) ))() : null : _member;} + {_membersWithLicenseError = If( json?.PropertyT("membersWithLicenseErrors"), out var __jsonMembersWithLicenseErrors) ? If( __jsonMembersWithLicenseErrors as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___w) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___w, (___v)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(___v) )) ))() : null : _membersWithLicenseError;} + {_owner = If( json?.PropertyT("owners"), out var __jsonOwners) ? If( __jsonOwners as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___r) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___r, (___q)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(___q) )) ))() : null : _owner;} + {_permissionGrant = If( json?.PropertyT("permissionGrants"), out var __jsonPermissionGrants) ? If( __jsonPermissionGrants as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___m) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___m, (___l)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphResourceSpecificPermissionGrant) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphResourceSpecificPermissionGrant.FromJson(___l) )) ))() : null : _permissionGrant;} + {_groupLifecyclePolicy = If( json?.PropertyT("groupLifecyclePolicies"), out var __jsonGroupLifecyclePolicies) ? If( __jsonGroupLifecyclePolicies as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___h) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___h, (___g)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroupLifecyclePolicy) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphGroupLifecyclePolicy.FromJson(___g) )) ))() : null : _groupLifecyclePolicy;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphGroupLifecyclePolicy.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphGroupLifecyclePolicy.json.cs index e68819f7c8f5..4f6104403c19 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphGroupLifecyclePolicy.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphGroupLifecyclePolicy.json.cs @@ -62,7 +62,7 @@ public partial class MicrosoftGraphGroupLifecyclePolicy /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroupLifecyclePolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphGroupLifecyclePolicy(json, new global::System.Collections.Generic.HashSet(){ @"id",@"alternateNotificationEmails",@"groupLifetimeInDays",@"managedGroupTypes" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphGroupLifecyclePolicy(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"alternateNotificationEmails",@"groupLifetimeInDays",@"managedGroupTypes" }) : null; } /// @@ -80,9 +80,9 @@ internal MicrosoftGraphGroupLifecyclePolicy(Microsoft.Azure.PowerShell.Cmdlets.R } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); __microsoftGraphEntityAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEntityAutoGenerated(json); - {_alternateNotificationEmail = If( json?.PropertyT("alternateNotificationEmails"), out var __jsonAlternateNotificationEmails) ? (string)__jsonAlternateNotificationEmails : (string)AlternateNotificationEmail;} - {_groupLifetimeInDay = If( json?.PropertyT("groupLifetimeInDays"), out var __jsonGroupLifetimeInDays) ? (int?)__jsonGroupLifetimeInDays : GroupLifetimeInDay;} - {_managedGroupType = If( json?.PropertyT("managedGroupTypes"), out var __jsonManagedGroupTypes) ? (string)__jsonManagedGroupTypes : (string)ManagedGroupType;} + {_alternateNotificationEmail = If( json?.PropertyT("alternateNotificationEmails"), out var __jsonAlternateNotificationEmails) ? (string)__jsonAlternateNotificationEmails : (string)_alternateNotificationEmail;} + {_groupLifetimeInDay = If( json?.PropertyT("groupLifetimeInDays"), out var __jsonGroupLifetimeInDays) ? (int?)__jsonGroupLifetimeInDays : _groupLifetimeInDay;} + {_managedGroupType = If( json?.PropertyT("managedGroupTypes"), out var __jsonManagedGroupTypes) ? (string)__jsonManagedGroupTypes : (string)_managedGroupType;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphHomeRealmDiscoveryPolicy.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphHomeRealmDiscoveryPolicy.cs index 4c7696e6b405..93175d45c608 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphHomeRealmDiscoveryPolicy.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphHomeRealmDiscoveryPolicy.cs @@ -23,14 +23,14 @@ public partial class MicrosoftGraphHomeRealmDiscoveryPolicy : private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicy __microsoftGraphStsPolicy = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphStsPolicy(); [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject[] AppliesTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).AppliesTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).AppliesTo = value ?? null /* arrayOf */; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject[] AppliesTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).AppliesTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).AppliesTo = value ?? null /* fixedArrayOf */; } /// /// A string collection containing a JSON string that defines the rules and settings for a policy. The syntax for the definition /// differs for each derived policy type. Required. /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string[] Definition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).Definition = value ?? null /* arrayOf */; } + public string[] Definition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).Definition = value ?? null /* fixedArrayOf */; } [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] public global::System.DateTime? DeletedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).DeletedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).DeletedDateTime = value ?? default(global::System.DateTime); } @@ -57,9 +57,6 @@ public partial class MicrosoftGraphHomeRealmDiscoveryPolicy : /// Internal Acessors for OdataId string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataId = value; } - /// Internal Acessors for OdataType - string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataType = value; } - /// Internal Acessors for Id string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphStsPolicy).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphStsPolicy).Id = value; } @@ -68,8 +65,9 @@ public partial class MicrosoftGraphHomeRealmDiscoveryPolicy : public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataId; } /// The type of object in directory + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataType; } + public string OdataType { get => "microsoft.graph.homeRealmDiscoveryPolicy"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataType = "microsoft.graph.homeRealmDiscoveryPolicy"; } /// Creates an new instance. public MicrosoftGraphHomeRealmDiscoveryPolicy() diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphHomeRealmDiscoveryPolicy.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphHomeRealmDiscoveryPolicy.json.cs index a4243056f95d..0c45774f30e8 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphHomeRealmDiscoveryPolicy.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphHomeRealmDiscoveryPolicy.json.cs @@ -65,7 +65,7 @@ public partial class MicrosoftGraphHomeRealmDiscoveryPolicy /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphHomeRealmDiscoveryPolicy(json, new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"definition",@"isOrganizationDefault",@"appliesTo" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphHomeRealmDiscoveryPolicy(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"definition",@"isOrganizationDefault",@"appliesTo" }) : null; } /// @@ -81,7 +81,7 @@ internal MicrosoftGraphHomeRealmDiscoveryPolicy(Microsoft.Azure.PowerShell.Cmdle { return; } - __microsoftGraphStsPolicy = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphStsPolicy(json,new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"definition",@"isOrganizationDefault",@"appliesTo" }); + __microsoftGraphStsPolicy = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphStsPolicy(json,new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"definition",@"isOrganizationDefault",@"appliesTo" }); AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphIdentity.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphIdentity.json.cs index 7b06e0828c57..dc077827e3a3 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphIdentity.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphIdentity.json.cs @@ -79,8 +79,8 @@ internal MicrosoftGraphIdentity(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSG return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphIdentityProviderBase.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphIdentityProviderBase.json.cs index e8e816c6bf45..5ebc2bdd812f 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphIdentityProviderBase.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphIdentityProviderBase.json.cs @@ -79,7 +79,7 @@ internal MicrosoftGraphIdentityProviderBase(Microsoft.Azure.PowerShell.Cmdlets.R return; } __microsoftGraphEntity = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEntity(json,new global::System.Collections.Generic.HashSet(){ @"id",@"displayName" }); - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphIdentityProviderBaseCollectionResponse.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphIdentityProviderBaseCollectionResponse.json.cs index d2e55880ddc9..e99844e605b7 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphIdentityProviderBaseCollectionResponse.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphIdentityProviderBaseCollectionResponse.json.cs @@ -80,8 +80,8 @@ internal MicrosoftGraphIdentityProviderBaseCollectionResponse(Microsoft.Azure.Po return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphIdentityProviderBase) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphIdentityProviderBase.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphIdentityProviderBase) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphIdentityProviderBase.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphImplicitGrantSettings.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphImplicitGrantSettings.json.cs index 5a839ee7ab23..f628fa702803 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphImplicitGrantSettings.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphImplicitGrantSettings.json.cs @@ -79,8 +79,8 @@ internal MicrosoftGraphImplicitGrantSettings(Microsoft.Azure.PowerShell.Cmdlets. return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_enableAccessTokenIssuance = If( json?.PropertyT("enableAccessTokenIssuance"), out var __jsonEnableAccessTokenIssuance) ? (bool?)__jsonEnableAccessTokenIssuance : EnableAccessTokenIssuance;} - {_enableIdTokenIssuance = If( json?.PropertyT("enableIdTokenIssuance"), out var __jsonEnableIdTokenIssuance) ? (bool?)__jsonEnableIdTokenIssuance : EnableIdTokenIssuance;} + {_enableAccessTokenIssuance = If( json?.PropertyT("enableAccessTokenIssuance"), out var __jsonEnableAccessTokenIssuance) ? (bool?)__jsonEnableAccessTokenIssuance : _enableAccessTokenIssuance;} + {_enableIdTokenIssuance = If( json?.PropertyT("enableIdTokenIssuance"), out var __jsonEnableIdTokenIssuance) ? (bool?)__jsonEnableIdTokenIssuance : _enableIdTokenIssuance;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphInformationalUrl.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphInformationalUrl.json.cs index 2bb05de23374..382138759d52 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphInformationalUrl.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphInformationalUrl.json.cs @@ -79,11 +79,11 @@ internal MicrosoftGraphInformationalUrl(Microsoft.Azure.PowerShell.Cmdlets.Resou return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_logoUrl = If( json?.PropertyT("logoUrl"), out var __jsonLogoUrl) ? (string)__jsonLogoUrl : (string)LogoUrl;} - {_marketingUrl = If( json?.PropertyT("marketingUrl"), out var __jsonMarketingUrl) ? (string)__jsonMarketingUrl : (string)MarketingUrl;} - {_privacyStatementUrl = If( json?.PropertyT("privacyStatementUrl"), out var __jsonPrivacyStatementUrl) ? (string)__jsonPrivacyStatementUrl : (string)PrivacyStatementUrl;} - {_supportUrl = If( json?.PropertyT("supportUrl"), out var __jsonSupportUrl) ? (string)__jsonSupportUrl : (string)SupportUrl;} - {_termsOfServiceUrl = If( json?.PropertyT("termsOfServiceUrl"), out var __jsonTermsOfServiceUrl) ? (string)__jsonTermsOfServiceUrl : (string)TermsOfServiceUrl;} + {_logoUrl = If( json?.PropertyT("logoUrl"), out var __jsonLogoUrl) ? (string)__jsonLogoUrl : (string)_logoUrl;} + {_marketingUrl = If( json?.PropertyT("marketingUrl"), out var __jsonMarketingUrl) ? (string)__jsonMarketingUrl : (string)_marketingUrl;} + {_privacyStatementUrl = If( json?.PropertyT("privacyStatementUrl"), out var __jsonPrivacyStatementUrl) ? (string)__jsonPrivacyStatementUrl : (string)_privacyStatementUrl;} + {_supportUrl = If( json?.PropertyT("supportUrl"), out var __jsonSupportUrl) ? (string)__jsonSupportUrl : (string)_supportUrl;} + {_termsOfServiceUrl = If( json?.PropertyT("termsOfServiceUrl"), out var __jsonTermsOfServiceUrl) ? (string)__jsonTermsOfServiceUrl : (string)_termsOfServiceUrl;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphInternalDomainFederation.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphInternalDomainFederation.json.cs index 0bba18371763..0c58ea7010dc 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphInternalDomainFederation.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphInternalDomainFederation.json.cs @@ -79,13 +79,13 @@ internal MicrosoftGraphInternalDomainFederation(Microsoft.Azure.PowerShell.Cmdle return; } __microsoftGraphSamlOrWsFedProvider = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSamlOrWsFedProvider(json,new global::System.Collections.Generic.HashSet(){ @"id",@"displayName",@"issuerUri",@"metadataExchangeUri",@"passiveSignInUri",@"preferredAuthenticationProtocol",@"signingCertificate",@"activeSignInUri",@"federatedIdpMfaBehavior",@"isSignedAuthenticationRequestRequired",@"nextSigningCertificate",@"promptLoginBehavior",@"signingCertificateUpdateStatus",@"signOutUri" }); - {_activeSignInUri = If( json?.PropertyT("activeSignInUri"), out var __jsonActiveSignInUri) ? (string)__jsonActiveSignInUri : (string)ActiveSignInUri;} - {_federatedIdpMfaBehavior = If( json?.PropertyT("federatedIdpMfaBehavior"), out var __jsonFederatedIdpMfaBehavior) ? (string)__jsonFederatedIdpMfaBehavior : (string)FederatedIdpMfaBehavior;} - {_isSignedAuthenticationRequestRequired = If( json?.PropertyT("isSignedAuthenticationRequestRequired"), out var __jsonIsSignedAuthenticationRequestRequired) ? (bool?)__jsonIsSignedAuthenticationRequestRequired : IsSignedAuthenticationRequestRequired;} - {_nextSigningCertificate = If( json?.PropertyT("nextSigningCertificate"), out var __jsonNextSigningCertificate) ? (string)__jsonNextSigningCertificate : (string)NextSigningCertificate;} - {_promptLoginBehavior = If( json?.PropertyT("promptLoginBehavior"), out var __jsonPromptLoginBehavior) ? (string)__jsonPromptLoginBehavior : (string)PromptLoginBehavior;} - {_signOutUri = If( json?.PropertyT("signOutUri"), out var __jsonSignOutUri) ? (string)__jsonSignOutUri : (string)SignOutUri;} - {_signingCertificateUpdateStatus = If( json?.PropertyT("signingCertificateUpdateStatus"), out var __jsonSigningCertificateUpdateStatus) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSigningCertificateUpdateStatus.FromJson(__jsonSigningCertificateUpdateStatus) : SigningCertificateUpdateStatus;} + {_activeSignInUri = If( json?.PropertyT("activeSignInUri"), out var __jsonActiveSignInUri) ? (string)__jsonActiveSignInUri : (string)_activeSignInUri;} + {_federatedIdpMfaBehavior = If( json?.PropertyT("federatedIdpMfaBehavior"), out var __jsonFederatedIdpMfaBehavior) ? (string)__jsonFederatedIdpMfaBehavior : (string)_federatedIdpMfaBehavior;} + {_isSignedAuthenticationRequestRequired = If( json?.PropertyT("isSignedAuthenticationRequestRequired"), out var __jsonIsSignedAuthenticationRequestRequired) ? (bool?)__jsonIsSignedAuthenticationRequestRequired : _isSignedAuthenticationRequestRequired;} + {_nextSigningCertificate = If( json?.PropertyT("nextSigningCertificate"), out var __jsonNextSigningCertificate) ? (string)__jsonNextSigningCertificate : (string)_nextSigningCertificate;} + {_promptLoginBehavior = If( json?.PropertyT("promptLoginBehavior"), out var __jsonPromptLoginBehavior) ? (string)__jsonPromptLoginBehavior : (string)_promptLoginBehavior;} + {_signOutUri = If( json?.PropertyT("signOutUri"), out var __jsonSignOutUri) ? (string)__jsonSignOutUri : (string)_signOutUri;} + {_signingCertificateUpdateStatus = If( json?.PropertyT("signingCertificateUpdateStatus"), out var __jsonSigningCertificateUpdateStatus) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSigningCertificateUpdateStatus.FromJson(__jsonSigningCertificateUpdateStatus) : _signingCertificateUpdateStatus;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphInternalDomainFederationCollectionResponse.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphInternalDomainFederationCollectionResponse.json.cs index 8fc648cd18d9..8759e6d14a5a 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphInternalDomainFederationCollectionResponse.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphInternalDomainFederationCollectionResponse.json.cs @@ -80,8 +80,8 @@ internal MicrosoftGraphInternalDomainFederationCollectionResponse(Microsoft.Azur return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphInternalDomainFederation) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphInternalDomainFederation.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphInternalDomainFederation) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphInternalDomainFederation.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphKeyCredential.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphKeyCredential.json.cs index f8ae9c67538e..ef7c4ee378b3 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphKeyCredential.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphKeyCredential.json.cs @@ -80,13 +80,13 @@ internal MicrosoftGraphKeyCredential(Microsoft.Azure.PowerShell.Cmdlets.Resource } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); {_customKeyIdentifier = If( json?.PropertyT("customKeyIdentifier"), out var __w) ? System.Convert.FromBase64String( ((string)__w).Replace("_","/").Replace("-","+").PadRight( ((string)__w).Length + ((string)__w).Length * 3 % 4, '=') ) : null;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : EndDateTime : EndDateTime;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : _endDateTime : _endDateTime;} {_key = If( json?.PropertyT("key"), out var __u) ? System.Convert.FromBase64String( ((string)__u).Replace("_","/").Replace("-","+").PadRight( ((string)__u).Length + ((string)__u).Length * 3 % 4, '=') ) : null;} - {_keyId = If( json?.PropertyT("keyId"), out var __jsonKeyId) ? (string)__jsonKeyId : (string)KeyId;} - {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : StartDateTime : StartDateTime;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_usage = If( json?.PropertyT("usage"), out var __jsonUsage) ? (string)__jsonUsage : (string)Usage;} + {_keyId = If( json?.PropertyT("keyId"), out var __jsonKeyId) ? (string)__jsonKeyId : (string)_keyId;} + {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : _startDateTime : _startDateTime;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_usage = If( json?.PropertyT("usage"), out var __jsonUsage) ? (string)__jsonUsage : (string)_usage;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphKeyValue.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphKeyValue.json.cs index 683509100cd2..906b3f9a11ad 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphKeyValue.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphKeyValue.json.cs @@ -79,8 +79,8 @@ internal MicrosoftGraphKeyValue(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSG return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_key = If( json?.PropertyT("key"), out var __jsonKey) ? (string)__jsonKey : (string)Key;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_key = If( json?.PropertyT("key"), out var __jsonKey) ? (string)__jsonKey : (string)_key;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)_value;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphLicenseUnitsDetail.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphLicenseUnitsDetail.json.cs index 1faff11b448f..3c13a340a9ef 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphLicenseUnitsDetail.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphLicenseUnitsDetail.json.cs @@ -79,9 +79,9 @@ internal MicrosoftGraphLicenseUnitsDetail(Microsoft.Azure.PowerShell.Cmdlets.Res return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (int?)__jsonEnabled : Enabled;} - {_suspended = If( json?.PropertyT("suspended"), out var __jsonSuspended) ? (int?)__jsonSuspended : Suspended;} - {_warning = If( json?.PropertyT("warning"), out var __jsonWarning) ? (int?)__jsonWarning : Warning;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (int?)__jsonEnabled : _enabled;} + {_suspended = If( json?.PropertyT("suspended"), out var __jsonSuspended) ? (int?)__jsonSuspended : _suspended;} + {_warning = If( json?.PropertyT("warning"), out var __jsonWarning) ? (int?)__jsonWarning : _warning;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOAuth2PermissionGrant.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOAuth2PermissionGrant.json.cs index c60ca0b8cbbb..9197aa011da8 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOAuth2PermissionGrant.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOAuth2PermissionGrant.json.cs @@ -62,7 +62,7 @@ public partial class MicrosoftGraphOAuth2PermissionGrant /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOAuth2PermissionGrant FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphOAuth2PermissionGrant(json, new global::System.Collections.Generic.HashSet(){ @"id",@"clientId",@"consentType",@"principalId",@"resourceId",@"scope" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphOAuth2PermissionGrant(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"clientId",@"consentType",@"principalId",@"resourceId",@"scope" }) : null; } /// @@ -80,11 +80,11 @@ internal MicrosoftGraphOAuth2PermissionGrant(Microsoft.Azure.PowerShell.Cmdlets. } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); __microsoftGraphEntityAutoGenerated = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEntityAutoGenerated(json); - {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} - {_consentType = If( json?.PropertyT("consentType"), out var __jsonConsentType) ? (string)__jsonConsentType : (string)ConsentType;} - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)_clientId;} + {_consentType = If( json?.PropertyT("consentType"), out var __jsonConsentType) ? (string)__jsonConsentType : (string)_consentType;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)_resourceId;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphODataErrorsErrorDetails.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphODataErrorsErrorDetails.json.cs index 7c9c2712523a..e48c162726d8 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphODataErrorsErrorDetails.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphODataErrorsErrorDetails.json.cs @@ -78,9 +78,9 @@ internal MicrosoftGraphODataErrorsErrorDetails(Microsoft.Azure.PowerShell.Cmdlet return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} - {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} - {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)Target;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} + {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)_target;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphODataErrorsMainError.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphODataErrorsMainError.json.cs index 68e1688627f0..d0a88f1c4b32 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphODataErrorsMainError.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphODataErrorsMainError.json.cs @@ -78,11 +78,11 @@ internal MicrosoftGraphODataErrorsMainError(Microsoft.Azure.PowerShell.Cmdlets.R return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_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.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphODataErrorsErrorDetails) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphODataErrorsErrorDetails.FromJson(__u) )) ))() : null : Detail;} - {_innererror = If( json?.PropertyT("innererror"), out var __jsonInnererror) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphODataErrorsInnerError.FromJson(__jsonInnererror) : Innererror;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} + {_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.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphODataErrorsErrorDetails) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphODataErrorsErrorDetails.FromJson(__u) )) ))() : null : _detail;} + {_innererror = If( json?.PropertyT("innererror"), out var __jsonInnererror) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphODataErrorsInnerError.FromJson(__jsonInnererror) : _innererror;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphODataErrorsOdataError.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphODataErrorsOdataError.json.cs index 973af5f97722..274d6e3c7568 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphODataErrorsOdataError.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphODataErrorsOdataError.json.cs @@ -78,7 +78,7 @@ internal MicrosoftGraphODataErrorsOdataError(Microsoft.Azure.PowerShell.Cmdlets. return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphODataErrorsMainError.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphODataErrorsMainError.FromJson(__jsonError) : _error;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphObjectIdentity.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphObjectIdentity.json.cs index 0155c84b8d08..289e22bc48b9 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphObjectIdentity.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphObjectIdentity.json.cs @@ -79,9 +79,9 @@ internal MicrosoftGraphObjectIdentity(Microsoft.Azure.PowerShell.Cmdlets.Resourc return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_issuer = If( json?.PropertyT("issuer"), out var __jsonIssuer) ? (string)__jsonIssuer : (string)Issuer;} - {_issuerAssignedId = If( json?.PropertyT("issuerAssignedId"), out var __jsonIssuerAssignedId) ? (string)__jsonIssuerAssignedId : (string)IssuerAssignedId;} - {_signInType = If( json?.PropertyT("signInType"), out var __jsonSignInType) ? (string)__jsonSignInType : (string)SignInType;} + {_issuer = If( json?.PropertyT("issuer"), out var __jsonIssuer) ? (string)__jsonIssuer : (string)_issuer;} + {_issuerAssignedId = If( json?.PropertyT("issuerAssignedId"), out var __jsonIssuerAssignedId) ? (string)__jsonIssuerAssignedId : (string)_issuerAssignedId;} + {_signInType = If( json?.PropertyT("signInType"), out var __jsonSignInType) ? (string)__jsonSignInType : (string)_signInType;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOnPremisesProvisioningError.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOnPremisesProvisioningError.json.cs index 5aa796396751..f8fd9836ee90 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOnPremisesProvisioningError.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOnPremisesProvisioningError.json.cs @@ -79,10 +79,10 @@ internal MicrosoftGraphOnPremisesProvisioningError(Microsoft.Azure.PowerShell.Cm return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)Category;} - {_occurredDateTime = If( json?.PropertyT("occurredDateTime"), out var __jsonOccurredDateTime) ? global::System.DateTime.TryParse((string)__jsonOccurredDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonOccurredDateTimeValue) ? __jsonOccurredDateTimeValue : OccurredDateTime : OccurredDateTime;} - {_propertyCausingError = If( json?.PropertyT("propertyCausingError"), out var __jsonPropertyCausingError) ? (string)__jsonPropertyCausingError : (string)PropertyCausingError;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)_category;} + {_occurredDateTime = If( json?.PropertyT("occurredDateTime"), out var __jsonOccurredDateTime) ? global::System.DateTime.TryParse((string)__jsonOccurredDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonOccurredDateTimeValue) ? __jsonOccurredDateTimeValue : _occurredDateTime : _occurredDateTime;} + {_propertyCausingError = If( json?.PropertyT("propertyCausingError"), out var __jsonPropertyCausingError) ? (string)__jsonPropertyCausingError : (string)_propertyCausingError;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)_value;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOptionalClaim.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOptionalClaim.json.cs index fdeeb02c4544..19883474bc98 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOptionalClaim.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOptionalClaim.json.cs @@ -79,10 +79,10 @@ internal MicrosoftGraphOptionalClaim(Microsoft.Azure.PowerShell.Cmdlets.Resource return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_additionalProperty = If( json?.PropertyT("additionalProperties"), out var __jsonAdditionalProperties) ? If( __jsonAdditionalProperties as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AdditionalProperty;} - {_essential = If( json?.PropertyT("essential"), out var __jsonEssential) ? (bool?)__jsonEssential : Essential;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_source = If( json?.PropertyT("source"), out var __jsonSource) ? (string)__jsonSource : (string)Source;} + {_additionalProperty = If( json?.PropertyT("additionalProperties"), out var __jsonAdditionalProperties) ? If( __jsonAdditionalProperties as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _additionalProperty;} + {_essential = If( json?.PropertyT("essential"), out var __jsonEssential) ? (bool?)__jsonEssential : _essential;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_source = If( json?.PropertyT("source"), out var __jsonSource) ? (string)__jsonSource : (string)_source;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOptionalClaims.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOptionalClaims.json.cs index 6f5603f6ebfb..39f9951c4a83 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOptionalClaims.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOptionalClaims.json.cs @@ -79,9 +79,9 @@ internal MicrosoftGraphOptionalClaims(Microsoft.Azure.PowerShell.Cmdlets.Resourc return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_accessToken = If( json?.PropertyT("accessToken"), out var __jsonAccessToken) ? If( __jsonAccessToken as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOptionalClaim) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOptionalClaim.FromJson(__u) )) ))() : null : AccessToken;} - {_idToken = If( json?.PropertyT("idToken"), out var __jsonIdToken) ? If( __jsonIdToken as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOptionalClaim) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOptionalClaim.FromJson(__p) )) ))() : null : IdToken;} - {_saml2Token = If( json?.PropertyT("saml2Token"), out var __jsonSaml2Token) ? If( __jsonSaml2Token as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOptionalClaim) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOptionalClaim.FromJson(__k) )) ))() : null : Saml2Token;} + {_accessToken = If( json?.PropertyT("accessToken"), out var __jsonAccessToken) ? If( __jsonAccessToken as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOptionalClaim) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOptionalClaim.FromJson(__u) )) ))() : null : _accessToken;} + {_idToken = If( json?.PropertyT("idToken"), out var __jsonIdToken) ? If( __jsonIdToken as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOptionalClaim) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOptionalClaim.FromJson(__p) )) ))() : null : _idToken;} + {_saml2Token = If( json?.PropertyT("saml2Token"), out var __jsonSaml2Token) ? If( __jsonSaml2Token as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOptionalClaim) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOptionalClaim.FromJson(__k) )) ))() : null : _saml2Token;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrgContact.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrgContact.cs index f81f238025d9..e77cfc8b4965 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrgContact.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrgContact.cs @@ -86,7 +86,7 @@ public partial class MicrosoftGraphOrgContact : /// types. /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject Manager { get => (this._manager = this._manager ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject()); set => this._manager = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject Manager { get => (this._manager = this._manager ?? new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject()); set => this._manager = value; } [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inlined)] public global::System.DateTime? ManagerDeletedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)Manager).DeletedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)Manager).DeletedDateTime = value ?? default(global::System.DateTime); } @@ -116,9 +116,6 @@ public partial class MicrosoftGraphOrgContact : /// Internal Acessors for OdataId string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId = value; } - /// Internal Acessors for OdataType - string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = value; } - /// Internal Acessors for Id string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id = value; } @@ -139,8 +136,9 @@ public partial class MicrosoftGraphOrgContact : public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; } /// The type of object in directory + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; } + public string OdataType { get => "microsoft.graph.orgContact"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = "microsoft.graph.orgContact"; } /// Backing field for property. private global::System.DateTime? _onPremisesLastSyncDateTime; @@ -325,7 +323,7 @@ public partial interface IMicrosoftGraphOrgContact : Create = false, Update = false, Description = @"Read-only.", - SerializedName = @"id", + SerializedName = @"ResourceGroupName", PossibleTypes = new [] { typeof(string) })] string ManagerId { get; } /// The full id of object in directory diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrgContact.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrgContact.json.cs index 2ce6cb06606c..e1473098ad20 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrgContact.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrgContact.json.cs @@ -62,7 +62,7 @@ public partial class MicrosoftGraphOrgContact /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrgContact FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphOrgContact(json, new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"addresses",@"companyName",@"department",@"givenName",@"jobTitle",@"mail",@"mailNickname",@"onPremisesLastSyncDateTime",@"onPremisesProvisioningErrors",@"onPremisesSyncEnabled",@"phones",@"proxyAddresses",@"surname",@"directReports",@"manager",@"memberOf",@"transitiveMemberOf" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphOrgContact(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"addresses",@"companyName",@"department",@"givenName",@"jobTitle",@"mail",@"mailNickname",@"onPremisesLastSyncDateTime",@"onPremisesProvisioningErrors",@"onPremisesSyncEnabled",@"phones",@"proxyAddresses",@"surname",@"directReports",@"manager",@"memberOf",@"transitiveMemberOf" }) : null; } /// @@ -80,23 +80,23 @@ internal MicrosoftGraphOrgContact(Microsoft.Azure.PowerShell.Cmdlets.Resources.M } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); __microsoftGraphDirectoryObject = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject(json); - {_manager = If( json?.PropertyT("manager"), out var __jsonManager) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__jsonManager) : Manager;} - {_address = If( json?.PropertyT("addresses"), out var __jsonAddresses) ? If( __jsonAddresses as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPhysicalOfficeAddress) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPhysicalOfficeAddress.FromJson(__u) )) ))() : null : Address;} - {_companyName = If( json?.PropertyT("companyName"), out var __jsonCompanyName) ? (string)__jsonCompanyName : (string)CompanyName;} - {_department = If( json?.PropertyT("department"), out var __jsonDepartment) ? (string)__jsonDepartment : (string)Department;} - {_givenName = If( json?.PropertyT("givenName"), out var __jsonGivenName) ? (string)__jsonGivenName : (string)GivenName;} - {_jobTitle = If( json?.PropertyT("jobTitle"), out var __jsonJobTitle) ? (string)__jsonJobTitle : (string)JobTitle;} - {_mail = If( json?.PropertyT("mail"), out var __jsonMail) ? (string)__jsonMail : (string)Mail;} - {_mailNickname = If( json?.PropertyT("mailNickname"), out var __jsonMailNickname) ? (string)__jsonMailNickname : (string)MailNickname;} - {_onPremisesLastSyncDateTime = If( json?.PropertyT("onPremisesLastSyncDateTime"), out var __jsonOnPremisesLastSyncDateTime) ? global::System.DateTime.TryParse((string)__jsonOnPremisesLastSyncDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonOnPremisesLastSyncDateTimeValue) ? __jsonOnPremisesLastSyncDateTimeValue : OnPremisesLastSyncDateTime : OnPremisesLastSyncDateTime;} - {_onPremisesProvisioningError = If( json?.PropertyT("onPremisesProvisioningErrors"), out var __jsonOnPremisesProvisioningErrors) ? If( __jsonOnPremisesProvisioningErrors as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOnPremisesProvisioningError) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOnPremisesProvisioningError.FromJson(__p) )) ))() : null : OnPremisesProvisioningError;} - {_onPremisesSyncEnabled = If( json?.PropertyT("onPremisesSyncEnabled"), out var __jsonOnPremisesSyncEnabled) ? (bool?)__jsonOnPremisesSyncEnabled : OnPremisesSyncEnabled;} - {_phone = If( json?.PropertyT("phones"), out var __jsonPhones) ? If( __jsonPhones as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPhone) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPhone.FromJson(__k) )) ))() : null : Phone;} - {_proxyAddress = If( json?.PropertyT("proxyAddresses"), out var __jsonProxyAddresses) ? If( __jsonProxyAddresses as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(string) (__f is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __e ? (string)(__e.ToString()) : null)) ))() : null : ProxyAddress;} - {_surname = If( json?.PropertyT("surname"), out var __jsonSurname) ? (string)__jsonSurname : (string)Surname;} - {_directReport = If( json?.PropertyT("directReports"), out var __jsonDirectReports) ? If( __jsonDirectReports as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__a) )) ))() : null : DirectReport;} - {_memberOf = If( json?.PropertyT("memberOf"), out var __jsonMemberOf) ? If( __jsonMemberOf as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___w) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___w, (___v)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(___v) )) ))() : null : MemberOf;} - {_transitiveMemberOf = If( json?.PropertyT("transitiveMemberOf"), out var __jsonTransitiveMemberOf) ? If( __jsonTransitiveMemberOf as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___r) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___r, (___q)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(___q) )) ))() : null : TransitiveMemberOf;} + {_manager = If( json?.PropertyT("manager"), out var __jsonManager) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__jsonManager) : _manager;} + {_address = If( json?.PropertyT("addresses"), out var __jsonAddresses) ? If( __jsonAddresses as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPhysicalOfficeAddress) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPhysicalOfficeAddress.FromJson(__u) )) ))() : null : _address;} + {_companyName = If( json?.PropertyT("companyName"), out var __jsonCompanyName) ? (string)__jsonCompanyName : (string)_companyName;} + {_department = If( json?.PropertyT("department"), out var __jsonDepartment) ? (string)__jsonDepartment : (string)_department;} + {_givenName = If( json?.PropertyT("givenName"), out var __jsonGivenName) ? (string)__jsonGivenName : (string)_givenName;} + {_jobTitle = If( json?.PropertyT("jobTitle"), out var __jsonJobTitle) ? (string)__jsonJobTitle : (string)_jobTitle;} + {_mail = If( json?.PropertyT("mail"), out var __jsonMail) ? (string)__jsonMail : (string)_mail;} + {_mailNickname = If( json?.PropertyT("mailNickname"), out var __jsonMailNickname) ? (string)__jsonMailNickname : (string)_mailNickname;} + {_onPremisesLastSyncDateTime = If( json?.PropertyT("onPremisesLastSyncDateTime"), out var __jsonOnPremisesLastSyncDateTime) ? global::System.DateTime.TryParse((string)__jsonOnPremisesLastSyncDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonOnPremisesLastSyncDateTimeValue) ? __jsonOnPremisesLastSyncDateTimeValue : _onPremisesLastSyncDateTime : _onPremisesLastSyncDateTime;} + {_onPremisesProvisioningError = If( json?.PropertyT("onPremisesProvisioningErrors"), out var __jsonOnPremisesProvisioningErrors) ? If( __jsonOnPremisesProvisioningErrors as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOnPremisesProvisioningError) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOnPremisesProvisioningError.FromJson(__p) )) ))() : null : _onPremisesProvisioningError;} + {_onPremisesSyncEnabled = If( json?.PropertyT("onPremisesSyncEnabled"), out var __jsonOnPremisesSyncEnabled) ? (bool?)__jsonOnPremisesSyncEnabled : _onPremisesSyncEnabled;} + {_phone = If( json?.PropertyT("phones"), out var __jsonPhones) ? If( __jsonPhones as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPhone) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPhone.FromJson(__k) )) ))() : null : _phone;} + {_proxyAddress = If( json?.PropertyT("proxyAddresses"), out var __jsonProxyAddresses) ? If( __jsonProxyAddresses as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(string) (__f is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __e ? (string)(__e.ToString()) : null)) ))() : null : _proxyAddress;} + {_surname = If( json?.PropertyT("surname"), out var __jsonSurname) ? (string)__jsonSurname : (string)_surname;} + {_directReport = If( json?.PropertyT("directReports"), out var __jsonDirectReports) ? If( __jsonDirectReports as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__a) )) ))() : null : _directReport;} + {_memberOf = If( json?.PropertyT("memberOf"), out var __jsonMemberOf) ? If( __jsonMemberOf as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___w) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___w, (___v)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(___v) )) ))() : null : _memberOf;} + {_transitiveMemberOf = If( json?.PropertyT("transitiveMemberOf"), out var __jsonTransitiveMemberOf) ? If( __jsonTransitiveMemberOf as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___r) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___r, (___q)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(___q) )) ))() : null : _transitiveMemberOf;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrgContactCollectionResponse.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrgContactCollectionResponse.json.cs index a5277486badb..272df0a39bf8 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrgContactCollectionResponse.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrgContactCollectionResponse.json.cs @@ -79,8 +79,8 @@ internal MicrosoftGraphOrgContactCollectionResponse(Microsoft.Azure.PowerShell.C return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrgContact) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrgContact.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrgContact) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrgContact.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganization.PowerShell.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganization.PowerShell.cs index 6c44c2e97b76..d62cb52e988b 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganization.PowerShell.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganization.PowerShell.cs @@ -189,7 +189,7 @@ internal MicrosoftGraphOrganization(global::System.Collections.IDictionary conte } if (content.Contains("MobileDeviceManagementAuthority")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganizationInternal)this).MobileDeviceManagementAuthority = (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority?) content.GetValueForProperty("MobileDeviceManagementAuthority",((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganizationInternal)this).MobileDeviceManagementAuthority, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganizationInternal)this).MobileDeviceManagementAuthority = (string) content.GetValueForProperty("MobileDeviceManagementAuthority",((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganizationInternal)this).MobileDeviceManagementAuthority, global::System.Convert.ToString); } if (content.Contains("CertificateBasedAuthConfiguration")) { @@ -324,7 +324,7 @@ internal MicrosoftGraphOrganization(global::System.Management.Automation.PSObjec } if (content.Contains("MobileDeviceManagementAuthority")) { - ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganizationInternal)this).MobileDeviceManagementAuthority = (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority?) content.GetValueForProperty("MobileDeviceManagementAuthority",((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganizationInternal)this).MobileDeviceManagementAuthority, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganizationInternal)this).MobileDeviceManagementAuthority = (string) content.GetValueForProperty("MobileDeviceManagementAuthority",((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganizationInternal)this).MobileDeviceManagementAuthority, global::System.Convert.ToString); } if (content.Contains("CertificateBasedAuthConfiguration")) { diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganization.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganization.cs index eae6619ac335..8b6aa1a07b82 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganization.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganization.cs @@ -114,26 +114,24 @@ public partial class MicrosoftGraphOrganization : /// Internal Acessors for OdataId string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId = value; } - /// Internal Acessors for OdataType - string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = value; } - /// Internal Acessors for Id string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority? _mobileDeviceManagementAuthority; + private string _mobileDeviceManagementAuthority; /// Mobile device management authority. [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority? MobileDeviceManagementAuthority { get => this._mobileDeviceManagementAuthority; set => this._mobileDeviceManagementAuthority = value; } + public string MobileDeviceManagementAuthority { get => this._mobileDeviceManagementAuthority; set => this._mobileDeviceManagementAuthority = value; } /// The full id of object in directory [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; } /// The type of object in directory + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; } + public string OdataType { get => "microsoft.graph.organization"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = "microsoft.graph.organization"; } /// Backing field for property. private global::System.DateTime? _onPremisesLastSyncDateTime; @@ -186,6 +184,10 @@ public partial class MicrosoftGraphOrganization : [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Owned)] public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphProvisionedPlan[] ProvisionedPlan { get => this._provisionedPlan; set => this._provisionedPlan = value; } + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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); } + /// Backing field for property. private string[] _securityComplianceNotificationMail; @@ -386,8 +388,9 @@ public partial interface IMicrosoftGraphOrganization : Update = true, Description = @"Mobile device management authority.", SerializedName = @"mobileDeviceManagementAuthority", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority) })] - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority? MobileDeviceManagementAuthority { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PSArgumentCompleterAttribute("unknown", "intune", "sccm", "office365")] + string MobileDeviceManagementAuthority { get; set; } /// /// The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date /// and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. @@ -578,7 +581,8 @@ internal partial interface IMicrosoftGraphOrganizationInternal : /// Not nullable. string[] MarketingNotificationEmail { get; set; } /// Mobile device management authority. - Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority? MobileDeviceManagementAuthority { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PSArgumentCompleterAttribute("unknown", "intune", "sccm", "office365")] + string MobileDeviceManagementAuthority { get; set; } /// /// The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date /// and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganization.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganization.json.cs index a2c51c4e74c8..03c7caa976c4 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganization.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganization.json.cs @@ -62,7 +62,7 @@ public partial class MicrosoftGraphOrganization /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganization FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphOrganization(json, new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"assignedPlans",@"businessPhones",@"city",@"country",@"countryLetterCode",@"createdDateTime",@"marketingNotificationEmails",@"onPremisesLastSyncDateTime",@"onPremisesSyncEnabled",@"postalCode",@"preferredLanguage",@"privacyProfile",@"provisionedPlans",@"securityComplianceNotificationMails",@"securityComplianceNotificationPhones",@"state",@"street",@"technicalNotificationMails",@"tenantType",@"verifiedDomains",@"mobileDeviceManagementAuthority",@"branding",@"certificateBasedAuthConfiguration",@"extensions" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphOrganization(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"assignedPlans",@"businessPhones",@"city",@"country",@"countryLetterCode",@"createdDateTime",@"marketingNotificationEmails",@"onPremisesLastSyncDateTime",@"onPremisesSyncEnabled",@"postalCode",@"preferredLanguage",@"privacyProfile",@"provisionedPlans",@"securityComplianceNotificationMails",@"securityComplianceNotificationPhones",@"state",@"street",@"technicalNotificationMails",@"tenantType",@"verifiedDomains",@"mobileDeviceManagementAuthority",@"branding",@"certificateBasedAuthConfiguration",@"extensions" }) : null; } /// @@ -80,30 +80,30 @@ internal MicrosoftGraphOrganization(Microsoft.Azure.PowerShell.Cmdlets.Resources } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); __microsoftGraphDirectoryObject = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject(json); - {_assignedPlan = If( json?.PropertyT("assignedPlans"), out var __jsonAssignedPlans) ? If( __jsonAssignedPlans as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAssignedPlan) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAssignedPlan.FromJson(__u) )) ))() : null : AssignedPlan;} - {_businessPhone = If( json?.PropertyT("businessPhones"), out var __jsonBusinessPhones) ? If( __jsonBusinessPhones as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : BusinessPhone;} - {_city = If( json?.PropertyT("city"), out var __jsonCity) ? (string)__jsonCity : (string)City;} - {_country = If( json?.PropertyT("country"), out var __jsonCountry) ? (string)__jsonCountry : (string)Country;} - {_countryLetterCode = If( json?.PropertyT("countryLetterCode"), out var __jsonCountryLetterCode) ? (string)__jsonCountryLetterCode : (string)CountryLetterCode;} - {_createdDateTime = If( json?.PropertyT("createdDateTime"), out var __jsonCreatedDateTime) ? global::System.DateTime.TryParse((string)__jsonCreatedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedDateTimeValue) ? __jsonCreatedDateTimeValue : CreatedDateTime : CreatedDateTime;} - {_marketingNotificationEmail = If( json?.PropertyT("marketingNotificationEmails"), out var __jsonMarketingNotificationEmails) ? If( __jsonMarketingNotificationEmails as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : MarketingNotificationEmail;} - {_onPremisesLastSyncDateTime = If( json?.PropertyT("onPremisesLastSyncDateTime"), out var __jsonOnPremisesLastSyncDateTime) ? global::System.DateTime.TryParse((string)__jsonOnPremisesLastSyncDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonOnPremisesLastSyncDateTimeValue) ? __jsonOnPremisesLastSyncDateTimeValue : OnPremisesLastSyncDateTime : OnPremisesLastSyncDateTime;} - {_onPremisesSyncEnabled = If( json?.PropertyT("onPremisesSyncEnabled"), out var __jsonOnPremisesSyncEnabled) ? (bool?)__jsonOnPremisesSyncEnabled : OnPremisesSyncEnabled;} - {_postalCode = If( json?.PropertyT("postalCode"), out var __jsonPostalCode) ? (string)__jsonPostalCode : (string)PostalCode;} - {_preferredLanguage = If( json?.PropertyT("preferredLanguage"), out var __jsonPreferredLanguage) ? (string)__jsonPreferredLanguage : (string)PreferredLanguage;} - {_provisionedPlan = If( json?.PropertyT("provisionedPlans"), out var __jsonProvisionedPlans) ? If( __jsonProvisionedPlans as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphProvisionedPlan) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphProvisionedPlan.FromJson(__f) )) ))() : null : ProvisionedPlan;} - {_securityComplianceNotificationMail = If( json?.PropertyT("securityComplianceNotificationMails"), out var __jsonSecurityComplianceNotificationMails) ? If( __jsonSecurityComplianceNotificationMails as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(string) (__a is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString ___z ? (string)(___z.ToString()) : null)) ))() : null : SecurityComplianceNotificationMail;} - {_securityComplianceNotificationPhone = If( json?.PropertyT("securityComplianceNotificationPhones"), out var __jsonSecurityComplianceNotificationPhones) ? If( __jsonSecurityComplianceNotificationPhones as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___w) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___w, (___v)=>(string) (___v is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString ___u ? (string)(___u.ToString()) : null)) ))() : null : SecurityComplianceNotificationPhone;} - {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} - {_street = If( json?.PropertyT("street"), out var __jsonStreet) ? (string)__jsonStreet : (string)Street;} - {_technicalNotificationMail = If( json?.PropertyT("technicalNotificationMails"), out var __jsonTechnicalNotificationMails) ? If( __jsonTechnicalNotificationMails as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___r) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___r, (___q)=>(string) (___q is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString ___p ? (string)(___p.ToString()) : null)) ))() : null : TechnicalNotificationMail;} - {_tenantType = If( json?.PropertyT("tenantType"), out var __jsonTenantType) ? (string)__jsonTenantType : (string)TenantType;} - {_verifiedDomain = If( json?.PropertyT("verifiedDomains"), out var __jsonVerifiedDomains) ? If( __jsonVerifiedDomains as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___m) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___m, (___l)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphVerifiedDomain) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphVerifiedDomain.FromJson(___l) )) ))() : null : VerifiedDomain;} - {_mobileDeviceManagementAuthority = If( json?.PropertyT("mobileDeviceManagementAuthority"), out var __jsonMobileDeviceManagementAuthority) ? (string)__jsonMobileDeviceManagementAuthority : (string)MobileDeviceManagementAuthority;} - {_certificateBasedAuthConfiguration = If( json?.PropertyT("certificateBasedAuthConfiguration"), out var __jsonCertificateBasedAuthConfiguration) ? If( __jsonCertificateBasedAuthConfiguration as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___h) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___h, (___g)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphCertificateBasedAuthConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphCertificateBasedAuthConfiguration.FromJson(___g) )) ))() : null : CertificateBasedAuthConfiguration;} - {_extension = If( json?.PropertyT("extensions"), out var __jsonExtensions) ? If( __jsonExtensions as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___c) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___c, (___b)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphExtension) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphExtension.FromJson(___b) )) ))() : null : Extension;} - {_privacyProfile = If( json?.PropertyT("privacyProfile"), out var __jsonPrivacyProfile) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPrivacyProfile.FromJson(__jsonPrivacyProfile) : PrivacyProfile;} - {_branding = If( json?.PropertyT("branding"), out var __jsonBranding) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationalBranding.FromJson(__jsonBranding) : Branding;} + {_assignedPlan = If( json?.PropertyT("assignedPlans"), out var __jsonAssignedPlans) ? If( __jsonAssignedPlans as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAssignedPlan) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAssignedPlan.FromJson(__u) )) ))() : null : _assignedPlan;} + {_businessPhone = If( json?.PropertyT("businessPhones"), out var __jsonBusinessPhones) ? If( __jsonBusinessPhones as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _businessPhone;} + {_city = If( json?.PropertyT("city"), out var __jsonCity) ? (string)__jsonCity : (string)_city;} + {_country = If( json?.PropertyT("country"), out var __jsonCountry) ? (string)__jsonCountry : (string)_country;} + {_countryLetterCode = If( json?.PropertyT("countryLetterCode"), out var __jsonCountryLetterCode) ? (string)__jsonCountryLetterCode : (string)_countryLetterCode;} + {_createdDateTime = If( json?.PropertyT("createdDateTime"), out var __jsonCreatedDateTime) ? global::System.DateTime.TryParse((string)__jsonCreatedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedDateTimeValue) ? __jsonCreatedDateTimeValue : _createdDateTime : _createdDateTime;} + {_marketingNotificationEmail = If( json?.PropertyT("marketingNotificationEmails"), out var __jsonMarketingNotificationEmails) ? If( __jsonMarketingNotificationEmails as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : _marketingNotificationEmail;} + {_onPremisesLastSyncDateTime = If( json?.PropertyT("onPremisesLastSyncDateTime"), out var __jsonOnPremisesLastSyncDateTime) ? global::System.DateTime.TryParse((string)__jsonOnPremisesLastSyncDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonOnPremisesLastSyncDateTimeValue) ? __jsonOnPremisesLastSyncDateTimeValue : _onPremisesLastSyncDateTime : _onPremisesLastSyncDateTime;} + {_onPremisesSyncEnabled = If( json?.PropertyT("onPremisesSyncEnabled"), out var __jsonOnPremisesSyncEnabled) ? (bool?)__jsonOnPremisesSyncEnabled : _onPremisesSyncEnabled;} + {_postalCode = If( json?.PropertyT("postalCode"), out var __jsonPostalCode) ? (string)__jsonPostalCode : (string)_postalCode;} + {_preferredLanguage = If( json?.PropertyT("preferredLanguage"), out var __jsonPreferredLanguage) ? (string)__jsonPreferredLanguage : (string)_preferredLanguage;} + {_provisionedPlan = If( json?.PropertyT("provisionedPlans"), out var __jsonProvisionedPlans) ? If( __jsonProvisionedPlans as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphProvisionedPlan) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphProvisionedPlan.FromJson(__f) )) ))() : null : _provisionedPlan;} + {_securityComplianceNotificationMail = If( json?.PropertyT("securityComplianceNotificationMails"), out var __jsonSecurityComplianceNotificationMails) ? If( __jsonSecurityComplianceNotificationMails as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(string) (__a is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString ___z ? (string)(___z.ToString()) : null)) ))() : null : _securityComplianceNotificationMail;} + {_securityComplianceNotificationPhone = If( json?.PropertyT("securityComplianceNotificationPhones"), out var __jsonSecurityComplianceNotificationPhones) ? If( __jsonSecurityComplianceNotificationPhones as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___w) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___w, (___v)=>(string) (___v is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString ___u ? (string)(___u.ToString()) : null)) ))() : null : _securityComplianceNotificationPhone;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)_state;} + {_street = If( json?.PropertyT("street"), out var __jsonStreet) ? (string)__jsonStreet : (string)_street;} + {_technicalNotificationMail = If( json?.PropertyT("technicalNotificationMails"), out var __jsonTechnicalNotificationMails) ? If( __jsonTechnicalNotificationMails as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___r) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___r, (___q)=>(string) (___q is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString ___p ? (string)(___p.ToString()) : null)) ))() : null : _technicalNotificationMail;} + {_tenantType = If( json?.PropertyT("tenantType"), out var __jsonTenantType) ? (string)__jsonTenantType : (string)_tenantType;} + {_verifiedDomain = If( json?.PropertyT("verifiedDomains"), out var __jsonVerifiedDomains) ? If( __jsonVerifiedDomains as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___m) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___m, (___l)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphVerifiedDomain) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphVerifiedDomain.FromJson(___l) )) ))() : null : _verifiedDomain;} + {_mobileDeviceManagementAuthority = If( json?.PropertyT("mobileDeviceManagementAuthority"), out var __jsonMobileDeviceManagementAuthority) ? (string)__jsonMobileDeviceManagementAuthority : (string)_mobileDeviceManagementAuthority;} + {_certificateBasedAuthConfiguration = If( json?.PropertyT("certificateBasedAuthConfiguration"), out var __jsonCertificateBasedAuthConfiguration) ? If( __jsonCertificateBasedAuthConfiguration as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___h) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___h, (___g)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphCertificateBasedAuthConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphCertificateBasedAuthConfiguration.FromJson(___g) )) ))() : null : _certificateBasedAuthConfiguration;} + {_extension = If( json?.PropertyT("extensions"), out var __jsonExtensions) ? If( __jsonExtensions as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___c) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___c, (___b)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphExtension) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphExtension.FromJson(___b) )) ))() : null : _extension;} + {_privacyProfile = If( json?.PropertyT("privacyProfile"), out var __jsonPrivacyProfile) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPrivacyProfile.FromJson(__jsonPrivacyProfile) : _privacyProfile;} + {_branding = If( json?.PropertyT("branding"), out var __jsonBranding) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationalBranding.FromJson(__jsonBranding) : _branding;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationCollectionResponse.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationCollectionResponse.json.cs index ebd5295b587c..afbb2cf307c9 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationCollectionResponse.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationCollectionResponse.json.cs @@ -80,8 +80,8 @@ internal MicrosoftGraphOrganizationCollectionResponse(Microsoft.Azure.PowerShell return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganization) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganization.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganization) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganization.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationalBranding.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationalBranding.cs index 27339b7e0890..3f3dca2ef1b1 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationalBranding.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationalBranding.cs @@ -59,7 +59,7 @@ public partial class MicrosoftGraphOrganizationalBranding : /// are used at the same time for high availability of read requests. Read-only. /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string[] CdnList { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganizationalBrandingPropertiesInternal)__microsoftGraphOrganizationalBrandingProperties).CdnList; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganizationalBrandingPropertiesInternal)__microsoftGraphOrganizationalBrandingProperties).CdnList = value ?? null /* arrayOf */; } + public string[] CdnList { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganizationalBrandingPropertiesInternal)__microsoftGraphOrganizationalBrandingProperties).CdnList; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganizationalBrandingPropertiesInternal)__microsoftGraphOrganizationalBrandingProperties).CdnList = value ?? null /* fixedArrayOf */; } /// The unique idenfier for an entity. Read-only. [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationalBranding.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationalBranding.json.cs index 47ad3c377710..3af55b5db039 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationalBranding.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationalBranding.json.cs @@ -79,7 +79,7 @@ internal MicrosoftGraphOrganizationalBranding(Microsoft.Azure.PowerShell.Cmdlets return; } __microsoftGraphOrganizationalBrandingProperties = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationalBrandingProperties(json,new global::System.Collections.Generic.HashSet(){ @"id",@"backgroundColor",@"backgroundImage",@"backgroundImageRelativeUrl",@"bannerLogo",@"bannerLogoRelativeUrl",@"cdnList",@"signInPageText",@"squareLogo",@"squareLogoRelativeUrl",@"usernameHintText",@"localizations" }); - {_localization = If( json?.PropertyT("localizations"), out var __jsonLocalizations) ? If( __jsonLocalizations as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganizationalBrandingLocalization) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationalBrandingLocalization.FromJson(__u) )) ))() : null : Localization;} + {_localization = If( json?.PropertyT("localizations"), out var __jsonLocalizations) ? If( __jsonLocalizations as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganizationalBrandingLocalization) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationalBrandingLocalization.FromJson(__u) )) ))() : null : _localization;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationalBrandingLocalization.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationalBrandingLocalization.cs index 6d2206aa6a0c..f2102c1b9b0c 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationalBrandingLocalization.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationalBrandingLocalization.cs @@ -59,7 +59,7 @@ public partial class MicrosoftGraphOrganizationalBrandingLocalization : /// are used at the same time for high availability of read requests. Read-only. /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string[] CdnList { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganizationalBrandingPropertiesInternal)__microsoftGraphOrganizationalBrandingProperties).CdnList; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganizationalBrandingPropertiesInternal)__microsoftGraphOrganizationalBrandingProperties).CdnList = value ?? null /* arrayOf */; } + public string[] CdnList { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganizationalBrandingPropertiesInternal)__microsoftGraphOrganizationalBrandingProperties).CdnList; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganizationalBrandingPropertiesInternal)__microsoftGraphOrganizationalBrandingProperties).CdnList = value ?? null /* fixedArrayOf */; } /// The unique idenfier for an entity. Read-only. [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationalBrandingLocalizationCollectionResponse.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationalBrandingLocalizationCollectionResponse.json.cs index ca8909332120..778ee68bbe3a 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationalBrandingLocalizationCollectionResponse.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationalBrandingLocalizationCollectionResponse.json.cs @@ -80,8 +80,8 @@ internal MicrosoftGraphOrganizationalBrandingLocalizationCollectionResponse(Micr return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganizationalBrandingLocalization) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationalBrandingLocalization.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganizationalBrandingLocalization) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOrganizationalBrandingLocalization.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationalBrandingProperties.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationalBrandingProperties.json.cs index 27897d5d66ae..18f5fed041ca 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationalBrandingProperties.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphOrganizationalBrandingProperties.json.cs @@ -80,16 +80,16 @@ internal MicrosoftGraphOrganizationalBrandingProperties(Microsoft.Azure.PowerShe return; } __microsoftGraphEntity = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEntity(json,new global::System.Collections.Generic.HashSet(){ @"id",@"backgroundColor",@"backgroundImage",@"backgroundImageRelativeUrl",@"bannerLogo",@"bannerLogoRelativeUrl",@"cdnList",@"signInPageText",@"squareLogo",@"squareLogoRelativeUrl",@"usernameHintText" }); - {_backgroundColor = If( json?.PropertyT("backgroundColor"), out var __jsonBackgroundColor) ? (string)__jsonBackgroundColor : (string)BackgroundColor;} + {_backgroundColor = If( json?.PropertyT("backgroundColor"), out var __jsonBackgroundColor) ? (string)__jsonBackgroundColor : (string)_backgroundColor;} {_backgroundImage = If( json?.PropertyT("backgroundImage"), out var __w) ? System.Convert.FromBase64String( ((string)__w).Replace("_","/").Replace("-","+").PadRight( ((string)__w).Length + ((string)__w).Length * 3 % 4, '=') ) : null;} - {_backgroundImageRelativeUrl = If( json?.PropertyT("backgroundImageRelativeUrl"), out var __jsonBackgroundImageRelativeUrl) ? (string)__jsonBackgroundImageRelativeUrl : (string)BackgroundImageRelativeUrl;} + {_backgroundImageRelativeUrl = If( json?.PropertyT("backgroundImageRelativeUrl"), out var __jsonBackgroundImageRelativeUrl) ? (string)__jsonBackgroundImageRelativeUrl : (string)_backgroundImageRelativeUrl;} {_bannerLogo = If( json?.PropertyT("bannerLogo"), out var __u) ? System.Convert.FromBase64String( ((string)__u).Replace("_","/").Replace("-","+").PadRight( ((string)__u).Length + ((string)__u).Length * 3 % 4, '=') ) : null;} - {_bannerLogoRelativeUrl = If( json?.PropertyT("bannerLogoRelativeUrl"), out var __jsonBannerLogoRelativeUrl) ? (string)__jsonBannerLogoRelativeUrl : (string)BannerLogoRelativeUrl;} - {_cdnList = If( json?.PropertyT("cdnList"), out var __jsonCdnList) ? If( __jsonCdnList as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __r) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__r, (__q)=>(string) (__q is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __p ? (string)(__p.ToString()) : null)) ))() : null : CdnList;} - {_signInPageText = If( json?.PropertyT("signInPageText"), out var __jsonSignInPageText) ? (string)__jsonSignInPageText : (string)SignInPageText;} + {_bannerLogoRelativeUrl = If( json?.PropertyT("bannerLogoRelativeUrl"), out var __jsonBannerLogoRelativeUrl) ? (string)__jsonBannerLogoRelativeUrl : (string)_bannerLogoRelativeUrl;} + {_cdnList = If( json?.PropertyT("cdnList"), out var __jsonCdnList) ? If( __jsonCdnList as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __r) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__r, (__q)=>(string) (__q is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __p ? (string)(__p.ToString()) : null)) ))() : null : _cdnList;} + {_signInPageText = If( json?.PropertyT("signInPageText"), out var __jsonSignInPageText) ? (string)__jsonSignInPageText : (string)_signInPageText;} {_squareLogo = If( json?.PropertyT("squareLogo"), out var __n) ? System.Convert.FromBase64String( ((string)__n).Replace("_","/").Replace("-","+").PadRight( ((string)__n).Length + ((string)__n).Length * 3 % 4, '=') ) : null;} - {_squareLogoRelativeUrl = If( json?.PropertyT("squareLogoRelativeUrl"), out var __jsonSquareLogoRelativeUrl) ? (string)__jsonSquareLogoRelativeUrl : (string)SquareLogoRelativeUrl;} - {_usernameHintText = If( json?.PropertyT("usernameHintText"), out var __jsonUsernameHintText) ? (string)__jsonUsernameHintText : (string)UsernameHintText;} + {_squareLogoRelativeUrl = If( json?.PropertyT("squareLogoRelativeUrl"), out var __jsonSquareLogoRelativeUrl) ? (string)__jsonSquareLogoRelativeUrl : (string)_squareLogoRelativeUrl;} + {_usernameHintText = If( json?.PropertyT("usernameHintText"), out var __jsonUsernameHintText) ? (string)__jsonUsernameHintText : (string)_usernameHintText;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphParentalControlSettings.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphParentalControlSettings.json.cs index 85089894b444..81d8cec0257b 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphParentalControlSettings.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphParentalControlSettings.json.cs @@ -79,8 +79,8 @@ internal MicrosoftGraphParentalControlSettings(Microsoft.Azure.PowerShell.Cmdlet return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_countriesBlockedForMinor = If( json?.PropertyT("countriesBlockedForMinors"), out var __jsonCountriesBlockedForMinors) ? If( __jsonCountriesBlockedForMinors as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : CountriesBlockedForMinor;} - {_legalAgeGroupRule = If( json?.PropertyT("legalAgeGroupRule"), out var __jsonLegalAgeGroupRule) ? (string)__jsonLegalAgeGroupRule : (string)LegalAgeGroupRule;} + {_countriesBlockedForMinor = If( json?.PropertyT("countriesBlockedForMinors"), out var __jsonCountriesBlockedForMinors) ? If( __jsonCountriesBlockedForMinors as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _countriesBlockedForMinor;} + {_legalAgeGroupRule = If( json?.PropertyT("legalAgeGroupRule"), out var __jsonLegalAgeGroupRule) ? (string)__jsonLegalAgeGroupRule : (string)_legalAgeGroupRule;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPasswordCredential.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPasswordCredential.json.cs index e820d2d25722..74abe31e3996 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPasswordCredential.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPasswordCredential.json.cs @@ -80,12 +80,12 @@ internal MicrosoftGraphPasswordCredential(Microsoft.Azure.PowerShell.Cmdlets.Res } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); {_customKeyIdentifier = If( json?.PropertyT("customKeyIdentifier"), out var __w) ? System.Convert.FromBase64String( ((string)__w).Replace("_","/").Replace("-","+").PadRight( ((string)__w).Length + ((string)__w).Length * 3 % 4, '=') ) : null;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : EndDateTime : EndDateTime;} - {_hint = If( json?.PropertyT("hint"), out var __jsonHint) ? (string)__jsonHint : (string)Hint;} - {_keyId = If( json?.PropertyT("keyId"), out var __jsonKeyId) ? (string)__jsonKeyId : (string)KeyId;} - {_secretText = If( json?.PropertyT("secretText"), out var __jsonSecretText) ? (string)__jsonSecretText : (string)SecretText;} - {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : StartDateTime : StartDateTime;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_endDateTime = If( json?.PropertyT("endDateTime"), out var __jsonEndDateTime) ? global::System.DateTime.TryParse((string)__jsonEndDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndDateTimeValue) ? __jsonEndDateTimeValue : _endDateTime : _endDateTime;} + {_hint = If( json?.PropertyT("hint"), out var __jsonHint) ? (string)__jsonHint : (string)_hint;} + {_keyId = If( json?.PropertyT("keyId"), out var __jsonKeyId) ? (string)__jsonKeyId : (string)_keyId;} + {_secretText = If( json?.PropertyT("secretText"), out var __jsonSecretText) ? (string)__jsonSecretText : (string)_secretText;} + {_startDateTime = If( json?.PropertyT("startDateTime"), out var __jsonStartDateTime) ? global::System.DateTime.TryParse((string)__jsonStartDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartDateTimeValue) ? __jsonStartDateTimeValue : _startDateTime : _startDateTime;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPasswordProfile.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPasswordProfile.json.cs index 8d413e8398a3..d410fa45be4f 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPasswordProfile.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPasswordProfile.json.cs @@ -79,9 +79,9 @@ internal MicrosoftGraphPasswordProfile(Microsoft.Azure.PowerShell.Cmdlets.Resour return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_forceChangePasswordNextSignIn = If( json?.PropertyT("forceChangePasswordNextSignIn"), out var __jsonForceChangePasswordNextSignIn) ? (bool?)__jsonForceChangePasswordNextSignIn : ForceChangePasswordNextSignIn;} - {_forceChangePasswordNextSignInWithMfa = If( json?.PropertyT("forceChangePasswordNextSignInWithMfa"), out var __jsonForceChangePasswordNextSignInWithMfa) ? (bool?)__jsonForceChangePasswordNextSignInWithMfa : ForceChangePasswordNextSignInWithMfa;} - {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? (string)__jsonPassword : (string)Password;} + {_forceChangePasswordNextSignIn = If( json?.PropertyT("forceChangePasswordNextSignIn"), out var __jsonForceChangePasswordNextSignIn) ? (bool?)__jsonForceChangePasswordNextSignIn : _forceChangePasswordNextSignIn;} + {_forceChangePasswordNextSignInWithMfa = If( json?.PropertyT("forceChangePasswordNextSignInWithMfa"), out var __jsonForceChangePasswordNextSignInWithMfa) ? (bool?)__jsonForceChangePasswordNextSignInWithMfa : _forceChangePasswordNextSignInWithMfa;} + {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? (string)__jsonPassword : (string)_password;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPermissionScope.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPermissionScope.json.cs index 144395737ca6..314ce70163f1 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPermissionScope.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPermissionScope.json.cs @@ -79,15 +79,15 @@ internal MicrosoftGraphPermissionScope(Microsoft.Azure.PowerShell.Cmdlets.Resour return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_adminConsentDescription = If( json?.PropertyT("adminConsentDescription"), out var __jsonAdminConsentDescription) ? (string)__jsonAdminConsentDescription : (string)AdminConsentDescription;} - {_adminConsentDisplayName = If( json?.PropertyT("adminConsentDisplayName"), out var __jsonAdminConsentDisplayName) ? (string)__jsonAdminConsentDisplayName : (string)AdminConsentDisplayName;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool?)__jsonIsEnabled : IsEnabled;} - {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)Origin;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_userConsentDescription = If( json?.PropertyT("userConsentDescription"), out var __jsonUserConsentDescription) ? (string)__jsonUserConsentDescription : (string)UserConsentDescription;} - {_userConsentDisplayName = If( json?.PropertyT("userConsentDisplayName"), out var __jsonUserConsentDisplayName) ? (string)__jsonUserConsentDisplayName : (string)UserConsentDisplayName;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_adminConsentDescription = If( json?.PropertyT("adminConsentDescription"), out var __jsonAdminConsentDescription) ? (string)__jsonAdminConsentDescription : (string)_adminConsentDescription;} + {_adminConsentDisplayName = If( json?.PropertyT("adminConsentDisplayName"), out var __jsonAdminConsentDisplayName) ? (string)__jsonAdminConsentDisplayName : (string)_adminConsentDisplayName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_isEnabled = If( json?.PropertyT("isEnabled"), out var __jsonIsEnabled) ? (bool?)__jsonIsEnabled : _isEnabled;} + {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)_origin;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_userConsentDescription = If( json?.PropertyT("userConsentDescription"), out var __jsonUserConsentDescription) ? (string)__jsonUserConsentDescription : (string)_userConsentDescription;} + {_userConsentDisplayName = If( json?.PropertyT("userConsentDisplayName"), out var __jsonUserConsentDisplayName) ? (string)__jsonUserConsentDisplayName : (string)_userConsentDisplayName;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)_value;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPhone.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPhone.json.cs index 1b60dc0b0f85..5ae81b3b5463 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPhone.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPhone.json.cs @@ -79,10 +79,10 @@ internal MicrosoftGraphPhone(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGrap return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_language = If( json?.PropertyT("language"), out var __jsonLanguage) ? (string)__jsonLanguage : (string)Language;} - {_number = If( json?.PropertyT("number"), out var __jsonNumber) ? (string)__jsonNumber : (string)Number;} - {_region = If( json?.PropertyT("region"), out var __jsonRegion) ? (string)__jsonRegion : (string)Region;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_language = If( json?.PropertyT("language"), out var __jsonLanguage) ? (string)__jsonLanguage : (string)_language;} + {_number = If( json?.PropertyT("number"), out var __jsonNumber) ? (string)__jsonNumber : (string)_number;} + {_region = If( json?.PropertyT("region"), out var __jsonRegion) ? (string)__jsonRegion : (string)_region;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPhysicalOfficeAddress.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPhysicalOfficeAddress.json.cs index adb84de92be9..b57146317934 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPhysicalOfficeAddress.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPhysicalOfficeAddress.json.cs @@ -79,12 +79,12 @@ internal MicrosoftGraphPhysicalOfficeAddress(Microsoft.Azure.PowerShell.Cmdlets. return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_city = If( json?.PropertyT("city"), out var __jsonCity) ? (string)__jsonCity : (string)City;} - {_countryOrRegion = If( json?.PropertyT("countryOrRegion"), out var __jsonCountryOrRegion) ? (string)__jsonCountryOrRegion : (string)CountryOrRegion;} - {_officeLocation = If( json?.PropertyT("officeLocation"), out var __jsonOfficeLocation) ? (string)__jsonOfficeLocation : (string)OfficeLocation;} - {_postalCode = If( json?.PropertyT("postalCode"), out var __jsonPostalCode) ? (string)__jsonPostalCode : (string)PostalCode;} - {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} - {_street = If( json?.PropertyT("street"), out var __jsonStreet) ? (string)__jsonStreet : (string)Street;} + {_city = If( json?.PropertyT("city"), out var __jsonCity) ? (string)__jsonCity : (string)_city;} + {_countryOrRegion = If( json?.PropertyT("countryOrRegion"), out var __jsonCountryOrRegion) ? (string)__jsonCountryOrRegion : (string)_countryOrRegion;} + {_officeLocation = If( json?.PropertyT("officeLocation"), out var __jsonOfficeLocation) ? (string)__jsonOfficeLocation : (string)_officeLocation;} + {_postalCode = If( json?.PropertyT("postalCode"), out var __jsonPostalCode) ? (string)__jsonPostalCode : (string)_postalCode;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)_state;} + {_street = If( json?.PropertyT("street"), out var __jsonStreet) ? (string)__jsonStreet : (string)_street;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPolicyBase.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPolicyBase.cs index c5888dd894b8..5ccdae9d89e2 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPolicyBase.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPolicyBase.cs @@ -43,9 +43,6 @@ public partial class MicrosoftGraphPolicyBase : /// Internal Acessors for OdataId string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId = value; } - /// Internal Acessors for OdataType - string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = value; } - /// Internal Acessors for Id string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id = value; } @@ -54,8 +51,9 @@ public partial class MicrosoftGraphPolicyBase : public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; } /// The type of object in directory + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; } + public string OdataType { get => "microsoft.graph.policyBase"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = "microsoft.graph.policyBase"; } /// Creates an new instance. public MicrosoftGraphPolicyBase() diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPolicyBase.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPolicyBase.json.cs index ede336460353..3ce0b4463d9d 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPolicyBase.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPolicyBase.json.cs @@ -96,7 +96,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10 return new MicrosoftGraphClaimsMappingPolicy(json); } } - return new MicrosoftGraphPolicyBase(json, new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description" }); + return new MicrosoftGraphPolicyBase(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description" }); } /// @@ -114,7 +114,7 @@ internal MicrosoftGraphPolicyBase(Microsoft.Azure.PowerShell.Cmdlets.Resources.M } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); __microsoftGraphDirectoryObject = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject(json); - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPreAuthorizedApplication.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPreAuthorizedApplication.json.cs index f82cf901e2a2..c3278fb4f21d 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPreAuthorizedApplication.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPreAuthorizedApplication.json.cs @@ -79,8 +79,8 @@ internal MicrosoftGraphPreAuthorizedApplication(Microsoft.Azure.PowerShell.Cmdle return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_appId = If( json?.PropertyT("appId"), out var __jsonAppId) ? (string)__jsonAppId : (string)AppId;} - {_delegatedPermissionId = If( json?.PropertyT("delegatedPermissionIds"), out var __jsonDelegatedPermissionIds) ? If( __jsonDelegatedPermissionIds as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : DelegatedPermissionId;} + {_appId = If( json?.PropertyT("appId"), out var __jsonAppId) ? (string)__jsonAppId : (string)_appId;} + {_delegatedPermissionId = If( json?.PropertyT("delegatedPermissionIds"), out var __jsonDelegatedPermissionIds) ? If( __jsonDelegatedPermissionIds as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _delegatedPermissionId;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPrivacyProfile.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPrivacyProfile.json.cs index ae08104e8ded..267cb4d20dcb 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPrivacyProfile.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPrivacyProfile.json.cs @@ -79,8 +79,8 @@ internal MicrosoftGraphPrivacyProfile(Microsoft.Azure.PowerShell.Cmdlets.Resourc return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_contactEmail = If( json?.PropertyT("contactEmail"), out var __jsonContactEmail) ? (string)__jsonContactEmail : (string)ContactEmail;} - {_statementUrl = If( json?.PropertyT("statementUrl"), out var __jsonStatementUrl) ? (string)__jsonStatementUrl : (string)StatementUrl;} + {_contactEmail = If( json?.PropertyT("contactEmail"), out var __jsonContactEmail) ? (string)__jsonContactEmail : (string)_contactEmail;} + {_statementUrl = If( json?.PropertyT("statementUrl"), out var __jsonStatementUrl) ? (string)__jsonStatementUrl : (string)_statementUrl;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphProvisionedPlan.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphProvisionedPlan.json.cs index fdc512dc055e..5cc244c277d7 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphProvisionedPlan.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphProvisionedPlan.json.cs @@ -79,9 +79,9 @@ internal MicrosoftGraphProvisionedPlan(Microsoft.Azure.PowerShell.Cmdlets.Resour return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_capabilityStatus = If( json?.PropertyT("capabilityStatus"), out var __jsonCapabilityStatus) ? (string)__jsonCapabilityStatus : (string)CapabilityStatus;} - {_provisioningStatus = If( json?.PropertyT("provisioningStatus"), out var __jsonProvisioningStatus) ? (string)__jsonProvisioningStatus : (string)ProvisioningStatus;} - {_service = If( json?.PropertyT("service"), out var __jsonService) ? (string)__jsonService : (string)Service;} + {_capabilityStatus = If( json?.PropertyT("capabilityStatus"), out var __jsonCapabilityStatus) ? (string)__jsonCapabilityStatus : (string)_capabilityStatus;} + {_provisioningStatus = If( json?.PropertyT("provisioningStatus"), out var __jsonProvisioningStatus) ? (string)__jsonProvisioningStatus : (string)_provisioningStatus;} + {_service = If( json?.PropertyT("service"), out var __jsonService) ? (string)__jsonService : (string)_service;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPublicClientApplication.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPublicClientApplication.json.cs index d4fe02110ec7..4157a0cd165e 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPublicClientApplication.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphPublicClientApplication.json.cs @@ -79,7 +79,7 @@ internal MicrosoftGraphPublicClientApplication(Microsoft.Azure.PowerShell.Cmdlet return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_redirectUri = If( json?.PropertyT("redirectUris"), out var __jsonRedirectUris) ? If( __jsonRedirectUris as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : RedirectUri;} + {_redirectUri = If( json?.PropertyT("redirectUris"), out var __jsonRedirectUris) ? If( __jsonRedirectUris as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _redirectUri;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphRequiredResourceAccess.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphRequiredResourceAccess.json.cs index 97dd384dc941..f299fa6680ae 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphRequiredResourceAccess.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphRequiredResourceAccess.json.cs @@ -79,8 +79,8 @@ internal MicrosoftGraphRequiredResourceAccess(Microsoft.Azure.PowerShell.Cmdlets return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_resourceAccess = If( json?.PropertyT("resourceAccess"), out var __jsonResourceAccess) ? If( __jsonResourceAccess as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphResourceAccess) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphResourceAccess.FromJson(__u) )) ))() : null : ResourceAccess;} - {_resourceAppId = If( json?.PropertyT("resourceAppId"), out var __jsonResourceAppId) ? (string)__jsonResourceAppId : (string)ResourceAppId;} + {_resourceAccess = If( json?.PropertyT("resourceAccess"), out var __jsonResourceAccess) ? If( __jsonResourceAccess as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphResourceAccess) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphResourceAccess.FromJson(__u) )) ))() : null : _resourceAccess;} + {_resourceAppId = If( json?.PropertyT("resourceAppId"), out var __jsonResourceAppId) ? (string)__jsonResourceAppId : (string)_resourceAppId;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphResourceAccess.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphResourceAccess.json.cs index 07e7561989b6..ff72c69e3eda 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphResourceAccess.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphResourceAccess.json.cs @@ -79,8 +79,8 @@ internal MicrosoftGraphResourceAccess(Microsoft.Azure.PowerShell.Cmdlets.Resourc return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphResourceSpecificPermissionGrant.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphResourceSpecificPermissionGrant.cs index 6b246a507ae2..e927cb16425e 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphResourceSpecificPermissionGrant.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphResourceSpecificPermissionGrant.cs @@ -52,9 +52,6 @@ public partial class MicrosoftGraphResourceSpecificPermissionGrant : /// Internal Acessors for OdataId string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId = value; } - /// Internal Acessors for OdataType - string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = value; } - /// Internal Acessors for Id string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id = value; } @@ -63,8 +60,9 @@ public partial class MicrosoftGraphResourceSpecificPermissionGrant : public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; } /// The type of object in directory + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; } + public string OdataType { get => "microsoft.graph.resourceSpecificPermissionGrant"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = "microsoft.graph.resourceSpecificPermissionGrant"; } /// Backing field for property. private string _permission; diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphResourceSpecificPermissionGrant.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphResourceSpecificPermissionGrant.json.cs index cbe2df1dcf13..fa18fe5e6711 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphResourceSpecificPermissionGrant.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphResourceSpecificPermissionGrant.json.cs @@ -65,7 +65,7 @@ public partial class MicrosoftGraphResourceSpecificPermissionGrant /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphResourceSpecificPermissionGrant FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphResourceSpecificPermissionGrant(json, new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"clientAppId",@"clientId",@"permission",@"permissionType",@"resourceAppId" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphResourceSpecificPermissionGrant(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"clientAppId",@"clientId",@"permission",@"permissionType",@"resourceAppId" }) : null; } /// @@ -84,11 +84,11 @@ internal MicrosoftGraphResourceSpecificPermissionGrant(Microsoft.Azure.PowerShel } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); __microsoftGraphDirectoryObject = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject(json); - {_clientAppId = If( json?.PropertyT("clientAppId"), out var __jsonClientAppId) ? (string)__jsonClientAppId : (string)ClientAppId;} - {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} - {_permission = If( json?.PropertyT("permission"), out var __jsonPermission) ? (string)__jsonPermission : (string)Permission;} - {_permissionType = If( json?.PropertyT("permissionType"), out var __jsonPermissionType) ? (string)__jsonPermissionType : (string)PermissionType;} - {_resourceAppId = If( json?.PropertyT("resourceAppId"), out var __jsonResourceAppId) ? (string)__jsonResourceAppId : (string)ResourceAppId;} + {_clientAppId = If( json?.PropertyT("clientAppId"), out var __jsonClientAppId) ? (string)__jsonClientAppId : (string)_clientAppId;} + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)_clientId;} + {_permission = If( json?.PropertyT("permission"), out var __jsonPermission) ? (string)__jsonPermission : (string)_permission;} + {_permissionType = If( json?.PropertyT("permissionType"), out var __jsonPermissionType) ? (string)__jsonPermissionType : (string)_permissionType;} + {_resourceAppId = If( json?.PropertyT("resourceAppId"), out var __jsonResourceAppId) ? (string)__jsonResourceAppId : (string)_resourceAppId;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSamlOrWsFedProvider.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSamlOrWsFedProvider.json.cs index 8559c5d46e94..94648cc50694 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSamlOrWsFedProvider.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSamlOrWsFedProvider.json.cs @@ -79,11 +79,11 @@ internal MicrosoftGraphSamlOrWsFedProvider(Microsoft.Azure.PowerShell.Cmdlets.Re return; } __microsoftGraphIdentityProviderBase = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphIdentityProviderBase(json,new global::System.Collections.Generic.HashSet(){ @"id",@"displayName",@"issuerUri",@"metadataExchangeUri",@"passiveSignInUri",@"preferredAuthenticationProtocol",@"signingCertificate" }); - {_issuerUri = If( json?.PropertyT("issuerUri"), out var __jsonIssuerUri) ? (string)__jsonIssuerUri : (string)IssuerUri;} - {_metadataExchangeUri = If( json?.PropertyT("metadataExchangeUri"), out var __jsonMetadataExchangeUri) ? (string)__jsonMetadataExchangeUri : (string)MetadataExchangeUri;} - {_passiveSignInUri = If( json?.PropertyT("passiveSignInUri"), out var __jsonPassiveSignInUri) ? (string)__jsonPassiveSignInUri : (string)PassiveSignInUri;} - {_preferredAuthenticationProtocol = If( json?.PropertyT("preferredAuthenticationProtocol"), out var __jsonPreferredAuthenticationProtocol) ? (string)__jsonPreferredAuthenticationProtocol : (string)PreferredAuthenticationProtocol;} - {_signingCertificate = If( json?.PropertyT("signingCertificate"), out var __jsonSigningCertificate) ? (string)__jsonSigningCertificate : (string)SigningCertificate;} + {_issuerUri = If( json?.PropertyT("issuerUri"), out var __jsonIssuerUri) ? (string)__jsonIssuerUri : (string)_issuerUri;} + {_metadataExchangeUri = If( json?.PropertyT("metadataExchangeUri"), out var __jsonMetadataExchangeUri) ? (string)__jsonMetadataExchangeUri : (string)_metadataExchangeUri;} + {_passiveSignInUri = If( json?.PropertyT("passiveSignInUri"), out var __jsonPassiveSignInUri) ? (string)__jsonPassiveSignInUri : (string)_passiveSignInUri;} + {_preferredAuthenticationProtocol = If( json?.PropertyT("preferredAuthenticationProtocol"), out var __jsonPreferredAuthenticationProtocol) ? (string)__jsonPreferredAuthenticationProtocol : (string)_preferredAuthenticationProtocol;} + {_signingCertificate = If( json?.PropertyT("signingCertificate"), out var __jsonSigningCertificate) ? (string)__jsonSigningCertificate : (string)_signingCertificate;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSamlSingleSignOnSettings.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSamlSingleSignOnSettings.json.cs index 448eade6a6d1..f288866cf3b0 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSamlSingleSignOnSettings.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSamlSingleSignOnSettings.json.cs @@ -79,7 +79,7 @@ internal MicrosoftGraphSamlSingleSignOnSettings(Microsoft.Azure.PowerShell.Cmdle return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_relayState = If( json?.PropertyT("relayState"), out var __jsonRelayState) ? (string)__jsonRelayState : (string)RelayState;} + {_relayState = If( json?.PropertyT("relayState"), out var __jsonRelayState) ? (string)__jsonRelayState : (string)_relayState;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphScopedRoleMembership.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphScopedRoleMembership.json.cs index d95cca1592e2..71ee316ef88b 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphScopedRoleMembership.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphScopedRoleMembership.json.cs @@ -79,9 +79,9 @@ internal MicrosoftGraphScopedRoleMembership(Microsoft.Azure.PowerShell.Cmdlets.R return; } __microsoftGraphEntity = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEntity(json,new global::System.Collections.Generic.HashSet(){ @"id",@"administrativeUnitId",@"roleId",@"roleMemberInfo" }); - {_administrativeUnitId = If( json?.PropertyT("administrativeUnitId"), out var __jsonAdministrativeUnitId) ? (string)__jsonAdministrativeUnitId : (string)AdministrativeUnitId;} - {_roleId = If( json?.PropertyT("roleId"), out var __jsonRoleId) ? (string)__jsonRoleId : (string)RoleId;} - {_roleMemberInfo = If( json?.PropertyT("roleMemberInfo"), out var __jsonRoleMemberInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphIdentity.FromJson(__jsonRoleMemberInfo) : RoleMemberInfo;} + {_administrativeUnitId = If( json?.PropertyT("administrativeUnitId"), out var __jsonAdministrativeUnitId) ? (string)__jsonAdministrativeUnitId : (string)_administrativeUnitId;} + {_roleId = If( json?.PropertyT("roleId"), out var __jsonRoleId) ? (string)__jsonRoleId : (string)_roleId;} + {_roleMemberInfo = If( json?.PropertyT("roleMemberInfo"), out var __jsonRoleMemberInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphIdentity.FromJson(__jsonRoleMemberInfo) : _roleMemberInfo;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphScopedRoleMembershipCollectionResponse.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphScopedRoleMembershipCollectionResponse.json.cs index 9e3c88c16e03..974c0899e19c 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphScopedRoleMembershipCollectionResponse.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphScopedRoleMembershipCollectionResponse.json.cs @@ -80,8 +80,8 @@ internal MicrosoftGraphScopedRoleMembershipCollectionResponse(Microsoft.Azure.Po return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphScopedRoleMembership) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphScopedRoleMembership.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphScopedRoleMembership) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphScopedRoleMembership.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphServicePlanInfo.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphServicePlanInfo.json.cs index 4974514dfb99..58b3ff9227a3 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphServicePlanInfo.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphServicePlanInfo.json.cs @@ -79,10 +79,10 @@ internal MicrosoftGraphServicePlanInfo(Microsoft.Azure.PowerShell.Cmdlets.Resour return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_appliesTo = If( json?.PropertyT("appliesTo"), out var __jsonAppliesTo) ? (string)__jsonAppliesTo : (string)AppliesTo;} - {_provisioningStatus = If( json?.PropertyT("provisioningStatus"), out var __jsonProvisioningStatus) ? (string)__jsonProvisioningStatus : (string)ProvisioningStatus;} - {_servicePlanId = If( json?.PropertyT("servicePlanId"), out var __jsonServicePlanId) ? (string)__jsonServicePlanId : (string)ServicePlanId;} - {_servicePlanName = If( json?.PropertyT("servicePlanName"), out var __jsonServicePlanName) ? (string)__jsonServicePlanName : (string)ServicePlanName;} + {_appliesTo = If( json?.PropertyT("appliesTo"), out var __jsonAppliesTo) ? (string)__jsonAppliesTo : (string)_appliesTo;} + {_provisioningStatus = If( json?.PropertyT("provisioningStatus"), out var __jsonProvisioningStatus) ? (string)__jsonProvisioningStatus : (string)_provisioningStatus;} + {_servicePlanId = If( json?.PropertyT("servicePlanId"), out var __jsonServicePlanId) ? (string)__jsonServicePlanId : (string)_servicePlanId;} + {_servicePlanName = If( json?.PropertyT("servicePlanName"), out var __jsonServicePlanName) ? (string)__jsonServicePlanName : (string)_servicePlanName;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphServicePrincipal.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphServicePrincipal.cs index 3f6fe01f9f79..3b44939b9d05 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphServicePrincipal.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphServicePrincipal.cs @@ -300,9 +300,6 @@ public partial class MicrosoftGraphServicePrincipal : /// Internal Acessors for OdataId string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId = value; } - /// Internal Acessors for OdataType - string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = value; } - /// Internal Acessors for Id string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id = value; } @@ -377,9 +374,10 @@ public partial class MicrosoftGraphServicePrincipal : public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; } /// The type of object in directory + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] - public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; } + public string OdataType { get => "#microsoft.graph.serviceprincipal"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = "#microsoft.graph.serviceprincipal"; } /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject[] _ownedObject; @@ -445,6 +443,11 @@ public partial class MicrosoftGraphServicePrincipal : [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] public string[] ReplyUrl { get => this._replyUrl; set => this._replyUrl = value; } + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphSamlSingleSignOnSettings _samlSingleSignOnSetting; diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphServicePrincipal.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphServicePrincipal.json.cs index 9d7ae40eb73f..a08cdf48ea56 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphServicePrincipal.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphServicePrincipal.json.cs @@ -65,7 +65,7 @@ public partial class MicrosoftGraphServicePrincipal /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphServicePrincipal(json, new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"accountEnabled",@"addIns",@"alternativeNames",@"appDescription",@"appDisplayName",@"appId",@"applicationTemplateId",@"appOwnerOrganizationId",@"appRoleAssignmentRequired",@"appRoles",@"description",@"disabledByMicrosoftStatus",@"homepage",@"info",@"keyCredentials",@"loginUrl",@"logoutUrl",@"notes",@"notificationEmailAddresses",@"oauth2PermissionScopes",@"passwordCredentials",@"preferredSingleSignOnMode",@"preferredTokenSigningKeyThumbprint",@"replyUrls",@"samlSingleSignOnSettings",@"servicePrincipalNames",@"servicePrincipalType",@"signInAudience",@"tags",@"tokenEncryptionKeyId",@"appRoleAssignedTo",@"appRoleAssignments",@"claimsMappingPolicies",@"createdObjects",@"delegatedPermissionClassifications",@"endpoints",@"federatedIdentityCredentials",@"homeRealmDiscoveryPolicies",@"memberOf",@"oauth2PermissionGrants",@"ownedObjects",@"owners",@"tokenIssuancePolicies",@"tokenLifetimePolicies",@"transitiveMemberOf" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphServicePrincipal(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"accountEnabled",@"addIns",@"alternativeNames",@"appDescription",@"appDisplayName",@"appId",@"applicationTemplateId",@"appOwnerOrganizationId",@"appRoleAssignmentRequired",@"appRoles",@"description",@"disabledByMicrosoftStatus",@"homepage",@"info",@"keyCredentials",@"loginUrl",@"logoutUrl",@"notes",@"notificationEmailAddresses",@"oauth2PermissionScopes",@"passwordCredentials",@"preferredSingleSignOnMode",@"preferredTokenSigningKeyThumbprint",@"replyUrls",@"samlSingleSignOnSettings",@"servicePrincipalNames",@"servicePrincipalType",@"signInAudience",@"tags",@"tokenEncryptionKeyId",@"appRoleAssignedTo",@"appRoleAssignments",@"claimsMappingPolicies",@"createdObjects",@"delegatedPermissionClassifications",@"endpoints",@"federatedIdentityCredentials",@"homeRealmDiscoveryPolicies",@"memberOf",@"oauth2PermissionGrants",@"ownedObjects",@"owners",@"tokenIssuancePolicies",@"tokenLifetimePolicies",@"transitiveMemberOf" }) : null; } /// @@ -83,51 +83,51 @@ internal MicrosoftGraphServicePrincipal(Microsoft.Azure.PowerShell.Cmdlets.Resou } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); __microsoftGraphDirectoryObject = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject(json); - {_accountEnabled = If( json?.PropertyT("accountEnabled"), out var __jsonAccountEnabled) ? (bool?)__jsonAccountEnabled : AccountEnabled;} - {_addIn = If( json?.PropertyT("addIns"), out var __jsonAddIns) ? If( __jsonAddIns as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAddIn.FromJson(__u) )) ))() : null : AddIn;} - {_alternativeName = If( json?.PropertyT("alternativeNames"), out var __jsonAlternativeNames) ? If( __jsonAlternativeNames as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : AlternativeName;} - {_appDescription = If( json?.PropertyT("appDescription"), out var __jsonAppDescription) ? (string)__jsonAppDescription : (string)AppDescription;} - {_appDisplayName = If( json?.PropertyT("appDisplayName"), out var __jsonAppDisplayName) ? (string)__jsonAppDisplayName : (string)AppDisplayName;} - {_appId = If( json?.PropertyT("appId"), out var __jsonAppId) ? (string)__jsonAppId : (string)AppId;} - {_applicationTemplateId = If( json?.PropertyT("applicationTemplateId"), out var __jsonApplicationTemplateId) ? (string)__jsonApplicationTemplateId : (string)ApplicationTemplateId;} - {_appOwnerOrganizationId = If( json?.PropertyT("appOwnerOrganizationId"), out var __jsonAppOwnerOrganizationId) ? (string)__jsonAppOwnerOrganizationId : (string)AppOwnerOrganizationId;} - {_appRoleAssignmentRequired = If( json?.PropertyT("appRoleAssignmentRequired"), out var __jsonAppRoleAssignmentRequired) ? (bool?)__jsonAppRoleAssignmentRequired : AppRoleAssignmentRequired;} - {_appRole = If( json?.PropertyT("appRoles"), out var __jsonAppRoles) ? If( __jsonAppRoles as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRole.FromJson(__k) )) ))() : null : AppRole;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_disabledByMicrosoftStatus = If( json?.PropertyT("disabledByMicrosoftStatus"), out var __jsonDisabledByMicrosoftStatus) ? (string)__jsonDisabledByMicrosoftStatus : (string)DisabledByMicrosoftStatus;} - {_homepage = If( json?.PropertyT("homepage"), out var __jsonHomepage) ? (string)__jsonHomepage : (string)Homepage;} - {_keyCredentials = If( json?.PropertyT("keyCredentials"), out var __jsonKeyCredentials) ? If( __jsonKeyCredentials as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential.FromJson(__f) )) ))() : null : KeyCredentials;} - {_loginUrl = If( json?.PropertyT("loginUrl"), out var __jsonLoginUrl) ? (string)__jsonLoginUrl : (string)LoginUrl;} - {_logoutUrl = If( json?.PropertyT("logoutUrl"), out var __jsonLogoutUrl) ? (string)__jsonLogoutUrl : (string)LogoutUrl;} - {_note = If( json?.PropertyT("notes"), out var __jsonNotes) ? (string)__jsonNotes : (string)Note;} - {_notificationEmailAddress = If( json?.PropertyT("notificationEmailAddresses"), out var __jsonNotificationEmailAddresses) ? If( __jsonNotificationEmailAddresses as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(string) (__a is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString ___z ? (string)(___z.ToString()) : null)) ))() : null : NotificationEmailAddress;} - {_oauth2PermissionScope = If( json?.PropertyT("oauth2PermissionScopes"), out var __jsonOauth2PermissionScopes) ? If( __jsonOauth2PermissionScopes as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___w) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___w, (___v)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPermissionScope) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPermissionScope.FromJson(___v) )) ))() : null : Oauth2PermissionScope;} - {_passwordCredentials = If( json?.PropertyT("passwordCredentials"), out var __jsonPasswordCredentials) ? If( __jsonPasswordCredentials as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___r) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___r, (___q)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential.FromJson(___q) )) ))() : null : PasswordCredentials;} - {_preferredSingleSignOnMode = If( json?.PropertyT("preferredSingleSignOnMode"), out var __jsonPreferredSingleSignOnMode) ? (string)__jsonPreferredSingleSignOnMode : (string)PreferredSingleSignOnMode;} - {_preferredTokenSigningKeyThumbprint = If( json?.PropertyT("preferredTokenSigningKeyThumbprint"), out var __jsonPreferredTokenSigningKeyThumbprint) ? (string)__jsonPreferredTokenSigningKeyThumbprint : (string)PreferredTokenSigningKeyThumbprint;} - {_replyUrl = If( json?.PropertyT("replyUrls"), out var __jsonReplyUrls) ? If( __jsonReplyUrls as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___m) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___m, (___l)=>(string) (___l is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString ___k ? (string)(___k.ToString()) : null)) ))() : null : ReplyUrl;} - {_servicePrincipalName = If( json?.PropertyT("servicePrincipalNames"), out var __jsonServicePrincipalNames) ? If( __jsonServicePrincipalNames as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___h) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___h, (___g)=>(string) (___g is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString ___f ? (string)(___f.ToString()) : null)) ))() : null : ServicePrincipalName;} - {_servicePrincipalType = If( json?.PropertyT("servicePrincipalType"), out var __jsonServicePrincipalType) ? (string)__jsonServicePrincipalType : (string)ServicePrincipalType;} - {_signInAudience = If( json?.PropertyT("signInAudience"), out var __jsonSignInAudience) ? (string)__jsonSignInAudience : (string)SignInAudience;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? If( __jsonTags as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___c) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___c, (___b)=>(string) (___b is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString ___a ? (string)(___a.ToString()) : null)) ))() : null : Tag;} - {_tokenEncryptionKeyId = If( json?.PropertyT("tokenEncryptionKeyId"), out var __jsonTokenEncryptionKeyId) ? (string)__jsonTokenEncryptionKeyId : (string)TokenEncryptionKeyId;} - {_appRoleAssignedTo = If( json?.PropertyT("appRoleAssignedTo"), out var __jsonAppRoleAssignedTo) ? If( __jsonAppRoleAssignedTo as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ____x) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(____x, (____w)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignment.FromJson(____w) )) ))() : null : AppRoleAssignedTo;} - {_appRoleAssignment = If( json?.PropertyT("appRoleAssignments"), out var __jsonAppRoleAssignments) ? If( __jsonAppRoleAssignments as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ____s) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(____s, (____r)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignment.FromJson(____r) )) ))() : null : AppRoleAssignment;} - {_claimsMappingPolicy = If( json?.PropertyT("claimsMappingPolicies"), out var __jsonClaimsMappingPolicies) ? If( __jsonClaimsMappingPolicies as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ____n) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(____n, (____m)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphClaimsMappingPolicy) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphClaimsMappingPolicy.FromJson(____m) )) ))() : null : ClaimsMappingPolicy;} - {_createdObject = If( json?.PropertyT("createdObjects"), out var __jsonCreatedObjects) ? If( __jsonCreatedObjects as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ____i) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(____i, (____h)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(____h) )) ))() : null : CreatedObject;} - {_delegatedPermissionClassification = If( json?.PropertyT("delegatedPermissionClassifications"), out var __jsonDelegatedPermissionClassifications) ? If( __jsonDelegatedPermissionClassifications as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ____d) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(____d, (____c)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDelegatedPermissionClassification) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDelegatedPermissionClassification.FromJson(____c) )) ))() : null : DelegatedPermissionClassification;} - {_endpoint = If( json?.PropertyT("endpoints"), out var __jsonEndpoints) ? If( __jsonEndpoints as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var _____y) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(_____y, (_____x)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEndpoint) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEndpoint.FromJson(_____x) )) ))() : null : Endpoint;} - {_federatedIdentityCredentials = If( json?.PropertyT("federatedIdentityCredentials"), out var __jsonFederatedIdentityCredentials) ? If( __jsonFederatedIdentityCredentials as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var _____t) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(_____t, (_____s)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredential.FromJson(_____s) )) ))() : null : FederatedIdentityCredentials;} - {_homeRealmDiscoveryPolicy = If( json?.PropertyT("homeRealmDiscoveryPolicies"), out var __jsonHomeRealmDiscoveryPolicies) ? If( __jsonHomeRealmDiscoveryPolicies as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var _____o) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(_____o, (_____n)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphHomeRealmDiscoveryPolicy.FromJson(_____n) )) ))() : null : HomeRealmDiscoveryPolicy;} - {_memberOf = If( json?.PropertyT("memberOf"), out var __jsonMemberOf) ? If( __jsonMemberOf as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var _____j) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(_____j, (_____i)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(_____i) )) ))() : null : MemberOf;} - {_oauth2PermissionGrant = If( json?.PropertyT("oauth2PermissionGrants"), out var __jsonOauth2PermissionGrants) ? If( __jsonOauth2PermissionGrants as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var _____e) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(_____e, (_____d)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOAuth2PermissionGrant) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOAuth2PermissionGrant.FromJson(_____d) )) ))() : null : Oauth2PermissionGrant;} - {_ownedObject = If( json?.PropertyT("ownedObjects"), out var __jsonOwnedObjects) ? If( __jsonOwnedObjects as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ______z) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(______z, (______y)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(______y) )) ))() : null : OwnedObject;} - {_owner = If( json?.PropertyT("owners"), out var __jsonOwners) ? If( __jsonOwners as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ______u) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(______u, (______t)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(______t) )) ))() : null : Owner;} - {_tokenIssuancePolicy = If( json?.PropertyT("tokenIssuancePolicies"), out var __jsonTokenIssuancePolicies) ? If( __jsonTokenIssuancePolicies as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ______p) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(______p, (______o)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphTokenIssuancePolicy.FromJson(______o) )) ))() : null : TokenIssuancePolicy;} - {_tokenLifetimePolicy = If( json?.PropertyT("tokenLifetimePolicies"), out var __jsonTokenLifetimePolicies) ? If( __jsonTokenLifetimePolicies as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ______k) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(______k, (______j)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphTokenLifetimePolicy.FromJson(______j) )) ))() : null : TokenLifetimePolicy;} - {_transitiveMemberOf = If( json?.PropertyT("transitiveMemberOf"), out var __jsonTransitiveMemberOf) ? If( __jsonTransitiveMemberOf as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ______f) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(______f, (______e)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(______e) )) ))() : null : TransitiveMemberOf;} - {_info = If( json?.PropertyT("info"), out var __jsonInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphInformationalUrl.FromJson(__jsonInfo) : Info;} - {_samlSingleSignOnSetting = If( json?.PropertyT("samlSingleSignOnSettings"), out var __jsonSamlSingleSignOnSettings) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSamlSingleSignOnSettings.FromJson(__jsonSamlSingleSignOnSettings) : SamlSingleSignOnSetting;} + {_accountEnabled = If( json?.PropertyT("accountEnabled"), out var __jsonAccountEnabled) ? (bool?)__jsonAccountEnabled : _accountEnabled;} + {_addIn = If( json?.PropertyT("addIns"), out var __jsonAddIns) ? If( __jsonAddIns as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAddIn.FromJson(__u) )) ))() : null : _addIn;} + {_alternativeName = If( json?.PropertyT("alternativeNames"), out var __jsonAlternativeNames) ? If( __jsonAlternativeNames as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _alternativeName;} + {_appDescription = If( json?.PropertyT("appDescription"), out var __jsonAppDescription) ? (string)__jsonAppDescription : (string)_appDescription;} + {_appDisplayName = If( json?.PropertyT("appDisplayName"), out var __jsonAppDisplayName) ? (string)__jsonAppDisplayName : (string)_appDisplayName;} + {_appId = If( json?.PropertyT("appId"), out var __jsonAppId) ? (string)__jsonAppId : (string)_appId;} + {_applicationTemplateId = If( json?.PropertyT("applicationTemplateId"), out var __jsonApplicationTemplateId) ? (string)__jsonApplicationTemplateId : (string)_applicationTemplateId;} + {_appOwnerOrganizationId = If( json?.PropertyT("appOwnerOrganizationId"), out var __jsonAppOwnerOrganizationId) ? (string)__jsonAppOwnerOrganizationId : (string)_appOwnerOrganizationId;} + {_appRoleAssignmentRequired = If( json?.PropertyT("appRoleAssignmentRequired"), out var __jsonAppRoleAssignmentRequired) ? (bool?)__jsonAppRoleAssignmentRequired : _appRoleAssignmentRequired;} + {_appRole = If( json?.PropertyT("appRoles"), out var __jsonAppRoles) ? If( __jsonAppRoles as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRole.FromJson(__k) )) ))() : null : _appRole;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_disabledByMicrosoftStatus = If( json?.PropertyT("disabledByMicrosoftStatus"), out var __jsonDisabledByMicrosoftStatus) ? (string)__jsonDisabledByMicrosoftStatus : (string)_disabledByMicrosoftStatus;} + {_homepage = If( json?.PropertyT("homepage"), out var __jsonHomepage) ? (string)__jsonHomepage : (string)_homepage;} + {_keyCredentials = If( json?.PropertyT("keyCredentials"), out var __jsonKeyCredentials) ? If( __jsonKeyCredentials as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential.FromJson(__f) )) ))() : null : _keyCredentials;} + {_loginUrl = If( json?.PropertyT("loginUrl"), out var __jsonLoginUrl) ? (string)__jsonLoginUrl : (string)_loginUrl;} + {_logoutUrl = If( json?.PropertyT("logoutUrl"), out var __jsonLogoutUrl) ? (string)__jsonLogoutUrl : (string)_logoutUrl;} + {_note = If( json?.PropertyT("notes"), out var __jsonNotes) ? (string)__jsonNotes : (string)_note;} + {_notificationEmailAddress = If( json?.PropertyT("notificationEmailAddresses"), out var __jsonNotificationEmailAddresses) ? If( __jsonNotificationEmailAddresses as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(string) (__a is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString ___z ? (string)(___z.ToString()) : null)) ))() : null : _notificationEmailAddress;} + {_oauth2PermissionScope = If( json?.PropertyT("oauth2PermissionScopes"), out var __jsonOauth2PermissionScopes) ? If( __jsonOauth2PermissionScopes as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___w) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___w, (___v)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPermissionScope) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPermissionScope.FromJson(___v) )) ))() : null : _oauth2PermissionScope;} + {_passwordCredentials = If( json?.PropertyT("passwordCredentials"), out var __jsonPasswordCredentials) ? If( __jsonPasswordCredentials as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___r) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___r, (___q)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential.FromJson(___q) )) ))() : null : _passwordCredentials;} + {_preferredSingleSignOnMode = If( json?.PropertyT("preferredSingleSignOnMode"), out var __jsonPreferredSingleSignOnMode) ? (string)__jsonPreferredSingleSignOnMode : (string)_preferredSingleSignOnMode;} + {_preferredTokenSigningKeyThumbprint = If( json?.PropertyT("preferredTokenSigningKeyThumbprint"), out var __jsonPreferredTokenSigningKeyThumbprint) ? (string)__jsonPreferredTokenSigningKeyThumbprint : (string)_preferredTokenSigningKeyThumbprint;} + {_replyUrl = If( json?.PropertyT("replyUrls"), out var __jsonReplyUrls) ? If( __jsonReplyUrls as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___m) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___m, (___l)=>(string) (___l is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString ___k ? (string)(___k.ToString()) : null)) ))() : null : _replyUrl;} + {_servicePrincipalName = If( json?.PropertyT("servicePrincipalNames"), out var __jsonServicePrincipalNames) ? If( __jsonServicePrincipalNames as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___h) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___h, (___g)=>(string) (___g is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString ___f ? (string)(___f.ToString()) : null)) ))() : null : _servicePrincipalName;} + {_servicePrincipalType = If( json?.PropertyT("servicePrincipalType"), out var __jsonServicePrincipalType) ? (string)__jsonServicePrincipalType : (string)_servicePrincipalType;} + {_signInAudience = If( json?.PropertyT("signInAudience"), out var __jsonSignInAudience) ? (string)__jsonSignInAudience : (string)_signInAudience;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? If( __jsonTags as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___c) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___c, (___b)=>(string) (___b is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString ___a ? (string)(___a.ToString()) : null)) ))() : null : _tag;} + {_tokenEncryptionKeyId = If( json?.PropertyT("tokenEncryptionKeyId"), out var __jsonTokenEncryptionKeyId) ? (string)__jsonTokenEncryptionKeyId : (string)_tokenEncryptionKeyId;} + {_appRoleAssignedTo = If( json?.PropertyT("appRoleAssignedTo"), out var __jsonAppRoleAssignedTo) ? If( __jsonAppRoleAssignedTo as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ____x) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(____x, (____w)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignment.FromJson(____w) )) ))() : null : _appRoleAssignedTo;} + {_appRoleAssignment = If( json?.PropertyT("appRoleAssignments"), out var __jsonAppRoleAssignments) ? If( __jsonAppRoleAssignments as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ____s) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(____s, (____r)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphAppRoleAssignment.FromJson(____r) )) ))() : null : _appRoleAssignment;} + {_claimsMappingPolicy = If( json?.PropertyT("claimsMappingPolicies"), out var __jsonClaimsMappingPolicies) ? If( __jsonClaimsMappingPolicies as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ____n) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(____n, (____m)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphClaimsMappingPolicy) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphClaimsMappingPolicy.FromJson(____m) )) ))() : null : _claimsMappingPolicy;} + {_createdObject = If( json?.PropertyT("createdObjects"), out var __jsonCreatedObjects) ? If( __jsonCreatedObjects as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ____i) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(____i, (____h)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(____h) )) ))() : null : _createdObject;} + {_delegatedPermissionClassification = If( json?.PropertyT("delegatedPermissionClassifications"), out var __jsonDelegatedPermissionClassifications) ? If( __jsonDelegatedPermissionClassifications as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ____d) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(____d, (____c)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDelegatedPermissionClassification) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDelegatedPermissionClassification.FromJson(____c) )) ))() : null : _delegatedPermissionClassification;} + {_endpoint = If( json?.PropertyT("endpoints"), out var __jsonEndpoints) ? If( __jsonEndpoints as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var _____y) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(_____y, (_____x)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEndpoint) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEndpoint.FromJson(_____x) )) ))() : null : _endpoint;} + {_federatedIdentityCredentials = If( json?.PropertyT("federatedIdentityCredentials"), out var __jsonFederatedIdentityCredentials) ? If( __jsonFederatedIdentityCredentials as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var _____t) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(_____t, (_____s)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphFederatedIdentityCredential.FromJson(_____s) )) ))() : null : _federatedIdentityCredentials;} + {_homeRealmDiscoveryPolicy = If( json?.PropertyT("homeRealmDiscoveryPolicies"), out var __jsonHomeRealmDiscoveryPolicies) ? If( __jsonHomeRealmDiscoveryPolicies as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var _____o) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(_____o, (_____n)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphHomeRealmDiscoveryPolicy.FromJson(_____n) )) ))() : null : _homeRealmDiscoveryPolicy;} + {_memberOf = If( json?.PropertyT("memberOf"), out var __jsonMemberOf) ? If( __jsonMemberOf as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var _____j) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(_____j, (_____i)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(_____i) )) ))() : null : _memberOf;} + {_oauth2PermissionGrant = If( json?.PropertyT("oauth2PermissionGrants"), out var __jsonOauth2PermissionGrants) ? If( __jsonOauth2PermissionGrants as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var _____e) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(_____e, (_____d)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOAuth2PermissionGrant) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphOAuth2PermissionGrant.FromJson(_____d) )) ))() : null : _oauth2PermissionGrant;} + {_ownedObject = If( json?.PropertyT("ownedObjects"), out var __jsonOwnedObjects) ? If( __jsonOwnedObjects as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ______z) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(______z, (______y)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(______y) )) ))() : null : _ownedObject;} + {_owner = If( json?.PropertyT("owners"), out var __jsonOwners) ? If( __jsonOwners as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ______u) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(______u, (______t)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(______t) )) ))() : null : _owner;} + {_tokenIssuancePolicy = If( json?.PropertyT("tokenIssuancePolicies"), out var __jsonTokenIssuancePolicies) ? If( __jsonTokenIssuancePolicies as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ______p) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(______p, (______o)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphTokenIssuancePolicy.FromJson(______o) )) ))() : null : _tokenIssuancePolicy;} + {_tokenLifetimePolicy = If( json?.PropertyT("tokenLifetimePolicies"), out var __jsonTokenLifetimePolicies) ? If( __jsonTokenLifetimePolicies as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ______k) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(______k, (______j)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphTokenLifetimePolicy.FromJson(______j) )) ))() : null : _tokenLifetimePolicy;} + {_transitiveMemberOf = If( json?.PropertyT("transitiveMemberOf"), out var __jsonTransitiveMemberOf) ? If( __jsonTransitiveMemberOf as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ______f) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(______f, (______e)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(______e) )) ))() : null : _transitiveMemberOf;} + {_info = If( json?.PropertyT("info"), out var __jsonInfo) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphInformationalUrl.FromJson(__jsonInfo) : _info;} + {_samlSingleSignOnSetting = If( json?.PropertyT("samlSingleSignOnSettings"), out var __jsonSamlSingleSignOnSettings) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSamlSingleSignOnSettings.FromJson(__jsonSamlSingleSignOnSettings) : _samlSingleSignOnSetting;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSigningCertificateUpdateStatus.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSigningCertificateUpdateStatus.json.cs index e8e9fc56ea15..484cc0899c7e 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSigningCertificateUpdateStatus.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSigningCertificateUpdateStatus.json.cs @@ -80,8 +80,8 @@ internal MicrosoftGraphSigningCertificateUpdateStatus(Microsoft.Azure.PowerShell return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_certificateUpdateResult = If( json?.PropertyT("certificateUpdateResult"), out var __jsonCertificateUpdateResult) ? (string)__jsonCertificateUpdateResult : (string)CertificateUpdateResult;} - {_lastRunDateTime = If( json?.PropertyT("lastRunDateTime"), out var __jsonLastRunDateTime) ? global::System.DateTime.TryParse((string)__jsonLastRunDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastRunDateTimeValue) ? __jsonLastRunDateTimeValue : LastRunDateTime : LastRunDateTime;} + {_certificateUpdateResult = If( json?.PropertyT("certificateUpdateResult"), out var __jsonCertificateUpdateResult) ? (string)__jsonCertificateUpdateResult : (string)_certificateUpdateResult;} + {_lastRunDateTime = If( json?.PropertyT("lastRunDateTime"), out var __jsonLastRunDateTime) ? global::System.DateTime.TryParse((string)__jsonLastRunDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastRunDateTimeValue) ? __jsonLastRunDateTimeValue : _lastRunDateTime : _lastRunDateTime;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSpaApplication.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSpaApplication.json.cs index bb8668bce5b6..cab29721004d 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSpaApplication.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSpaApplication.json.cs @@ -79,7 +79,7 @@ internal MicrosoftGraphSpaApplication(Microsoft.Azure.PowerShell.Cmdlets.Resourc return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_redirectUri = If( json?.PropertyT("redirectUris"), out var __jsonRedirectUris) ? If( __jsonRedirectUris as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : RedirectUri;} + {_redirectUri = If( json?.PropertyT("redirectUris"), out var __jsonRedirectUris) ? If( __jsonRedirectUris as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _redirectUri;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphStsPolicy.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphStsPolicy.cs index 84087630164e..bcfc22598073 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphStsPolicy.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphStsPolicy.cs @@ -66,9 +66,6 @@ public partial class MicrosoftGraphStsPolicy : /// Internal Acessors for OdataId string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphPolicyBase).OdataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphPolicyBase).OdataId = value; } - /// Internal Acessors for OdataType - string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphPolicyBase).OdataType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphPolicyBase).OdataType = value; } - /// Internal Acessors for Id string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphPolicyBase).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphPolicyBase).Id = value; } @@ -77,8 +74,9 @@ public partial class MicrosoftGraphStsPolicy : public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphPolicyBase).OdataId; } /// The type of object in directory + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphPolicyBase).OdataType; } + public string OdataType { get => "microsoft.graph.stsPolicy"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphPolicyBase).OdataType = "microsoft.graph.stsPolicy"; } /// Creates an new instance. public MicrosoftGraphStsPolicy() diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphStsPolicy.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphStsPolicy.json.cs index 87be73d25216..3978596ebb6b 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphStsPolicy.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphStsPolicy.json.cs @@ -92,7 +92,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10 return new MicrosoftGraphClaimsMappingPolicy(json); } } - return new MicrosoftGraphStsPolicy(json, new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"definition",@"isOrganizationDefault",@"appliesTo" }); + return new MicrosoftGraphStsPolicy(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"definition",@"isOrganizationDefault",@"appliesTo" }); } /// @@ -108,10 +108,10 @@ internal MicrosoftGraphStsPolicy(Microsoft.Azure.PowerShell.Cmdlets.Resources.MS { return; } - __microsoftGraphPolicyBase = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPolicyBase(json,new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"definition",@"isOrganizationDefault",@"appliesTo" }); - {_definition = If( json?.PropertyT("definition"), out var __jsonDefinition) ? If( __jsonDefinition as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Definition;} - {_isOrganizationDefault = If( json?.PropertyT("isOrganizationDefault"), out var __jsonIsOrganizationDefault) ? (bool?)__jsonIsOrganizationDefault : IsOrganizationDefault;} - {_appliesTo = If( json?.PropertyT("appliesTo"), out var __jsonAppliesTo) ? If( __jsonAppliesTo as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__p) )) ))() : null : AppliesTo;} + __microsoftGraphPolicyBase = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPolicyBase(json,new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"definition",@"isOrganizationDefault",@"appliesTo" }); + {_definition = If( json?.PropertyT("definition"), out var __jsonDefinition) ? If( __jsonDefinition as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _definition;} + {_isOrganizationDefault = If( json?.PropertyT("isOrganizationDefault"), out var __jsonIsOrganizationDefault) ? (bool?)__jsonIsOrganizationDefault : _isOrganizationDefault;} + {_appliesTo = If( json?.PropertyT("appliesTo"), out var __jsonAppliesTo) ? If( __jsonAppliesTo as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__p) )) ))() : null : _appliesTo;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSubscribedSku.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSubscribedSku.json.cs index 0de64303e788..f3536d9082da 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSubscribedSku.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSubscribedSku.json.cs @@ -79,13 +79,13 @@ internal MicrosoftGraphSubscribedSku(Microsoft.Azure.PowerShell.Cmdlets.Resource return; } __microsoftGraphEntity = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEntity(json,new global::System.Collections.Generic.HashSet(){ @"id",@"appliesTo",@"capabilityStatus",@"consumedUnits",@"prepaidUnits",@"servicePlans",@"skuId",@"skuPartNumber" }); - {_appliesTo = If( json?.PropertyT("appliesTo"), out var __jsonAppliesTo) ? (string)__jsonAppliesTo : (string)AppliesTo;} - {_capabilityStatus = If( json?.PropertyT("capabilityStatus"), out var __jsonCapabilityStatus) ? (string)__jsonCapabilityStatus : (string)CapabilityStatus;} - {_consumedUnit = If( json?.PropertyT("consumedUnits"), out var __jsonConsumedUnits) ? (int?)__jsonConsumedUnits : ConsumedUnit;} - {_servicePlan = If( json?.PropertyT("servicePlans"), out var __jsonServicePlans) ? If( __jsonServicePlans as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePlanInfo) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphServicePlanInfo.FromJson(__u) )) ))() : null : ServicePlan;} - {_skuId = If( json?.PropertyT("skuId"), out var __jsonSkuId) ? (string)__jsonSkuId : (string)SkuId;} - {_skuPartNumber = If( json?.PropertyT("skuPartNumber"), out var __jsonSkuPartNumber) ? (string)__jsonSkuPartNumber : (string)SkuPartNumber;} - {_prepaidUnit = If( json?.PropertyT("prepaidUnits"), out var __jsonPrepaidUnits) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphLicenseUnitsDetail.FromJson(__jsonPrepaidUnits) : PrepaidUnit;} + {_appliesTo = If( json?.PropertyT("appliesTo"), out var __jsonAppliesTo) ? (string)__jsonAppliesTo : (string)_appliesTo;} + {_capabilityStatus = If( json?.PropertyT("capabilityStatus"), out var __jsonCapabilityStatus) ? (string)__jsonCapabilityStatus : (string)_capabilityStatus;} + {_consumedUnit = If( json?.PropertyT("consumedUnits"), out var __jsonConsumedUnits) ? (int?)__jsonConsumedUnits : _consumedUnit;} + {_servicePlan = If( json?.PropertyT("servicePlans"), out var __jsonServicePlans) ? If( __jsonServicePlans as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePlanInfo) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphServicePlanInfo.FromJson(__u) )) ))() : null : _servicePlan;} + {_skuId = If( json?.PropertyT("skuId"), out var __jsonSkuId) ? (string)__jsonSkuId : (string)_skuId;} + {_skuPartNumber = If( json?.PropertyT("skuPartNumber"), out var __jsonSkuPartNumber) ? (string)__jsonSkuPartNumber : (string)_skuPartNumber;} + {_prepaidUnit = If( json?.PropertyT("prepaidUnits"), out var __jsonPrepaidUnits) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphLicenseUnitsDetail.FromJson(__jsonPrepaidUnits) : _prepaidUnit;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSubscribedSkuCollectionResponse.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSubscribedSkuCollectionResponse.json.cs index 41c1ec9b1809..871e6e5eaf17 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSubscribedSkuCollectionResponse.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphSubscribedSkuCollectionResponse.json.cs @@ -80,8 +80,8 @@ internal MicrosoftGraphSubscribedSkuCollectionResponse(Microsoft.Azure.PowerShel return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphSubscribedSku) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSubscribedSku.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphSubscribedSku) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphSubscribedSku.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphTokenIssuancePolicy.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphTokenIssuancePolicy.cs index 6fe181af1696..e8dd6fd50258 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphTokenIssuancePolicy.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphTokenIssuancePolicy.cs @@ -23,14 +23,14 @@ public partial class MicrosoftGraphTokenIssuancePolicy : private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicy __microsoftGraphStsPolicy = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphStsPolicy(); [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject[] AppliesTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).AppliesTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).AppliesTo = value ?? null /* arrayOf */; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject[] AppliesTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).AppliesTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).AppliesTo = value ?? null /* fixedArrayOf */; } /// /// A string collection containing a JSON string that defines the rules and settings for a policy. The syntax for the definition /// differs for each derived policy type. Required. /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string[] Definition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).Definition = value ?? null /* arrayOf */; } + public string[] Definition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).Definition = value ?? null /* fixedArrayOf */; } [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] public global::System.DateTime? DeletedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).DeletedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).DeletedDateTime = value ?? default(global::System.DateTime); } @@ -57,9 +57,6 @@ public partial class MicrosoftGraphTokenIssuancePolicy : /// Internal Acessors for OdataId string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataId = value; } - /// Internal Acessors for OdataType - string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataType = value; } - /// Internal Acessors for Id string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphStsPolicy).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphStsPolicy).Id = value; } @@ -68,8 +65,9 @@ public partial class MicrosoftGraphTokenIssuancePolicy : public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataId; } /// The type of object in directory + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataType; } + public string OdataType { get => "microsoft.graph.tokenIssuancePolicy"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataType = "microsoft.graph.tokenIssuancePolicy"; } /// Creates an new instance. public MicrosoftGraphTokenIssuancePolicy() diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphTokenIssuancePolicy.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphTokenIssuancePolicy.json.cs index fc3c88982461..92f48dfa095a 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphTokenIssuancePolicy.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphTokenIssuancePolicy.json.cs @@ -65,7 +65,7 @@ public partial class MicrosoftGraphTokenIssuancePolicy /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphTokenIssuancePolicy(json, new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"definition",@"isOrganizationDefault",@"appliesTo" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphTokenIssuancePolicy(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"definition",@"isOrganizationDefault",@"appliesTo" }) : null; } /// @@ -81,7 +81,7 @@ internal MicrosoftGraphTokenIssuancePolicy(Microsoft.Azure.PowerShell.Cmdlets.Re { return; } - __microsoftGraphStsPolicy = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphStsPolicy(json,new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"definition",@"isOrganizationDefault",@"appliesTo" }); + __microsoftGraphStsPolicy = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphStsPolicy(json,new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"definition",@"isOrganizationDefault",@"appliesTo" }); AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphTokenLifetimePolicy.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphTokenLifetimePolicy.cs index b5165eedc33c..ef71c092904c 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphTokenLifetimePolicy.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphTokenLifetimePolicy.cs @@ -23,14 +23,14 @@ public partial class MicrosoftGraphTokenLifetimePolicy : private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicy __microsoftGraphStsPolicy = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphStsPolicy(); [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject[] AppliesTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).AppliesTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).AppliesTo = value ?? null /* arrayOf */; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject[] AppliesTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).AppliesTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).AppliesTo = value ?? null /* fixedArrayOf */; } /// /// A string collection containing a JSON string that defines the rules and settings for a policy. The syntax for the definition /// differs for each derived policy type. Required. /// [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string[] Definition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).Definition = value ?? null /* arrayOf */; } + public string[] Definition { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).Definition; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphStsPolicyInternal)__microsoftGraphStsPolicy).Definition = value ?? null /* fixedArrayOf */; } [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] public global::System.DateTime? DeletedDateTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).DeletedDateTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).DeletedDateTime = value ?? default(global::System.DateTime); } @@ -57,9 +57,6 @@ public partial class MicrosoftGraphTokenLifetimePolicy : /// Internal Acessors for OdataId string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataId = value; } - /// Internal Acessors for OdataType - string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataType = value; } - /// Internal Acessors for Id string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphStsPolicy).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphStsPolicy).Id = value; } @@ -68,8 +65,9 @@ public partial class MicrosoftGraphTokenLifetimePolicy : public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataId; } /// The type of object in directory + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] - public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataType; } + public string OdataType { get => "microsoft.graph.tokenLifetimePolicy"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphStsPolicy).OdataType = "microsoft.graph.tokenLifetimePolicy"; } /// Creates an new instance. public MicrosoftGraphTokenLifetimePolicy() diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphTokenLifetimePolicy.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphTokenLifetimePolicy.json.cs index c3e2bb0bf560..a67283a4a43d 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphTokenLifetimePolicy.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphTokenLifetimePolicy.json.cs @@ -65,7 +65,7 @@ public partial class MicrosoftGraphTokenLifetimePolicy /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphTokenLifetimePolicy(json, new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"definition",@"isOrganizationDefault",@"appliesTo" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphTokenLifetimePolicy(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"definition",@"isOrganizationDefault",@"appliesTo" }) : null; } /// @@ -81,7 +81,7 @@ internal MicrosoftGraphTokenLifetimePolicy(Microsoft.Azure.PowerShell.Cmdlets.Re { return; } - __microsoftGraphStsPolicy = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphStsPolicy(json,new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"definition",@"isOrganizationDefault",@"appliesTo" }); + __microsoftGraphStsPolicy = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphStsPolicy(json,new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"description",@"definition",@"isOrganizationDefault",@"appliesTo" }); AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphUser.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphUser.cs index ea3e5a8ac218..d5eaa9376552 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphUser.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphUser.cs @@ -364,9 +364,6 @@ public partial class MicrosoftGraphUser : /// Internal Acessors for OdataId string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId = value; } - /// Internal Acessors for OdataType - string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal.OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = value; } - /// Internal Acessors for Id string Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEntityAutoGeneratedInternal)__microsoftGraphDirectoryObject).Id = value; } @@ -414,9 +411,10 @@ public partial class MicrosoftGraphUser : public string OdataId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataId; } /// The type of object in directory + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Constant] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] - public string OdataType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType; } + public string OdataType { get => "#microsoft.graph.user"; set => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectInternal)__microsoftGraphDirectoryObject).OdataType = "#microsoft.graph.user"; } /// Backing field for property. private string _officeLocation; @@ -561,6 +559,11 @@ public partial class MicrosoftGraphUser : [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] public string[] ProxyAddress { get => this._proxyAddress; } + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Origin(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.DoNotFormat] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + /// Backing field for property. private bool? _showInAddressList; diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphUser.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphUser.json.cs index 13c6884e88a0..562cd43c3ec3 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphUser.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphUser.json.cs @@ -62,7 +62,7 @@ public partial class MicrosoftGraphUser /// public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser FromJson(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphUser(json, new global::System.Collections.Generic.HashSet(){ @"id",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"accountEnabled",@"ageGroup",@"approximateLastSignInDateTime",@"businessPhones",@"city",@"companyName",@"consentProvidedForMinor",@"country",@"createdDateTime",@"creationType",@"complianceExpirationDateTime",@"department",@"deviceVersion",@"employeeHireDate",@"employeeId",@"employeeOrgData",@"employeeType",@"externalUserState",@"externalUserStateChangeDateTime",@"faxNumber",@"givenName",@"identities",@"imAddresses",@"isResourceAccount",@"jobTitle",@"lastPasswordChangeDateTime",@"legalAgeGroupClassification",@"manager",@"mail",@"mailNickname",@"mobilePhone",@"officeLocation",@"otherMails",@"onPremisesImmutableId",@"onPremisesLastSyncDateTime",@"onPremisesSyncEnabled",@"operatingSystem",@"operatingSystemVersion",@"passwordPolicies",@"passwordProfile",@"postalCode",@"preferredLanguage",@"proxyAddresses",@"physicalIds",@"showInAddressList",@"signInSessionsValidFromDateTime",@"state",@"streetAddress",@"surname",@"trustType",@"usageLocation",@"userPrincipalName",@"userType" }) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonObject json ? new MicrosoftGraphUser(json, new global::System.Collections.Generic.HashSet(){ @"ResourceGroupName",@"deletedDateTime",@"displayName",@"@odata.type",@"@odata.id",@"accountEnabled",@"ageGroup",@"approximateLastSignInDateTime",@"businessPhones",@"city",@"companyName",@"consentProvidedForMinor",@"country",@"createdDateTime",@"creationType",@"complianceExpirationDateTime",@"department",@"deviceVersion",@"employeeHireDate",@"employeeId",@"employeeOrgData",@"employeeType",@"externalUserState",@"externalUserStateChangeDateTime",@"faxNumber",@"givenName",@"identities",@"imAddresses",@"isResourceAccount",@"jobTitle",@"lastPasswordChangeDateTime",@"legalAgeGroupClassification",@"manager",@"mail",@"mailNickname",@"mobilePhone",@"officeLocation",@"otherMails",@"onPremisesImmutableId",@"onPremisesLastSyncDateTime",@"onPremisesSyncEnabled",@"operatingSystem",@"operatingSystemVersion",@"passwordPolicies",@"passwordProfile",@"postalCode",@"preferredLanguage",@"proxyAddresses",@"physicalIds",@"showInAddressList",@"signInSessionsValidFromDateTime",@"state",@"streetAddress",@"surname",@"trustType",@"usageLocation",@"userPrincipalName",@"userType" }) : null; } /// @@ -80,59 +80,59 @@ internal MicrosoftGraphUser(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); __microsoftGraphDirectoryObject = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject(json); - {_accountEnabled = If( json?.PropertyT("accountEnabled"), out var __jsonAccountEnabled) ? (bool?)__jsonAccountEnabled : AccountEnabled;} - {_ageGroup = If( json?.PropertyT("ageGroup"), out var __jsonAgeGroup) ? (string)__jsonAgeGroup : (string)AgeGroup;} - {_approximateLastSignInDateTime = If( json?.PropertyT("approximateLastSignInDateTime"), out var __jsonApproximateLastSignInDateTime) ? global::System.DateTime.TryParse((string)__jsonApproximateLastSignInDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonApproximateLastSignInDateTimeValue) ? __jsonApproximateLastSignInDateTimeValue : ApproximateLastSignInDateTime : ApproximateLastSignInDateTime;} - {_businessPhone = If( json?.PropertyT("businessPhones"), out var __jsonBusinessPhones) ? If( __jsonBusinessPhones as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : BusinessPhone;} - {_city = If( json?.PropertyT("city"), out var __jsonCity) ? (string)__jsonCity : (string)City;} - {_companyName = If( json?.PropertyT("companyName"), out var __jsonCompanyName) ? (string)__jsonCompanyName : (string)CompanyName;} - {_consentProvidedForMinor = If( json?.PropertyT("consentProvidedForMinor"), out var __jsonConsentProvidedForMinor) ? (string)__jsonConsentProvidedForMinor : (string)ConsentProvidedForMinor;} - {_country = If( json?.PropertyT("country"), out var __jsonCountry) ? (string)__jsonCountry : (string)Country;} - {_createdDateTime = If( json?.PropertyT("createdDateTime"), out var __jsonCreatedDateTime) ? global::System.DateTime.TryParse((string)__jsonCreatedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedDateTimeValue) ? __jsonCreatedDateTimeValue : CreatedDateTime : CreatedDateTime;} - {_creationType = If( json?.PropertyT("creationType"), out var __jsonCreationType) ? (string)__jsonCreationType : (string)CreationType;} - {_complianceExpirationDateTime = If( json?.PropertyT("complianceExpirationDateTime"), out var __jsonComplianceExpirationDateTime) ? global::System.DateTime.TryParse((string)__jsonComplianceExpirationDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonComplianceExpirationDateTimeValue) ? __jsonComplianceExpirationDateTimeValue : ComplianceExpirationDateTime : ComplianceExpirationDateTime;} - {_department = If( json?.PropertyT("department"), out var __jsonDepartment) ? (string)__jsonDepartment : (string)Department;} - {_deviceVersion = If( json?.PropertyT("deviceVersion"), out var __jsonDeviceVersion) ? (int?)__jsonDeviceVersion : DeviceVersion;} - {_employeeHireDate = If( json?.PropertyT("employeeHireDate"), out var __jsonEmployeeHireDate) ? global::System.DateTime.TryParse((string)__jsonEmployeeHireDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEmployeeHireDateValue) ? __jsonEmployeeHireDateValue : EmployeeHireDate : EmployeeHireDate;} - {_employeeId = If( json?.PropertyT("employeeId"), out var __jsonEmployeeId) ? (string)__jsonEmployeeId : (string)EmployeeId;} - {_employeeOrgData = If( json?.PropertyT("employeeOrgData"), out var __jsonEmployeeOrgData) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEmployeeOrgData.FromJson(__jsonEmployeeOrgData) : EmployeeOrgData;} - {_employeeType = If( json?.PropertyT("employeeType"), out var __jsonEmployeeType) ? (string)__jsonEmployeeType : (string)EmployeeType;} - {_externalUserState = If( json?.PropertyT("externalUserState"), out var __jsonExternalUserState) ? (string)__jsonExternalUserState : (string)ExternalUserState;} - {_externalUserStateChangeDateTime = If( json?.PropertyT("externalUserStateChangeDateTime"), out var __jsonExternalUserStateChangeDateTime) ? global::System.DateTime.TryParse((string)__jsonExternalUserStateChangeDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExternalUserStateChangeDateTimeValue) ? __jsonExternalUserStateChangeDateTimeValue : ExternalUserStateChangeDateTime : ExternalUserStateChangeDateTime;} - {_faxNumber = If( json?.PropertyT("faxNumber"), out var __jsonFaxNumber) ? (string)__jsonFaxNumber : (string)FaxNumber;} - {_givenName = If( json?.PropertyT("givenName"), out var __jsonGivenName) ? (string)__jsonGivenName : (string)GivenName;} - {_identity = If( json?.PropertyT("identities"), out var __jsonIdentities) ? If( __jsonIdentities as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphObjectIdentity) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphObjectIdentity.FromJson(__p) )) ))() : null : Identity;} - {_imAddress = If( json?.PropertyT("imAddresses"), out var __jsonImAddresses) ? If( __jsonImAddresses as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : ImAddress;} - {_isResourceAccount = If( json?.PropertyT("isResourceAccount"), out var __jsonIsResourceAccount) ? (bool?)__jsonIsResourceAccount : IsResourceAccount;} - {_jobTitle = If( json?.PropertyT("jobTitle"), out var __jsonJobTitle) ? (string)__jsonJobTitle : (string)JobTitle;} - {_lastPasswordChangeDateTime = If( json?.PropertyT("lastPasswordChangeDateTime"), out var __jsonLastPasswordChangeDateTime) ? global::System.DateTime.TryParse((string)__jsonLastPasswordChangeDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastPasswordChangeDateTimeValue) ? __jsonLastPasswordChangeDateTimeValue : LastPasswordChangeDateTime : LastPasswordChangeDateTime;} - {_legalAgeGroupClassification = If( json?.PropertyT("legalAgeGroupClassification"), out var __jsonLegalAgeGroupClassification) ? (string)__jsonLegalAgeGroupClassification : (string)LegalAgeGroupClassification;} - {_manager = If( json?.PropertyT("manager"), out var __jsonManager) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__jsonManager) : Manager;} - {_mail = If( json?.PropertyT("mail"), out var __jsonMail) ? (string)__jsonMail : (string)Mail;} - {_mailNickname = If( json?.PropertyT("mailNickname"), out var __jsonMailNickname) ? (string)__jsonMailNickname : (string)MailNickname;} - {_mobilePhone = If( json?.PropertyT("mobilePhone"), out var __jsonMobilePhone) ? (string)__jsonMobilePhone : (string)MobilePhone;} - {_officeLocation = If( json?.PropertyT("officeLocation"), out var __jsonOfficeLocation) ? (string)__jsonOfficeLocation : (string)OfficeLocation;} - {_otherMail = If( json?.PropertyT("otherMails"), out var __jsonOtherMails) ? If( __jsonOtherMails as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(string) (__f is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __e ? (string)(__e.ToString()) : null)) ))() : null : OtherMail;} - {_onPremisesImmutableId = If( json?.PropertyT("onPremisesImmutableId"), out var __jsonOnPremisesImmutableId) ? (string)__jsonOnPremisesImmutableId : (string)OnPremisesImmutableId;} - {_onPremisesLastSyncDateTime = If( json?.PropertyT("onPremisesLastSyncDateTime"), out var __jsonOnPremisesLastSyncDateTime) ? global::System.DateTime.TryParse((string)__jsonOnPremisesLastSyncDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonOnPremisesLastSyncDateTimeValue) ? __jsonOnPremisesLastSyncDateTimeValue : OnPremisesLastSyncDateTime : OnPremisesLastSyncDateTime;} - {_onPremisesSyncEnabled = If( json?.PropertyT("onPremisesSyncEnabled"), out var __jsonOnPremisesSyncEnabled) ? (bool?)__jsonOnPremisesSyncEnabled : OnPremisesSyncEnabled;} - {_operatingSystem = If( json?.PropertyT("operatingSystem"), out var __jsonOperatingSystem) ? (string)__jsonOperatingSystem : (string)OperatingSystem;} - {_operatingSystemVersion = If( json?.PropertyT("operatingSystemVersion"), out var __jsonOperatingSystemVersion) ? (string)__jsonOperatingSystemVersion : (string)OperatingSystemVersion;} - {_passwordPolicy = If( json?.PropertyT("passwordPolicies"), out var __jsonPasswordPolicies) ? (string)__jsonPasswordPolicies : (string)PasswordPolicy;} - {_passwordProfile = If( json?.PropertyT("passwordProfile"), out var __jsonPasswordProfile) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordProfile.FromJson(__jsonPasswordProfile) : PasswordProfile;} - {_postalCode = If( json?.PropertyT("postalCode"), out var __jsonPostalCode) ? (string)__jsonPostalCode : (string)PostalCode;} - {_preferredLanguage = If( json?.PropertyT("preferredLanguage"), out var __jsonPreferredLanguage) ? (string)__jsonPreferredLanguage : (string)PreferredLanguage;} - {_proxyAddress = If( json?.PropertyT("proxyAddresses"), out var __jsonProxyAddresses) ? If( __jsonProxyAddresses as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(string) (__a is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString ___z ? (string)(___z.ToString()) : null)) ))() : null : ProxyAddress;} - {_physicalId = If( json?.PropertyT("physicalIds"), out var __jsonPhysicalIds) ? If( __jsonPhysicalIds as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___w) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___w, (___v)=>(string) (___v is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString ___u ? (string)(___u.ToString()) : null)) ))() : null : PhysicalId;} - {_showInAddressList = If( json?.PropertyT("showInAddressList"), out var __jsonShowInAddressList) ? (bool?)__jsonShowInAddressList : ShowInAddressList;} - {_signInSessionsValidFromDateTime = If( json?.PropertyT("signInSessionsValidFromDateTime"), out var __jsonSignInSessionsValidFromDateTime) ? global::System.DateTime.TryParse((string)__jsonSignInSessionsValidFromDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonSignInSessionsValidFromDateTimeValue) ? __jsonSignInSessionsValidFromDateTimeValue : SignInSessionsValidFromDateTime : SignInSessionsValidFromDateTime;} - {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} - {_streetAddress = If( json?.PropertyT("streetAddress"), out var __jsonStreetAddress) ? (string)__jsonStreetAddress : (string)StreetAddress;} - {_surname = If( json?.PropertyT("surname"), out var __jsonSurname) ? (string)__jsonSurname : (string)Surname;} - {_trustType = If( json?.PropertyT("trustType"), out var __jsonTrustType) ? (string)__jsonTrustType : (string)TrustType;} - {_usageLocation = If( json?.PropertyT("usageLocation"), out var __jsonUsageLocation) ? (string)__jsonUsageLocation : (string)UsageLocation;} - {_userPrincipalName = If( json?.PropertyT("userPrincipalName"), out var __jsonUserPrincipalName) ? (string)__jsonUserPrincipalName : (string)UserPrincipalName;} - {_userType = If( json?.PropertyT("userType"), out var __jsonUserType) ? (string)__jsonUserType : (string)UserType;} + {_accountEnabled = If( json?.PropertyT("accountEnabled"), out var __jsonAccountEnabled) ? (bool?)__jsonAccountEnabled : _accountEnabled;} + {_ageGroup = If( json?.PropertyT("ageGroup"), out var __jsonAgeGroup) ? (string)__jsonAgeGroup : (string)_ageGroup;} + {_approximateLastSignInDateTime = If( json?.PropertyT("approximateLastSignInDateTime"), out var __jsonApproximateLastSignInDateTime) ? global::System.DateTime.TryParse((string)__jsonApproximateLastSignInDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonApproximateLastSignInDateTimeValue) ? __jsonApproximateLastSignInDateTimeValue : _approximateLastSignInDateTime : _approximateLastSignInDateTime;} + {_businessPhone = If( json?.PropertyT("businessPhones"), out var __jsonBusinessPhones) ? If( __jsonBusinessPhones as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _businessPhone;} + {_city = If( json?.PropertyT("city"), out var __jsonCity) ? (string)__jsonCity : (string)_city;} + {_companyName = If( json?.PropertyT("companyName"), out var __jsonCompanyName) ? (string)__jsonCompanyName : (string)_companyName;} + {_consentProvidedForMinor = If( json?.PropertyT("consentProvidedForMinor"), out var __jsonConsentProvidedForMinor) ? (string)__jsonConsentProvidedForMinor : (string)_consentProvidedForMinor;} + {_country = If( json?.PropertyT("country"), out var __jsonCountry) ? (string)__jsonCountry : (string)_country;} + {_createdDateTime = If( json?.PropertyT("createdDateTime"), out var __jsonCreatedDateTime) ? global::System.DateTime.TryParse((string)__jsonCreatedDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedDateTimeValue) ? __jsonCreatedDateTimeValue : _createdDateTime : _createdDateTime;} + {_creationType = If( json?.PropertyT("creationType"), out var __jsonCreationType) ? (string)__jsonCreationType : (string)_creationType;} + {_complianceExpirationDateTime = If( json?.PropertyT("complianceExpirationDateTime"), out var __jsonComplianceExpirationDateTime) ? global::System.DateTime.TryParse((string)__jsonComplianceExpirationDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonComplianceExpirationDateTimeValue) ? __jsonComplianceExpirationDateTimeValue : _complianceExpirationDateTime : _complianceExpirationDateTime;} + {_department = If( json?.PropertyT("department"), out var __jsonDepartment) ? (string)__jsonDepartment : (string)_department;} + {_deviceVersion = If( json?.PropertyT("deviceVersion"), out var __jsonDeviceVersion) ? (int?)__jsonDeviceVersion : _deviceVersion;} + {_employeeHireDate = If( json?.PropertyT("employeeHireDate"), out var __jsonEmployeeHireDate) ? global::System.DateTime.TryParse((string)__jsonEmployeeHireDate, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEmployeeHireDateValue) ? __jsonEmployeeHireDateValue : _employeeHireDate : _employeeHireDate;} + {_employeeId = If( json?.PropertyT("employeeId"), out var __jsonEmployeeId) ? (string)__jsonEmployeeId : (string)_employeeId;} + {_employeeOrgData = If( json?.PropertyT("employeeOrgData"), out var __jsonEmployeeOrgData) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphEmployeeOrgData.FromJson(__jsonEmployeeOrgData) : _employeeOrgData;} + {_employeeType = If( json?.PropertyT("employeeType"), out var __jsonEmployeeType) ? (string)__jsonEmployeeType : (string)_employeeType;} + {_externalUserState = If( json?.PropertyT("externalUserState"), out var __jsonExternalUserState) ? (string)__jsonExternalUserState : (string)_externalUserState;} + {_externalUserStateChangeDateTime = If( json?.PropertyT("externalUserStateChangeDateTime"), out var __jsonExternalUserStateChangeDateTime) ? global::System.DateTime.TryParse((string)__jsonExternalUserStateChangeDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExternalUserStateChangeDateTimeValue) ? __jsonExternalUserStateChangeDateTimeValue : _externalUserStateChangeDateTime : _externalUserStateChangeDateTime;} + {_faxNumber = If( json?.PropertyT("faxNumber"), out var __jsonFaxNumber) ? (string)__jsonFaxNumber : (string)_faxNumber;} + {_givenName = If( json?.PropertyT("givenName"), out var __jsonGivenName) ? (string)__jsonGivenName : (string)_givenName;} + {_identity = If( json?.PropertyT("identities"), out var __jsonIdentities) ? If( __jsonIdentities as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphObjectIdentity) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphObjectIdentity.FromJson(__p) )) ))() : null : _identity;} + {_imAddress = If( json?.PropertyT("imAddresses"), out var __jsonImAddresses) ? If( __jsonImAddresses as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : _imAddress;} + {_isResourceAccount = If( json?.PropertyT("isResourceAccount"), out var __jsonIsResourceAccount) ? (bool?)__jsonIsResourceAccount : _isResourceAccount;} + {_jobTitle = If( json?.PropertyT("jobTitle"), out var __jsonJobTitle) ? (string)__jsonJobTitle : (string)_jobTitle;} + {_lastPasswordChangeDateTime = If( json?.PropertyT("lastPasswordChangeDateTime"), out var __jsonLastPasswordChangeDateTime) ? global::System.DateTime.TryParse((string)__jsonLastPasswordChangeDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastPasswordChangeDateTimeValue) ? __jsonLastPasswordChangeDateTimeValue : _lastPasswordChangeDateTime : _lastPasswordChangeDateTime;} + {_legalAgeGroupClassification = If( json?.PropertyT("legalAgeGroupClassification"), out var __jsonLegalAgeGroupClassification) ? (string)__jsonLegalAgeGroupClassification : (string)_legalAgeGroupClassification;} + {_manager = If( json?.PropertyT("manager"), out var __jsonManager) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__jsonManager) : _manager;} + {_mail = If( json?.PropertyT("mail"), out var __jsonMail) ? (string)__jsonMail : (string)_mail;} + {_mailNickname = If( json?.PropertyT("mailNickname"), out var __jsonMailNickname) ? (string)__jsonMailNickname : (string)_mailNickname;} + {_mobilePhone = If( json?.PropertyT("mobilePhone"), out var __jsonMobilePhone) ? (string)__jsonMobilePhone : (string)_mobilePhone;} + {_officeLocation = If( json?.PropertyT("officeLocation"), out var __jsonOfficeLocation) ? (string)__jsonOfficeLocation : (string)_officeLocation;} + {_otherMail = If( json?.PropertyT("otherMails"), out var __jsonOtherMails) ? If( __jsonOtherMails as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(string) (__f is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __e ? (string)(__e.ToString()) : null)) ))() : null : _otherMail;} + {_onPremisesImmutableId = If( json?.PropertyT("onPremisesImmutableId"), out var __jsonOnPremisesImmutableId) ? (string)__jsonOnPremisesImmutableId : (string)_onPremisesImmutableId;} + {_onPremisesLastSyncDateTime = If( json?.PropertyT("onPremisesLastSyncDateTime"), out var __jsonOnPremisesLastSyncDateTime) ? global::System.DateTime.TryParse((string)__jsonOnPremisesLastSyncDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonOnPremisesLastSyncDateTimeValue) ? __jsonOnPremisesLastSyncDateTimeValue : _onPremisesLastSyncDateTime : _onPremisesLastSyncDateTime;} + {_onPremisesSyncEnabled = If( json?.PropertyT("onPremisesSyncEnabled"), out var __jsonOnPremisesSyncEnabled) ? (bool?)__jsonOnPremisesSyncEnabled : _onPremisesSyncEnabled;} + {_operatingSystem = If( json?.PropertyT("operatingSystem"), out var __jsonOperatingSystem) ? (string)__jsonOperatingSystem : (string)_operatingSystem;} + {_operatingSystemVersion = If( json?.PropertyT("operatingSystemVersion"), out var __jsonOperatingSystemVersion) ? (string)__jsonOperatingSystemVersion : (string)_operatingSystemVersion;} + {_passwordPolicy = If( json?.PropertyT("passwordPolicies"), out var __jsonPasswordPolicies) ? (string)__jsonPasswordPolicies : (string)_passwordPolicy;} + {_passwordProfile = If( json?.PropertyT("passwordProfile"), out var __jsonPasswordProfile) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordProfile.FromJson(__jsonPasswordProfile) : _passwordProfile;} + {_postalCode = If( json?.PropertyT("postalCode"), out var __jsonPostalCode) ? (string)__jsonPostalCode : (string)_postalCode;} + {_preferredLanguage = If( json?.PropertyT("preferredLanguage"), out var __jsonPreferredLanguage) ? (string)__jsonPreferredLanguage : (string)_preferredLanguage;} + {_proxyAddress = If( json?.PropertyT("proxyAddresses"), out var __jsonProxyAddresses) ? If( __jsonProxyAddresses as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(string) (__a is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString ___z ? (string)(___z.ToString()) : null)) ))() : null : _proxyAddress;} + {_physicalId = If( json?.PropertyT("physicalIds"), out var __jsonPhysicalIds) ? If( __jsonPhysicalIds as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var ___w) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___w, (___v)=>(string) (___v is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString ___u ? (string)(___u.ToString()) : null)) ))() : null : _physicalId;} + {_showInAddressList = If( json?.PropertyT("showInAddressList"), out var __jsonShowInAddressList) ? (bool?)__jsonShowInAddressList : _showInAddressList;} + {_signInSessionsValidFromDateTime = If( json?.PropertyT("signInSessionsValidFromDateTime"), out var __jsonSignInSessionsValidFromDateTime) ? global::System.DateTime.TryParse((string)__jsonSignInSessionsValidFromDateTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonSignInSessionsValidFromDateTimeValue) ? __jsonSignInSessionsValidFromDateTimeValue : _signInSessionsValidFromDateTime : _signInSessionsValidFromDateTime;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)_state;} + {_streetAddress = If( json?.PropertyT("streetAddress"), out var __jsonStreetAddress) ? (string)__jsonStreetAddress : (string)_streetAddress;} + {_surname = If( json?.PropertyT("surname"), out var __jsonSurname) ? (string)__jsonSurname : (string)_surname;} + {_trustType = If( json?.PropertyT("trustType"), out var __jsonTrustType) ? (string)__jsonTrustType : (string)_trustType;} + {_usageLocation = If( json?.PropertyT("usageLocation"), out var __jsonUsageLocation) ? (string)__jsonUsageLocation : (string)_usageLocation;} + {_userPrincipalName = If( json?.PropertyT("userPrincipalName"), out var __jsonUserPrincipalName) ? (string)__jsonUserPrincipalName : (string)_userPrincipalName;} + {_userType = If( json?.PropertyT("userType"), out var __jsonUserType) ? (string)__jsonUserType : (string)_userType;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphVerifiedDomain.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphVerifiedDomain.json.cs index 09adb064d14e..fdd0fa855ed9 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphVerifiedDomain.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphVerifiedDomain.json.cs @@ -79,11 +79,11 @@ internal MicrosoftGraphVerifiedDomain(Microsoft.Azure.PowerShell.Cmdlets.Resourc return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_capability = If( json?.PropertyT("capabilities"), out var __jsonCapabilities) ? (string)__jsonCapabilities : (string)Capability;} - {_isDefault = If( json?.PropertyT("isDefault"), out var __jsonIsDefault) ? (bool?)__jsonIsDefault : IsDefault;} - {_isInitial = If( json?.PropertyT("isInitial"), out var __jsonIsInitial) ? (bool?)__jsonIsInitial : IsInitial;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_capability = If( json?.PropertyT("capabilities"), out var __jsonCapabilities) ? (string)__jsonCapabilities : (string)_capability;} + {_isDefault = If( json?.PropertyT("isDefault"), out var __jsonIsDefault) ? (bool?)__jsonIsDefault : _isDefault;} + {_isInitial = If( json?.PropertyT("isInitial"), out var __jsonIsInitial) ? (bool?)__jsonIsInitial : _isInitial;} + {_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); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphWebApplication.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphWebApplication.json.cs index 5f7491767f58..7b53196710a6 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphWebApplication.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/MicrosoftGraphWebApplication.json.cs @@ -79,10 +79,10 @@ internal MicrosoftGraphWebApplication(Microsoft.Azure.PowerShell.Cmdlets.Resourc return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_homePageUrl = If( json?.PropertyT("homePageUrl"), out var __jsonHomePageUrl) ? (string)__jsonHomePageUrl : (string)HomePageUrl;} - {_logoutUrl = If( json?.PropertyT("logoutUrl"), out var __jsonLogoutUrl) ? (string)__jsonLogoutUrl : (string)LogoutUrl;} - {_redirectUri = If( json?.PropertyT("redirectUris"), out var __jsonRedirectUris) ? If( __jsonRedirectUris as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : RedirectUri;} - {_implicitGrantSetting = If( json?.PropertyT("implicitGrantSettings"), out var __jsonImplicitGrantSettings) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphImplicitGrantSettings.FromJson(__jsonImplicitGrantSettings) : ImplicitGrantSetting;} + {_homePageUrl = If( json?.PropertyT("homePageUrl"), out var __jsonHomePageUrl) ? (string)__jsonHomePageUrl : (string)_homePageUrl;} + {_logoutUrl = If( json?.PropertyT("logoutUrl"), out var __jsonLogoutUrl) ? (string)__jsonLogoutUrl : (string)_logoutUrl;} + {_redirectUri = If( json?.PropertyT("redirectUris"), out var __jsonRedirectUris) ? If( __jsonRedirectUris as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _redirectUri;} + {_implicitGrantSetting = If( json?.PropertyT("implicitGrantSettings"), out var __jsonImplicitGrantSettings) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphImplicitGrantSettings.FromJson(__jsonImplicitGrantSettings) : _implicitGrantSetting;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/Paths141Ryo0ApplicationsApplicationIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/Paths141Ryo0ApplicationsApplicationIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema.json.cs index 852a549a69cb..feae58a9045d 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/Paths141Ryo0ApplicationsApplicationIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/Paths141Ryo0ApplicationsApplicationIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema.json.cs @@ -79,7 +79,7 @@ internal Paths141Ryo0ApplicationsApplicationIdMicrosoftGraphAddpasswordPostReque return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_passwordCredential = If( json?.PropertyT("passwordCredential"), out var __jsonPasswordCredential) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential.FromJson(__jsonPasswordCredential) : PasswordCredential;} + {_passwordCredential = If( json?.PropertyT("passwordCredential"), out var __jsonPasswordCredential) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential.FromJson(__jsonPasswordCredential) : _passwordCredential;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/Paths17CrvdcApplicationsApplicationIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/Paths17CrvdcApplicationsApplicationIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema.json.cs index 9c013b28483b..4d2b76f0c0ce 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/Paths17CrvdcApplicationsApplicationIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/Paths17CrvdcApplicationsApplicationIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema.json.cs @@ -79,9 +79,9 @@ internal Paths17CrvdcApplicationsApplicationIdMicrosoftGraphAddkeyPostRequestbod return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_proof = If( json?.PropertyT("proof"), out var __jsonProof) ? (string)__jsonProof : (string)Proof;} - {_keyCredential = If( json?.PropertyT("keyCredential"), out var __jsonKeyCredential) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential.FromJson(__jsonKeyCredential) : KeyCredential;} - {_passwordCredential = If( json?.PropertyT("passwordCredential"), out var __jsonPasswordCredential) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential.FromJson(__jsonPasswordCredential) : PasswordCredential;} + {_proof = If( json?.PropertyT("proof"), out var __jsonProof) ? (string)__jsonProof : (string)_proof;} + {_keyCredential = If( json?.PropertyT("keyCredential"), out var __jsonKeyCredential) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential.FromJson(__jsonKeyCredential) : _keyCredential;} + {_passwordCredential = If( json?.PropertyT("passwordCredential"), out var __jsonPasswordCredential) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential.FromJson(__jsonPasswordCredential) : _passwordCredential;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/Paths1Idoj4GServiceprincipalsServiceprincipalIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/Paths1Idoj4GServiceprincipalsServiceprincipalIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema.json.cs index d96af19fd4f5..655237734d6a 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/Paths1Idoj4GServiceprincipalsServiceprincipalIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/Paths1Idoj4GServiceprincipalsServiceprincipalIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema.json.cs @@ -79,7 +79,7 @@ internal Paths1Idoj4GServiceprincipalsServiceprincipalIdMicrosoftGraphRemovepass return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_keyId = If( json?.PropertyT("keyId"), out var __jsonKeyId) ? (string)__jsonKeyId : (string)KeyId;} + {_keyId = If( json?.PropertyT("keyId"), out var __jsonKeyId) ? (string)__jsonKeyId : (string)_keyId;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/Paths1UhuhlbServiceprincipalsServiceprincipalIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/Paths1UhuhlbServiceprincipalsServiceprincipalIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema.json.cs index 959988580303..9e0a4296bb38 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/Paths1UhuhlbServiceprincipalsServiceprincipalIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/Paths1UhuhlbServiceprincipalsServiceprincipalIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema.json.cs @@ -79,8 +79,8 @@ internal Paths1UhuhlbServiceprincipalsServiceprincipalIdMicrosoftGraphRemovekeyP return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_keyId = If( json?.PropertyT("keyId"), out var __jsonKeyId) ? (string)__jsonKeyId : (string)KeyId;} - {_proof = If( json?.PropertyT("proof"), out var __jsonProof) ? (string)__jsonProof : (string)Proof;} + {_keyId = If( json?.PropertyT("keyId"), out var __jsonKeyId) ? (string)__jsonKeyId : (string)_keyId;} + {_proof = If( json?.PropertyT("proof"), out var __jsonProof) ? (string)__jsonProof : (string)_proof;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/PathsHv033BApplicationsApplicationIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/PathsHv033BApplicationsApplicationIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema.json.cs index c4e3f7b4fa8d..7b08ef39914a 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/PathsHv033BApplicationsApplicationIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/PathsHv033BApplicationsApplicationIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema.json.cs @@ -79,7 +79,7 @@ internal PathsHv033BApplicationsApplicationIdMicrosoftGraphRemovepasswordPostReq return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_keyId = If( json?.PropertyT("keyId"), out var __jsonKeyId) ? (string)__jsonKeyId : (string)KeyId;} + {_keyId = If( json?.PropertyT("keyId"), out var __jsonKeyId) ? (string)__jsonKeyId : (string)_keyId;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/PathsHxlydaApplicationsApplicationIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/PathsHxlydaApplicationsApplicationIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema.json.cs index cb18f22c1ba4..4c312c219af3 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/PathsHxlydaApplicationsApplicationIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/PathsHxlydaApplicationsApplicationIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema.json.cs @@ -79,8 +79,8 @@ internal PathsHxlydaApplicationsApplicationIdMicrosoftGraphRemovekeyPostRequestb return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_keyId = If( json?.PropertyT("keyId"), out var __jsonKeyId) ? (string)__jsonKeyId : (string)KeyId;} - {_proof = If( json?.PropertyT("proof"), out var __jsonProof) ? (string)__jsonProof : (string)Proof;} + {_keyId = If( json?.PropertyT("keyId"), out var __jsonKeyId) ? (string)__jsonKeyId : (string)_keyId;} + {_proof = If( json?.PropertyT("proof"), out var __jsonProof) ? (string)__jsonProof : (string)_proof;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/PathsIeboplServiceprincipalsServiceprincipalIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/PathsIeboplServiceprincipalsServiceprincipalIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema.json.cs index e91ac6dd9033..687f4d3cc958 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/PathsIeboplServiceprincipalsServiceprincipalIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/PathsIeboplServiceprincipalsServiceprincipalIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema.json.cs @@ -79,7 +79,7 @@ internal PathsIeboplServiceprincipalsServiceprincipalIdMicrosoftGraphAddpassword return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_passwordCredential = If( json?.PropertyT("passwordCredential"), out var __jsonPasswordCredential) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential.FromJson(__jsonPasswordCredential) : PasswordCredential;} + {_passwordCredential = If( json?.PropertyT("passwordCredential"), out var __jsonPasswordCredential) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential.FromJson(__jsonPasswordCredential) : _passwordCredential;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/PathsN3Fx9GServiceprincipalsServiceprincipalIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/PathsN3Fx9GServiceprincipalsServiceprincipalIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema.json.cs index 3f2acfa66d87..7ba034acc898 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/PathsN3Fx9GServiceprincipalsServiceprincipalIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/PathsN3Fx9GServiceprincipalsServiceprincipalIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema.json.cs @@ -79,9 +79,9 @@ internal PathsN3Fx9GServiceprincipalsServiceprincipalIdMicrosoftGraphAddkeyPostR return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_proof = If( json?.PropertyT("proof"), out var __jsonProof) ? (string)__jsonProof : (string)Proof;} - {_keyCredential = If( json?.PropertyT("keyCredential"), out var __jsonKeyCredential) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential.FromJson(__jsonKeyCredential) : KeyCredential;} - {_passwordCredential = If( json?.PropertyT("passwordCredential"), out var __jsonPasswordCredential) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential.FromJson(__jsonPasswordCredential) : PasswordCredential;} + {_proof = If( json?.PropertyT("proof"), out var __jsonProof) ? (string)__jsonProof : (string)_proof;} + {_keyCredential = If( json?.PropertyT("keyCredential"), out var __jsonKeyCredential) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphKeyCredential.FromJson(__jsonKeyCredential) : _keyCredential;} + {_passwordCredential = If( json?.PropertyT("passwordCredential"), out var __jsonPasswordCredential) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential.FromJson(__jsonPasswordCredential) : _passwordCredential;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/ReferenceCreate.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/ReferenceCreate.json.cs index b9aaac53e665..95b74f4e45dc 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/ReferenceCreate.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/ReferenceCreate.json.cs @@ -78,7 +78,7 @@ internal ReferenceCreate(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Ru return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_odataId = If( json?.PropertyT("@odata.id"), out var __jsonOdataId) ? (string)__jsonOdataId : (string)OdataId;} + {_odataId = If( json?.PropertyT("@odata.id"), out var __jsonOdataId) ? (string)__jsonOdataId : (string)_odataId;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/StringCollectionResponse.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/StringCollectionResponse.json.cs index c08e5a4088d8..492675ebe715 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/StringCollectionResponse.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10/StringCollectionResponse.json.cs @@ -79,8 +79,8 @@ internal StringCollectionResponse(Microsoft.Azure.PowerShell.Cmdlets.Resources.M return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10Beta/CollectionOfDirectoryObjectAutoGenerated.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10Beta/CollectionOfDirectoryObjectAutoGenerated.json.cs index 2c3f15ff5dc3..5c1b93be2d4f 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10Beta/CollectionOfDirectoryObjectAutoGenerated.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10Beta/CollectionOfDirectoryObjectAutoGenerated.json.cs @@ -67,8 +67,8 @@ internal CollectionOfDirectoryObjectAutoGenerated(Microsoft.Azure.PowerShell.Cmd return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__u) )) ))() : null : Value;} - {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)OdataNextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphDirectoryObject.FromJson(__u) )) ))() : null : _value;} + {_odataNextLink = If( json?.PropertyT("@odata.nextLink"), out var __jsonOdataNextLink) ? (string)__jsonOdataNextLink : (string)_odataNextLink;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10Beta/OdataError.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10Beta/OdataError.json.cs index 33ebab03e945..ac589b9fca3e 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10Beta/OdataError.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10Beta/OdataError.json.cs @@ -78,7 +78,7 @@ internal OdataError(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataErrorMain.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataErrorMain.FromJson(__jsonError) : _error;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10Beta/OdataErrorDetail.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10Beta/OdataErrorDetail.json.cs index 9734f7870ce8..b17824052830 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10Beta/OdataErrorDetail.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10Beta/OdataErrorDetail.json.cs @@ -78,9 +78,9 @@ internal OdataErrorDetail(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.R return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} - {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} - {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)Target;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} + {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)_target;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10Beta/OdataErrorMain.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10Beta/OdataErrorMain.json.cs index 1190560288a1..9fa8dbcd9b84 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10Beta/OdataErrorMain.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/ApiV10Beta/OdataErrorMain.json.cs @@ -78,11 +78,11 @@ internal OdataErrorMain(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Run return; } Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IAssociativeArray)this).AdditionalProperties, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.JsonSerializable.DeserializeDictionary(()=>new global::System.Collections.Generic.Dictionary()),exclusions ); - {_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.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataErrorDetail) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataErrorDetail.FromJson(__u) )) ))() : null : Detail;} - {_innererror = If( json?.PropertyT("innererror"), out var __jsonInnererror) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataErrorMainInnererror.FromJson(__jsonInnererror) : Innererror;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} + {_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.Resources.MSGraph.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataErrorDetail) (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataErrorDetail.FromJson(__u) )) ))() : null : _detail;} + {_innererror = If( json?.PropertyT("innererror"), out var __jsonInnererror) ? Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.OdataErrorMainInnererror.FromJson(__jsonInnererror) : _innererror;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Models/MSGraphIdentity.json.cs b/generated/Resources/MSGraph.Autorest/generated/api/Models/MSGraphIdentity.json.cs index 344b9d16de7f..79b722cdbe61 100644 --- a/generated/Resources/MSGraph.Autorest/generated/api/Models/MSGraphIdentity.json.cs +++ b/generated/Resources/MSGraph.Autorest/generated/api/Models/MSGraphIdentity.json.cs @@ -76,15 +76,15 @@ internal MSGraphIdentity(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Ru { return; } - {_applicationId = If( json?.PropertyT("application-id"), out var __jsonApplicationId) ? (string)__jsonApplicationId : (string)ApplicationId;} - {_federatedIdentityCredentialId = If( json?.PropertyT("federatedIdentityCredential-id"), out var __jsonFederatedIdentityCredentialId) ? (string)__jsonFederatedIdentityCredentialId : (string)FederatedIdentityCredentialId;} - {_servicePrincipalId = If( json?.PropertyT("servicePrincipal-id"), out var __jsonServicePrincipalId) ? (string)__jsonServicePrincipalId : (string)ServicePrincipalId;} - {_appRoleAssignmentId = If( json?.PropertyT("appRoleAssignment-id"), out var __jsonAppRoleAssignmentId) ? (string)__jsonAppRoleAssignmentId : (string)AppRoleAssignmentId;} - {_groupId = If( json?.PropertyT("group-id"), out var __jsonGroupId) ? (string)__jsonGroupId : (string)GroupId;} - {_directoryObjectId = If( json?.PropertyT("directoryObject-id"), out var __jsonDirectoryObjectId) ? (string)__jsonDirectoryObjectId : (string)DirectoryObjectId;} - {_memberId = If( json?.PropertyT("member-id"), out var __jsonMemberId) ? (string)__jsonMemberId : (string)MemberId;} - {_userId = If( json?.PropertyT("user-id"), out var __jsonUserId) ? (string)__jsonUserId : (string)UserId;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_applicationId = If( json?.PropertyT("application-id"), out var __jsonApplicationId) ? (string)__jsonApplicationId : (string)_applicationId;} + {_federatedIdentityCredentialId = If( json?.PropertyT("federatedIdentityCredential-id"), out var __jsonFederatedIdentityCredentialId) ? (string)__jsonFederatedIdentityCredentialId : (string)_federatedIdentityCredentialId;} + {_servicePrincipalId = If( json?.PropertyT("servicePrincipal-id"), out var __jsonServicePrincipalId) ? (string)__jsonServicePrincipalId : (string)_servicePrincipalId;} + {_appRoleAssignmentId = If( json?.PropertyT("appRoleAssignment-id"), out var __jsonAppRoleAssignmentId) ? (string)__jsonAppRoleAssignmentId : (string)_appRoleAssignmentId;} + {_groupId = If( json?.PropertyT("group-id"), out var __jsonGroupId) ? (string)__jsonGroupId : (string)_groupId;} + {_directoryObjectId = If( json?.PropertyT("directoryObject-id"), out var __jsonDirectoryObjectId) ? (string)__jsonDirectoryObjectId : (string)_directoryObjectId;} + {_memberId = If( json?.PropertyT("member-id"), out var __jsonMemberId) ? (string)__jsonMemberId : (string)_memberId;} + {_userId = If( json?.PropertyT("user-id"), out var __jsonUserId) ? (string)__jsonUserId : (string)_userId;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Support/MdmAuthority.Completer.cs b/generated/Resources/MSGraph.Autorest/generated/api/Support/MdmAuthority.Completer.cs deleted file mode 100644 index 673fc5908864..000000000000 --- a/generated/Resources/MSGraph.Autorest/generated/api/Support/MdmAuthority.Completer.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support -{ - - /// Mobile device management authority. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthorityTypeConverter))] - public partial struct MdmAuthority : - 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) || "unknown".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'unknown'", "unknown", global::System.Management.Automation.CompletionResultType.ParameterValue, "unknown"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "intune".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'intune'", "intune", global::System.Management.Automation.CompletionResultType.ParameterValue, "intune"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "sccm".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'sccm'", "sccm", global::System.Management.Automation.CompletionResultType.ParameterValue, "sccm"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "office365".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'office365'", "office365", global::System.Management.Automation.CompletionResultType.ParameterValue, "office365"); - } - } - } -} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Support/MdmAuthority.TypeConverter.cs b/generated/Resources/MSGraph.Autorest/generated/api/Support/MdmAuthority.TypeConverter.cs deleted file mode 100644 index f011f7fa46e8..000000000000 --- a/generated/Resources/MSGraph.Autorest/generated/api/Support/MdmAuthority.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support -{ - - /// Mobile device management authority. - public partial class MdmAuthorityTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert 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) => MdmAuthority.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/api/Support/MdmAuthority.cs b/generated/Resources/MSGraph.Autorest/generated/api/Support/MdmAuthority.cs deleted file mode 100644 index 376b0b11f566..000000000000 --- a/generated/Resources/MSGraph.Autorest/generated/api/Support/MdmAuthority.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support -{ - - /// Mobile device management authority. - public partial struct MdmAuthority : - System.IEquatable - { - /// Intune - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority Intune = @"intune"; - - /// Office365 - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority Office365 = @"office365"; - - /// SCCM - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority Sccm = @"sccm"; - - /// Unknown - public static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority Unknown = @"unknown"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to MdmAuthority - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new MdmAuthority(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type MdmAuthority - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type MdmAuthority (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 MdmAuthority && Equals((MdmAuthority)obj); - } - - /// Returns hashCode for enum MdmAuthority - /// 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 MdmAuthority(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for MdmAuthority - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to MdmAuthority - /// the value to convert to an instance of . - - public static implicit operator MdmAuthority(string value) - { - return new MdmAuthority(value); - } - - /// Implicit operator to convert MdmAuthority to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority e) - { - return e._value; - } - - /// Overriding != operator for enum MdmAuthority - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum MdmAuthority - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority e1, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADApplicationKey_AddViaJsonFilePath.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADApplicationKey_AddViaJsonFilePath.cs new file mode 100644 index 000000000000..8b3f8a496d4c --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADApplicationKey_AddViaJsonFilePath.cs @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Invoke action addKey + /// + /// [OpenAPI] AddKey=>POST:"/applications/{application-id}/microsoft.graph.addKey" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Add, @"AzADApplicationKey_AddViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Invoke action addKey")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/applications/{application-id}/microsoft.graph.addKey", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class AddAzADApplicationKey_AddViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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; + + /// Backing field for property. + private string _applicationId; + + /// key: id of application + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of application")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of application", + SerializedName = @"application-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ApplicationId { get => this._applicationId; set => this._applicationId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 Add operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Add operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Add operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// Initializes a new instance of the cmdlet class. + /// + public AddAzADApplicationKey_AddViaJsonFilePath() + { + + } + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ApplicationsAddKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ApplicationsAddKeyViaJsonString(ApplicationId, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADApplicationKey_AddViaJsonString.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADApplicationKey_AddViaJsonString.cs new file mode 100644 index 000000000000..3e23ceb54d64 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADApplicationKey_AddViaJsonString.cs @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Invoke action addKey + /// + /// [OpenAPI] AddKey=>POST:"/applications/{application-id}/microsoft.graph.addKey" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Add, @"AzADApplicationKey_AddViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Invoke action addKey")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/applications/{application-id}/microsoft.graph.addKey", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class AddAzADApplicationKey_AddViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Backing field for property. + private string _applicationId; + + /// key: id of application + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of application")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of application", + SerializedName = @"application-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ApplicationId { get => this._applicationId; set => this._applicationId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 Add operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Add operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Add operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// Initializes a new instance of the cmdlet class. + /// + public AddAzADApplicationKey_AddViaJsonString() + { + + } + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ApplicationsAddKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ApplicationsAddKeyViaJsonString(ApplicationId, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADApplicationPassword_AddViaJsonFilePath.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADApplicationPassword_AddViaJsonFilePath.cs new file mode 100644 index 000000000000..df6d1ea6cada --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADApplicationPassword_AddViaJsonFilePath.cs @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Invoke action addPassword + /// + /// [OpenAPI] AddPassword=>POST:"/applications/{application-id}/microsoft.graph.addPassword" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Add, @"AzADApplicationPassword_AddViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Invoke action addPassword")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/applications/{application-id}/microsoft.graph.addPassword", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class AddAzADApplicationPassword_AddViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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; + + /// Backing field for property. + private string _applicationId; + + /// key: id of application + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of application")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of application", + SerializedName = @"application-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ApplicationId { get => this._applicationId; set => this._applicationId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 Add operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Add operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Add operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// Initializes a new instance of the cmdlet class. + /// + public AddAzADApplicationPassword_AddViaJsonFilePath() + { + + } + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ApplicationsAddPassword' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ApplicationsAddPasswordViaJsonString(ApplicationId, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADApplicationPassword_AddViaJsonString.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADApplicationPassword_AddViaJsonString.cs new file mode 100644 index 000000000000..bf24f7f57054 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADApplicationPassword_AddViaJsonString.cs @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Invoke action addPassword + /// + /// [OpenAPI] AddPassword=>POST:"/applications/{application-id}/microsoft.graph.addPassword" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Add, @"AzADApplicationPassword_AddViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Invoke action addPassword")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/applications/{application-id}/microsoft.graph.addPassword", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class AddAzADApplicationPassword_AddViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Backing field for property. + private string _applicationId; + + /// key: id of application + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of application")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of application", + SerializedName = @"application-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ApplicationId { get => this._applicationId; set => this._applicationId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 Add operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Add operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Add operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// Initializes a new instance of the cmdlet class. + /// + public AddAzADApplicationPassword_AddViaJsonString() + { + + } + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ApplicationsAddPassword' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ApplicationsAddPasswordViaJsonString(ApplicationId, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADServicePrincipalKey_AddViaJsonFilePath.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADServicePrincipalKey_AddViaJsonFilePath.cs new file mode 100644 index 000000000000..58151198f505 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADServicePrincipalKey_AddViaJsonFilePath.cs @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Invoke action addKey + /// + /// [OpenAPI] AddKey=>POST:"/servicePrincipals/{servicePrincipal-id}/microsoft.graph.addKey" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Add, @"AzADServicePrincipalKey_AddViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Invoke action addKey")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}/microsoft.graph.addKey", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class AddAzADServicePrincipalKey_AddViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 Add operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Add operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Add operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// Initializes a new instance of the cmdlet class. + /// + public AddAzADServicePrincipalKey_AddViaJsonFilePath() + { + + } + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicePrincipalsAddKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsAddKeyViaJsonString(ServicePrincipalId, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADServicePrincipalKey_AddViaJsonString.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADServicePrincipalKey_AddViaJsonString.cs new file mode 100644 index 000000000000..2c1264c86359 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADServicePrincipalKey_AddViaJsonString.cs @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Invoke action addKey + /// + /// [OpenAPI] AddKey=>POST:"/servicePrincipals/{servicePrincipal-id}/microsoft.graph.addKey" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Add, @"AzADServicePrincipalKey_AddViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Invoke action addKey")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}/microsoft.graph.addKey", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class AddAzADServicePrincipalKey_AddViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 Add operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Add operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Add operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// Initializes a new instance of the cmdlet class. + /// + public AddAzADServicePrincipalKey_AddViaJsonString() + { + + } + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicePrincipalsAddKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsAddKeyViaJsonString(ServicePrincipalId, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADServicePrincipalPassword_AddViaJsonFilePath.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADServicePrincipalPassword_AddViaJsonFilePath.cs new file mode 100644 index 000000000000..1d8b7995190b --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADServicePrincipalPassword_AddViaJsonFilePath.cs @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Invoke action addPassword + /// + /// [OpenAPI] AddPassword=>POST:"/servicePrincipals/{servicePrincipal-id}/microsoft.graph.addPassword" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Add, @"AzADServicePrincipalPassword_AddViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Invoke action addPassword")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}/microsoft.graph.addPassword", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class AddAzADServicePrincipalPassword_AddViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 Add operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Add operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Add operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// Initializes a new instance of the cmdlet class. + /// + public AddAzADServicePrincipalPassword_AddViaJsonFilePath() + { + + } + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicePrincipalsAddPassword' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsAddPasswordViaJsonString(ServicePrincipalId, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADServicePrincipalPassword_AddViaJsonString.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADServicePrincipalPassword_AddViaJsonString.cs new file mode 100644 index 000000000000..3d83a2eadf39 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzADServicePrincipalPassword_AddViaJsonString.cs @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Invoke action addPassword + /// + /// [OpenAPI] AddPassword=>POST:"/servicePrincipals/{servicePrincipal-id}/microsoft.graph.addPassword" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Add, @"AzADServicePrincipalPassword_AddViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Invoke action addPassword")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}/microsoft.graph.addPassword", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class AddAzADServicePrincipalPassword_AddViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 Add operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Add operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Add operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// Initializes a new instance of the cmdlet class. + /// + public AddAzADServicePrincipalPassword_AddViaJsonString() + { + + } + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicePrincipalsAddPassword' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsAddPasswordViaJsonString(ServicePrincipalId, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdApplicationKey_Add.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdApplicationKey_Add.cs index 02043c228cc8..d7ab9a5890b1 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdApplicationKey_Add.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdApplicationKey_Add.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -40,6 +41,15 @@ public partial class AddAzADApplicationKey_Add : global::System.Management.Autom /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _applicationId; @@ -79,9 +89,10 @@ public partial class AddAzADApplicationKey_Add : global::System.Management.Autom public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -159,7 +170,7 @@ public partial class AddAzADApplicationKey_Add : global::System.Management.Autom partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public AddAzADApplicationKey_Add() { @@ -187,7 +198,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -260,7 +293,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -334,7 +367,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId,body=Body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -353,6 +386,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -380,14 +428,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId, body=Body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId, 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 } }); @@ -415,7 +463,25 @@ protected override void StopProcessing() } // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdApplicationKey_AddExpanded.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdApplicationKey_AddExpanded.cs index 968369f6d070..442357c91942 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdApplicationKey_AddExpanded.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdApplicationKey_AddExpanded.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -42,6 +43,15 @@ public partial class AddAzADApplicationKey_AddExpanded : global::System.Manageme /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional Parameters")] public global::System.Collections.Hashtable AdditionalProperties { get; set; } @@ -71,9 +81,10 @@ public partial class AddAzADApplicationKey_AddExpanded : global::System.Manageme public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -184,7 +195,7 @@ public partial class AddAzADApplicationKey_AddExpanded : global::System.Manageme partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public AddAzADApplicationKey_AddExpanded() { @@ -212,7 +223,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -285,7 +318,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -360,7 +393,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -379,6 +412,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -406,14 +454,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId, 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 } }); @@ -441,7 +489,25 @@ protected override void StopProcessing() } // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdApplicationPassword_Add.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdApplicationPassword_Add.cs index 0f4dc2a7f675..4eda73921af4 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdApplicationPassword_Add.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdApplicationPassword_Add.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -40,6 +41,15 @@ public partial class AddAzADApplicationPassword_Add : global::System.Management. /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _applicationId; @@ -79,9 +89,10 @@ public partial class AddAzADApplicationPassword_Add : global::System.Management. public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -159,7 +170,7 @@ public partial class AddAzADApplicationPassword_Add : global::System.Management. partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public AddAzADApplicationPassword_Add() { @@ -187,7 +198,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -260,7 +293,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -334,7 +367,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId,body=Body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -353,6 +386,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -380,14 +428,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId, body=Body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId, 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 } }); @@ -415,7 +463,25 @@ protected override void StopProcessing() } // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdApplicationPassword_AddExpanded.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdApplicationPassword_AddExpanded.cs index 841f43644def..b15dc7ce84b5 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdApplicationPassword_AddExpanded.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdApplicationPassword_AddExpanded.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -42,6 +43,15 @@ public partial class AddAzADApplicationPassword_AddExpanded : global::System.Man /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional Parameters")] public global::System.Collections.Hashtable AdditionalProperties { get; set; } @@ -71,9 +81,10 @@ public partial class AddAzADApplicationPassword_AddExpanded : global::System.Man public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -162,7 +173,7 @@ public partial class AddAzADApplicationPassword_AddExpanded : global::System.Man partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public AddAzADApplicationPassword_AddExpanded() { @@ -190,7 +201,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -263,7 +296,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -338,7 +371,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -357,6 +390,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -384,14 +432,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId, 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 } }); @@ -419,7 +467,25 @@ protected override void StopProcessing() } // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdServicePrincipalKey_Add.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdServicePrincipalKey_Add.cs index 9f70f44a7fdf..bce229ae81de 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdServicePrincipalKey_Add.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdServicePrincipalKey_Add.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -40,6 +41,15 @@ public partial class AddAzADServicePrincipalKey_Add : global::System.Management. /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsN3Fx9GServiceprincipalsServiceprincipalIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema _body; @@ -65,9 +75,10 @@ public partial class AddAzADServicePrincipalKey_Add : global::System.Management. public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -159,7 +170,7 @@ public partial class AddAzADServicePrincipalKey_Add : global::System.Management. partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public AddAzADServicePrincipalKey_Add() { @@ -187,7 +198,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -260,7 +293,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -334,7 +367,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,body=Body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -353,6 +386,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -380,14 +428,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, body=Body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, 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 } }); @@ -415,7 +463,25 @@ protected override void StopProcessing() } // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdServicePrincipalKey_AddExpanded.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdServicePrincipalKey_AddExpanded.cs index cfe2ddf84f4f..6b04232dd2c6 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdServicePrincipalKey_AddExpanded.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdServicePrincipalKey_AddExpanded.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -42,6 +43,15 @@ public partial class AddAzADServicePrincipalKey_AddExpanded : global::System.Man /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional Parameters")] public global::System.Collections.Hashtable AdditionalProperties { get; set; } @@ -57,9 +67,10 @@ public partial class AddAzADServicePrincipalKey_AddExpanded : global::System.Man public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -184,7 +195,7 @@ public partial class AddAzADServicePrincipalKey_AddExpanded : global::System.Man partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public AddAzADServicePrincipalKey_AddExpanded() { @@ -212,7 +223,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -285,7 +318,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -360,7 +393,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -379,6 +412,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -406,14 +454,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, 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 } }); @@ -441,7 +489,25 @@ protected override void StopProcessing() } // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdServicePrincipalPassword_Add.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdServicePrincipalPassword_Add.cs index 27c26822394f..2ba9df40c35a 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdServicePrincipalPassword_Add.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdServicePrincipalPassword_Add.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -40,6 +41,15 @@ public partial class AddAzADServicePrincipalPassword_Add : global::System.Manage /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsIeboplServiceprincipalsServiceprincipalIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema _body; @@ -65,9 +75,10 @@ public partial class AddAzADServicePrincipalPassword_Add : global::System.Manage public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -159,7 +170,7 @@ public partial class AddAzADServicePrincipalPassword_Add : global::System.Manage partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public AddAzADServicePrincipalPassword_Add() { @@ -187,7 +198,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -260,7 +293,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -334,7 +367,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,body=Body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -353,6 +386,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -380,14 +428,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, body=Body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, 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 } }); @@ -415,7 +463,25 @@ protected override void StopProcessing() } // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdServicePrincipalPassword_AddExpanded.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdServicePrincipalPassword_AddExpanded.cs index 00fcf9c0607c..b59355da1ed6 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdServicePrincipalPassword_AddExpanded.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/AddAzAdServicePrincipalPassword_AddExpanded.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -42,6 +43,15 @@ public partial class AddAzADServicePrincipalPassword_AddExpanded : global::Syste /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional Parameters")] public global::System.Collections.Hashtable AdditionalProperties { get; set; } @@ -57,9 +67,10 @@ public partial class AddAzADServicePrincipalPassword_AddExpanded : global::Syste public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -162,7 +173,7 @@ public partial class AddAzADServicePrincipalPassword_AddExpanded : global::Syste partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public AddAzADServicePrincipalPassword_AddExpanded() { @@ -190,7 +201,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -263,7 +296,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -338,7 +371,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -357,6 +390,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -384,14 +432,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, 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 } }); @@ -419,7 +467,25 @@ protected override void StopProcessing() } // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADAppFederatedCredential_Get.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADAppFederatedCredential_Get.cs index 4943c489874b..b0ee40bfdd1b 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADAppFederatedCredential_Get.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADAppFederatedCredential_Get.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -40,6 +41,15 @@ public partial class GetAzADAppFederatedCredential_Get : global::System.Manageme /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _applicationObjectId; @@ -66,9 +76,10 @@ public partial class GetAzADAppFederatedCredential_Get : global::System.Manageme public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -210,11 +221,33 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzADAppFederatedCredential_Get() { @@ -291,7 +324,7 @@ public GetAzADAppFederatedCredential_Get() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -357,12 +390,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ApplicationsGetFederatedIdentityCredentials(ApplicationObjectId, FederatedCredentialId, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */, onOk, onDefault, this, Pipeline); + await this.Client.ApplicationsGetFederatedIdentityCredentials(ApplicationObjectId, FederatedCredentialId, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId,FederatedCredentialId=FederatedCredentialId,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId,FederatedCredentialId=FederatedCredentialId,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -381,6 +414,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -408,14 +456,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId, FederatedCredentialId=FederatedCredentialId, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId, FederatedCredentialId=FederatedCredentialId, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -443,7 +491,25 @@ protected override void StopProcessing() } // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADAppFederatedCredential_List.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADAppFederatedCredential_List.cs index 636cf5f84657..a25c888cf2fc 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADAppFederatedCredential_List.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADAppFederatedCredential_List.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -40,12 +41,21 @@ public partial class GetAzADAppFederatedCredential_List : global::System.Managem /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _applicationObjectId; @@ -86,9 +96,10 @@ public partial class GetAzADAppFederatedCredential_List : global::System.Managem public global::System.Management.Automation.SwitchParameter Count { get => this._count; set => this._count = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -259,11 +270,33 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzADAppFederatedCredential_List() { @@ -340,7 +373,7 @@ public GetAzADAppFederatedCredential_List() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -406,12 +439,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ApplicationsListFederatedIdentityCredentials(ApplicationObjectId, this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */, onOk, onDefault, this, Pipeline); + await this.Client.ApplicationsListFederatedIdentityCredentials(ApplicationObjectId, this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId,Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?),Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId,Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?),Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* fixedArrayOf */,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -430,6 +463,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -457,14 +505,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId, Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId, Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -491,10 +539,11 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredentialCollectionResponse + var result = (await response); // clientside pagination enabled // response should be returning an array of some kind. +Pageable // pageable / value / @odata.nextLink - var result = await response; if ((ulong)result.Value.Length <= this.PagingParameters.Skip) { this.PagingParameters.Skip = this.PagingParameters.Skip - (ulong)result.Value.Length; @@ -503,7 +552,29 @@ protected override void StopProcessing() { ulong toRead = Math.Min(this.PagingParameters.First, (ulong)result.Value.Length - this.PagingParameters.Skip); var requiredResult = result.Value.SubArray((int)this.PagingParameters.Skip, (int)toRead); - WriteObject(requiredResult, true); + if (null != requiredResult) + { + if (0 == _responseSize && 1 == requiredResult.Length) + { + _firstResponse = requiredResult[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in requiredResult ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values.ToArray(), true); + _responseSize = 2; + } + } this.PagingParameters.Skip = 0; this.PagingParameters.First = this.PagingParameters.First <= toRead ? 0 : this.PagingParameters.First - toRead; } @@ -511,7 +582,7 @@ protected override void StopProcessing() if (_isFirst) { _isFirst = false; - while (_nextLink != null && this.PagingParameters.First > 0) + while (!String.IsNullOrEmpty(_nextLink) && this.PagingParameters.First > 0) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADGroupOwner_List.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADGroupOwner_List.cs index 0b007046dc4d..637f1935ee64 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADGroupOwner_List.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADGroupOwner_List.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -43,12 +44,21 @@ public partial class GetAzADGroupOwner_List : global::System.Management.Automati /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] @@ -91,9 +101,10 @@ public partial class GetAzADGroupOwner_List : global::System.Management.Automati public global::System.Management.Automation.SwitchParameter Count { get => this._count; set => this._count = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -278,11 +289,33 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzADGroupOwner_List() { @@ -359,7 +392,7 @@ public GetAzADGroupOwner_List() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -425,12 +458,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.GroupsListOwners(GroupId, this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */, onOk, onDefault, this, Pipeline); + await this.Client.GroupsListOwners(GroupId, this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId,ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null,Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?),Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId,ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null,Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?),Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* fixedArrayOf */,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -449,6 +482,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -476,14 +524,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId, ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId, ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -510,10 +558,11 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObjectCollectionResponse + var result = (await response); // clientside pagination enabled // response should be returning an array of some kind. +Pageable // pageable / value / @odata.nextLink - var result = await response; if ((ulong)result.Value.Length <= this.PagingParameters.Skip) { this.PagingParameters.Skip = this.PagingParameters.Skip - (ulong)result.Value.Length; @@ -522,7 +571,29 @@ protected override void StopProcessing() { ulong toRead = Math.Min(this.PagingParameters.First, (ulong)result.Value.Length - this.PagingParameters.Skip); var requiredResult = result.Value.SubArray((int)this.PagingParameters.Skip, (int)toRead); - WriteObject(requiredResult, true); + if (null != requiredResult) + { + if (0 == _responseSize && 1 == requiredResult.Length) + { + _firstResponse = requiredResult[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in requiredResult ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values.ToArray(), true); + _responseSize = 2; + } + } this.PagingParameters.Skip = 0; this.PagingParameters.First = this.PagingParameters.First <= toRead ? 0 : this.PagingParameters.First - toRead; } @@ -530,7 +601,7 @@ protected override void StopProcessing() if (_isFirst) { _isFirst = false; - while (_nextLink != null && this.PagingParameters.First > 0) + while (!String.IsNullOrEmpty(_nextLink) && this.PagingParameters.First > 0) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADOrganization_List.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADOrganization_List.cs index 5f856b481176..e90f00d5576e 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADOrganization_List.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADOrganization_List.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -40,12 +41,21 @@ public partial class GetAzADOrganization_List : global::System.Management.Automa /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] @@ -72,9 +82,10 @@ public partial class GetAzADOrganization_List : global::System.Management.Automa public global::System.Management.Automation.SwitchParameter Count { get => this._count; set => this._count = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -245,11 +256,33 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzADOrganization_List() { @@ -326,7 +359,7 @@ public GetAzADOrganization_List() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -392,12 +425,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.OrganizationListOrganization(this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */, onOk, onDefault, this, Pipeline); + await this.Client.OrganizationListOrganization(this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?),Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?),Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* fixedArrayOf */,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -416,6 +449,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -443,14 +491,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -477,10 +525,11 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganizationCollectionResponse + var result = (await response); // clientside pagination enabled // response should be returning an array of some kind. +Pageable // pageable / value / @odata.nextLink - var result = await response; if ((ulong)result.Value.Length <= this.PagingParameters.Skip) { this.PagingParameters.Skip = this.PagingParameters.Skip - (ulong)result.Value.Length; @@ -489,7 +538,29 @@ protected override void StopProcessing() { ulong toRead = Math.Min(this.PagingParameters.First, (ulong)result.Value.Length - this.PagingParameters.Skip); var requiredResult = result.Value.SubArray((int)this.PagingParameters.Skip, (int)toRead); - WriteObject(requiredResult, true); + if (null != requiredResult) + { + if (0 == _responseSize && 1 == requiredResult.Length) + { + _firstResponse = requiredResult[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in requiredResult ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values.ToArray(), true); + _responseSize = 2; + } + } this.PagingParameters.Skip = 0; this.PagingParameters.First = this.PagingParameters.First <= toRead ? 0 : this.PagingParameters.First - toRead; } @@ -497,7 +568,7 @@ protected override void StopProcessing() if (_isFirst) { _isFirst = false; - while (_nextLink != null && this.PagingParameters.First > 0) + while (!String.IsNullOrEmpty(_nextLink) && this.PagingParameters.First > 0) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADServicePrincipalAppRoleAssignment_Get.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADServicePrincipalAppRoleAssignment_Get.cs index 45727ce6e909..a9268b1ba9d9 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADServicePrincipalAppRoleAssignment_Get.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADServicePrincipalAppRoleAssignment_Get.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -39,6 +40,15 @@ public partial class GetAzADServicePrincipalAppRoleAssignment_Get : global::Syst /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _appRoleAssignmentId; @@ -65,9 +75,10 @@ public partial class GetAzADServicePrincipalAppRoleAssignment_Get : global::Syst public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -209,11 +220,33 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzADServicePrincipalAppRoleAssignment_Get() { @@ -290,7 +323,7 @@ public GetAzADServicePrincipalAppRoleAssignment_Get() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -356,12 +389,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ServicePrincipalsGetAppRoleAssignments(ServicePrincipalId, AppRoleAssignmentId, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */, onOk, onDefault, this, Pipeline); + await this.Client.ServicePrincipalsGetAppRoleAssignments(ServicePrincipalId, AppRoleAssignmentId, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,AppRoleAssignmentId=AppRoleAssignmentId,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,AppRoleAssignmentId=AppRoleAssignmentId,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -380,6 +413,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -407,14 +455,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, AppRoleAssignmentId=AppRoleAssignmentId, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, AppRoleAssignmentId=AppRoleAssignmentId, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -442,7 +490,25 @@ protected override void StopProcessing() } // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADServicePrincipalAppRoleAssignment_List.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADServicePrincipalAppRoleAssignment_List.cs index a2d8a3a27d1e..ab5956607f58 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADServicePrincipalAppRoleAssignment_List.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADServicePrincipalAppRoleAssignment_List.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -39,12 +40,21 @@ public partial class GetAzADServicePrincipalAppRoleAssignment_List : global::Sys /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] @@ -71,9 +81,10 @@ public partial class GetAzADServicePrincipalAppRoleAssignment_List : global::Sys public global::System.Management.Automation.SwitchParameter Count { get => this._count; set => this._count = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -258,11 +269,33 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzADServicePrincipalAppRoleAssignment_List() { @@ -339,7 +372,7 @@ public GetAzADServicePrincipalAppRoleAssignment_List() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -405,12 +438,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ServicePrincipalsListAppRoleAssignments(ServicePrincipalId, this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */, onOk, onDefault, this, Pipeline); + await this.Client.ServicePrincipalsListAppRoleAssignments(ServicePrincipalId, this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?),Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?),Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* fixedArrayOf */,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -429,6 +462,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -456,14 +504,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -490,10 +538,11 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentCollectionResponse + var result = (await response); // clientside pagination enabled // response should be returning an array of some kind. +Pageable // pageable / value / @odata.nextLink - var result = await response; if ((ulong)result.Value.Length <= this.PagingParameters.Skip) { this.PagingParameters.Skip = this.PagingParameters.Skip - (ulong)result.Value.Length; @@ -502,7 +551,29 @@ protected override void StopProcessing() { ulong toRead = Math.Min(this.PagingParameters.First, (ulong)result.Value.Length - this.PagingParameters.Skip); var requiredResult = result.Value.SubArray((int)this.PagingParameters.Skip, (int)toRead); - WriteObject(requiredResult, true); + if (null != requiredResult) + { + if (0 == _responseSize && 1 == requiredResult.Length) + { + _firstResponse = requiredResult[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in requiredResult ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values.ToArray(), true); + _responseSize = 2; + } + } this.PagingParameters.Skip = 0; this.PagingParameters.First = this.PagingParameters.First <= toRead ? 0 : this.PagingParameters.First - toRead; } @@ -510,7 +581,7 @@ protected override void StopProcessing() if (_isFirst) { _isFirst = false; - while (_nextLink != null && this.PagingParameters.First > 0) + while (!String.IsNullOrEmpty(_nextLink) && this.PagingParameters.First > 0) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADUserOwnedApplication_List.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADUserOwnedApplication_List.cs index 2badfeeba33b..041d3a5e52ca 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADUserOwnedApplication_List.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADUserOwnedApplication_List.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -42,12 +43,21 @@ public partial class GetAzADUserOwnedApplication_List : global::System.Managemen /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] @@ -60,9 +70,10 @@ public partial class GetAzADUserOwnedApplication_List : global::System.Managemen public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -205,11 +216,33 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzADUserOwnedApplication_List() { @@ -286,7 +319,7 @@ public GetAzADUserOwnedApplication_List() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -352,12 +385,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.UsersListOwnedApplications(this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */, onOk, onDefault, this, Pipeline); + await this.Client.UsersListOwnedApplications(this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* fixedArrayOf */,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -376,6 +409,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -403,14 +451,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -437,10 +485,11 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.ICollectionOfDirectoryObject + var result = (await response); // clientside pagination enabled // response should be returning an array of some kind. +Pageable // pageable / value / @odata.nextLink - var result = await response; if ((ulong)result.Value.Length <= this.PagingParameters.Skip) { this.PagingParameters.Skip = this.PagingParameters.Skip - (ulong)result.Value.Length; @@ -449,7 +498,29 @@ protected override void StopProcessing() { ulong toRead = Math.Min(this.PagingParameters.First, (ulong)result.Value.Length - this.PagingParameters.Skip); var requiredResult = result.Value.SubArray((int)this.PagingParameters.Skip, (int)toRead); - WriteObject(requiredResult, true); + if (null != requiredResult) + { + if (0 == _responseSize && 1 == requiredResult.Length) + { + _firstResponse = requiredResult[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in requiredResult ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values.ToArray(), true); + _responseSize = 2; + } + } this.PagingParameters.Skip = 0; this.PagingParameters.First = this.PagingParameters.First <= toRead ? 0 : this.PagingParameters.First - toRead; } @@ -457,7 +528,7 @@ protected override void StopProcessing() if (_isFirst) { _isFirst = false; - while (_nextLink != null && this.PagingParameters.First > 0) + while (!String.IsNullOrEmpty(_nextLink) && this.PagingParameters.First > 0) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADUserOwnedObject_List.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADUserOwnedObject_List.cs index 64f173b60825..19cda38b69b0 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADUserOwnedObject_List.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzADUserOwnedObject_List.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -42,12 +43,21 @@ public partial class GetAzADUserOwnedObject_List : global::System.Management.Aut /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] @@ -60,9 +70,10 @@ public partial class GetAzADUserOwnedObject_List : global::System.Management.Aut public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -205,11 +216,33 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzADUserOwnedObject_List() { @@ -286,7 +319,7 @@ public GetAzADUserOwnedObject_List() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -352,12 +385,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.UsersListOwnedObjects(this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */, onOk, onDefault, this, Pipeline); + await this.Client.UsersListOwnedObjects(this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* fixedArrayOf */,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -376,6 +409,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -403,14 +451,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -437,10 +485,11 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.ICollectionOfDirectoryObjectAutoGenerated2 + var result = (await response); // clientside pagination enabled // response should be returning an array of some kind. +Pageable // pageable / value / @odata.nextLink - var result = await response; if ((ulong)result.Value.Length <= this.PagingParameters.Skip) { this.PagingParameters.Skip = this.PagingParameters.Skip - (ulong)result.Value.Length; @@ -449,7 +498,29 @@ protected override void StopProcessing() { ulong toRead = Math.Min(this.PagingParameters.First, (ulong)result.Value.Length - this.PagingParameters.Skip); var requiredResult = result.Value.SubArray((int)this.PagingParameters.Skip, (int)toRead); - WriteObject(requiredResult, true); + if (null != requiredResult) + { + if (0 == _responseSize && 1 == requiredResult.Length) + { + _firstResponse = requiredResult[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in requiredResult ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values.ToArray(), true); + _responseSize = 2; + } + } this.PagingParameters.Skip = 0; this.PagingParameters.First = this.PagingParameters.First <= toRead ? 0 : this.PagingParameters.First - toRead; } @@ -457,7 +528,7 @@ protected override void StopProcessing() if (_isFirst) { _isFirst = false; - while (_nextLink != null && this.PagingParameters.First > 0) + while (!String.IsNullOrEmpty(_nextLink) && this.PagingParameters.First > 0) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdApplication_Get.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdApplication_Get.cs index d2994abf5d5f..1f28b58b84ff 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdApplication_Get.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdApplication_Get.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -43,6 +44,29 @@ public partial class GetAzADApplication_Get : global::System.Management.Automati /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Backing field for property. + private string _applicationId; + + /// key: id of application + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of application")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of application", + SerializedName = @"application-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ApplicationId { get => this._applicationId; set => this._applicationId = value; } + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] @@ -71,9 +95,10 @@ public partial class GetAzADApplication_Get : global::System.Management.Automati public string ConsistencyLevel { get => this._consistencyLevel; set => this._consistencyLevel = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -109,21 +134,6 @@ public partial class GetAzADApplication_Get : global::System.Management.Automati [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private string _id; - - /// key: id of application - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of application")] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"key: id of application", - SerializedName = @"application-id", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("ApplicationId")] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] - public string Id { get => this._id; set => this._id = value; } - /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -216,11 +226,33 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzADApplication_Get() { @@ -297,7 +329,7 @@ public GetAzADApplication_Get() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -363,12 +395,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ApplicationsApplicationGetApplication(Id, this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */, onOk, onDefault, this, Pipeline); + await this.Client.ApplicationsApplicationGetApplication(ApplicationId, this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id,ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId,ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -387,6 +419,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -414,14 +461,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id, ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id, ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -449,7 +496,25 @@ protected override void StopProcessing() } // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdApplication_List.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdApplication_List.cs index 62c481a26e51..e0dc19e6a92a 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdApplication_List.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdApplication_List.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -40,12 +41,21 @@ public partial class GetAzADApplication_List : global::System.Management.Automat /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] @@ -88,9 +98,10 @@ public partial class GetAzADApplication_List : global::System.Management.Automat public global::System.Management.Automation.SwitchParameter Count { get => this._count; set => this._count = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -261,11 +272,33 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzADApplication_List() { @@ -342,7 +375,7 @@ public GetAzADApplication_List() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -408,12 +441,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ApplicationsApplicationListApplication(this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */, onOk, onDefault, this, Pipeline); + await this.Client.ApplicationsApplicationListApplication(this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null,Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?),Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null,Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?),Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* fixedArrayOf */,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -432,6 +465,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -459,14 +507,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -493,10 +541,11 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.ICollectionOfApplication + var result = (await response); // clientside pagination enabled // response should be returning an array of some kind. +Pageable // pageable / value / @odata.nextLink - var result = await response; if ((ulong)result.Value.Length <= this.PagingParameters.Skip) { this.PagingParameters.Skip = this.PagingParameters.Skip - (ulong)result.Value.Length; @@ -505,7 +554,29 @@ protected override void StopProcessing() { ulong toRead = Math.Min(this.PagingParameters.First, (ulong)result.Value.Length - this.PagingParameters.Skip); var requiredResult = result.Value.SubArray((int)this.PagingParameters.Skip, (int)toRead); - WriteObject(requiredResult, true); + if (null != requiredResult) + { + if (0 == _responseSize && 1 == requiredResult.Length) + { + _firstResponse = requiredResult[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in requiredResult ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values.ToArray(), true); + _responseSize = 2; + } + } this.PagingParameters.Skip = 0; this.PagingParameters.First = this.PagingParameters.First <= toRead ? 0 : this.PagingParameters.First - toRead; } @@ -513,7 +584,7 @@ protected override void StopProcessing() if (_isFirst) { _isFirst = false; - while (_nextLink != null && this.PagingParameters.First > 0) + while (!String.IsNullOrEmpty(_nextLink) && this.PagingParameters.First > 0) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdGroupMember_List.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdGroupMember_List.cs index 2bc68d64ce82..5e663e4e318e 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdGroupMember_List.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdGroupMember_List.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -18,6 +19,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzADGroupMember_List", SupportsPaging = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PreviewMessage("This cmdlet is using API version beta which is under preview.")] [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"UMembers of this group, who can be users, devices, other groups, or service principals. Supports the List members, Add member, and Remove member operations. Nullable. Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=members($select=id,userPrincipalName,displayName).")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] @@ -43,12 +45,21 @@ public partial class GetAzADGroupMember_List : global::System.Management.Automat /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] @@ -75,9 +86,10 @@ public partial class GetAzADGroupMember_List : global::System.Management.Automat public global::System.Management.Automation.SwitchParameter Count { get => this._count; set => this._count = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -262,11 +274,33 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzADGroupMember_List() { @@ -343,7 +377,7 @@ public GetAzADGroupMember_List() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -409,12 +443,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.GroupsListMembers(GroupId, this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */, onOk, onDefault, this, Pipeline); + await this.Client.GroupsListMembers(GroupId, this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId,Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?),Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId,Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?),Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* fixedArrayOf */,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -433,6 +467,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -460,14 +509,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId, Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId, Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -494,10 +543,11 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.ICollectionOfDirectoryObjectAutoGenerated + var result = (await response); // clientside pagination enabled // response should be returning an array of some kind. +Pageable // pageable / value / @odata.nextLink - var result = await response; if ((ulong)result.Value.Length <= this.PagingParameters.Skip) { this.PagingParameters.Skip = this.PagingParameters.Skip - (ulong)result.Value.Length; @@ -506,7 +556,29 @@ protected override void StopProcessing() { ulong toRead = Math.Min(this.PagingParameters.First, (ulong)result.Value.Length - this.PagingParameters.Skip); var requiredResult = result.Value.SubArray((int)this.PagingParameters.Skip, (int)toRead); - WriteObject(requiredResult, true); + if (null != requiredResult) + { + if (0 == _responseSize && 1 == requiredResult.Length) + { + _firstResponse = requiredResult[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in requiredResult ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values.ToArray(), true); + _responseSize = 2; + } + } this.PagingParameters.Skip = 0; this.PagingParameters.First = this.PagingParameters.First <= toRead ? 0 : this.PagingParameters.First - toRead; } @@ -514,7 +586,7 @@ protected override void StopProcessing() if (_isFirst) { _isFirst = false; - while (_nextLink != null && this.PagingParameters.First > 0) + while (!String.IsNullOrEmpty(_nextLink) && this.PagingParameters.First > 0) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdGroup_Get.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdGroup_Get.cs index 8b8a236f15c7..2d6fd7705ae6 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdGroup_Get.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdGroup_Get.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -43,6 +44,15 @@ public partial class GetAzADGroup_Get : global::System.Management.Automation.PSC /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] @@ -71,9 +81,10 @@ public partial class GetAzADGroup_Get : global::System.Management.Automation.PSC public string ConsistencyLevel { get => this._consistencyLevel; set => this._consistencyLevel = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -97,6 +108,20 @@ public partial class GetAzADGroup_Get : global::System.Management.Automation.PSC /// Accessor for extensibleParameters. public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Backing field for property. + private string _groupId; + + /// key: id of group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of group")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of group", + SerializedName = @"group-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string GroupId { get => this._groupId; set => this._groupId = value; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -109,21 +134,6 @@ public partial class GetAzADGroup_Get : global::System.Management.Automation.PSC [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private string _id; - - /// key: id of group - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of group")] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"key: id of group", - SerializedName = @"group-id", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("GroupId")] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] - public string Id { get => this._id; set => this._id = value; } - /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -216,10 +226,32 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. public GetAzADGroup_Get() { @@ -295,7 +327,7 @@ public GetAzADGroup_Get() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -361,12 +393,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.GroupsGroupGetGroup(Id, this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */, onOk, onDefault, this, Pipeline); + await this.Client.GroupsGroupGetGroup(GroupId, this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id,ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId,ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -385,6 +417,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -412,14 +459,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id, ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id, ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -447,7 +494,25 @@ protected override void StopProcessing() } // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdGroup_List.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdGroup_List.cs index c5e3e1116234..5995d71ab9e6 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdGroup_List.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdGroup_List.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -40,12 +41,21 @@ public partial class GetAzADGroup_List : global::System.Management.Automation.PS /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] @@ -88,9 +98,10 @@ public partial class GetAzADGroup_List : global::System.Management.Automation.PS public global::System.Management.Automation.SwitchParameter Count { get => this._count; set => this._count = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -261,10 +272,34 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } - /// Intializes a new instance of the cmdlet class. + /// + /// Initializes a new instance of the cmdlet class. + /// public GetAzADGroup_List() { @@ -340,7 +375,7 @@ public GetAzADGroup_List() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -406,12 +441,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.GroupsGroupListGroup(this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */, onOk, onDefault, this, Pipeline); + await this.Client.GroupsGroupListGroup(this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null,Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?),Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null,Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?),Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* fixedArrayOf */,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -430,6 +465,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -457,14 +507,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -491,10 +541,11 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.ICollectionOfGroup + var result = (await response); // clientside pagination enabled // response should be returning an array of some kind. +Pageable // pageable / value / @odata.nextLink - var result = await response; if ((ulong)result.Value.Length <= this.PagingParameters.Skip) { this.PagingParameters.Skip = this.PagingParameters.Skip - (ulong)result.Value.Length; @@ -503,7 +554,29 @@ protected override void StopProcessing() { ulong toRead = Math.Min(this.PagingParameters.First, (ulong)result.Value.Length - this.PagingParameters.Skip); var requiredResult = result.Value.SubArray((int)this.PagingParameters.Skip, (int)toRead); - WriteObject(requiredResult, true); + if (null != requiredResult) + { + if (0 == _responseSize && 1 == requiredResult.Length) + { + _firstResponse = requiredResult[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in requiredResult ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values.ToArray(), true); + _responseSize = 2; + } + } this.PagingParameters.Skip = 0; this.PagingParameters.First = this.PagingParameters.First <= toRead ? 0 : this.PagingParameters.First - toRead; } @@ -511,7 +584,7 @@ protected override void StopProcessing() if (_isFirst) { _isFirst = false; - while (_nextLink != null && this.PagingParameters.First > 0) + while (!String.IsNullOrEmpty(_nextLink) && this.PagingParameters.First > 0) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdServicePrincipal_Get.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdServicePrincipal_Get.cs index 02dee1ce7aec..83f7a282ca43 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdServicePrincipal_Get.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdServicePrincipal_Get.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -43,6 +44,15 @@ public partial class GetAzADServicePrincipal_Get : global::System.Management.Aut /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] @@ -71,9 +81,10 @@ public partial class GetAzADServicePrincipal_Get : global::System.Management.Aut public string ConsistencyLevel { get => this._consistencyLevel; set => this._consistencyLevel = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -109,21 +120,6 @@ public partial class GetAzADServicePrincipal_Get : global::System.Management.Aut [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private string _id; - - /// key: id of servicePrincipal - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"key: id of servicePrincipal", - SerializedName = @"servicePrincipal-id", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("ServicePrincipalId")] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] - public string Id { get => this._id; set => this._id = value; } - /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -171,6 +167,20 @@ public partial class GetAzADServicePrincipal_Get : global::System.Management.Aut [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Query)] public string[] Select { get => this._select; set => this._select = value; } + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = value; } + /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior @@ -216,11 +226,33 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzADServicePrincipal_Get() { @@ -297,7 +329,7 @@ public GetAzADServicePrincipal_Get() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -363,12 +395,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ServicePrincipalsServicePrincipalGetServicePrincipal(Id, this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */, onOk, onDefault, this, Pipeline); + await this.Client.ServicePrincipalsServicePrincipalGetServicePrincipal(ServicePrincipalId, this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id,ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -387,6 +419,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -414,14 +461,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id, ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id, ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -449,7 +496,25 @@ protected override void StopProcessing() } // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdServicePrincipal_List.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdServicePrincipal_List.cs index ceb51a51fdf8..11e231055034 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdServicePrincipal_List.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdServicePrincipal_List.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -40,12 +41,21 @@ public partial class GetAzADServicePrincipal_List : global::System.Management.Au /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] @@ -88,9 +98,10 @@ public partial class GetAzADServicePrincipal_List : global::System.Management.Au public global::System.Management.Automation.SwitchParameter Count { get => this._count; set => this._count = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -261,11 +272,33 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzADServicePrincipal_List() { @@ -342,7 +375,7 @@ public GetAzADServicePrincipal_List() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -408,12 +441,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ServicePrincipalsServicePrincipalListServicePrincipal(this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */, onOk, onDefault, this, Pipeline); + await this.Client.ServicePrincipalsServicePrincipalListServicePrincipal(this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null,Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?),Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null,Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?),Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* fixedArrayOf */,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -432,6 +465,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -459,14 +507,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -493,10 +541,11 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.ICollectionOfServicePrincipal + var result = (await response); // clientside pagination enabled // response should be returning an array of some kind. +Pageable // pageable / value / @odata.nextLink - var result = await response; if ((ulong)result.Value.Length <= this.PagingParameters.Skip) { this.PagingParameters.Skip = this.PagingParameters.Skip - (ulong)result.Value.Length; @@ -505,7 +554,29 @@ protected override void StopProcessing() { ulong toRead = Math.Min(this.PagingParameters.First, (ulong)result.Value.Length - this.PagingParameters.Skip); var requiredResult = result.Value.SubArray((int)this.PagingParameters.Skip, (int)toRead); - WriteObject(requiredResult, true); + if (null != requiredResult) + { + if (0 == _responseSize && 1 == requiredResult.Length) + { + _firstResponse = requiredResult[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in requiredResult ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values.ToArray(), true); + _responseSize = 2; + } + } this.PagingParameters.Skip = 0; this.PagingParameters.First = this.PagingParameters.First <= toRead ? 0 : this.PagingParameters.First - toRead; } @@ -513,7 +584,7 @@ protected override void StopProcessing() if (_isFirst) { _isFirst = false; - while (_nextLink != null && this.PagingParameters.First > 0) + while (!String.IsNullOrEmpty(_nextLink) && this.PagingParameters.First > 0) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdUserSigned_Get.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdUserSigned_Get.cs index 21b57193ab6e..71ac475fabbe 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdUserSigned_Get.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdUserSigned_Get.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -40,6 +41,15 @@ public partial class GetAzADUserSigned_Get : global::System.Management.Automatio /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] @@ -52,9 +62,10 @@ public partial class GetAzADUserSigned_Get : global::System.Management.Automatio public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -182,11 +193,33 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzADUserSigned_Get() { @@ -263,7 +296,7 @@ public GetAzADUserSigned_Get() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -329,12 +362,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.UsersUserGetSignedInUser(this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */, onOk, onDefault, this, Pipeline); + await this.Client.UsersUserGetSignedInUser(this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -353,6 +386,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -380,14 +428,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -415,7 +463,25 @@ protected override void StopProcessing() } // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdUser_Get.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdUser_Get.cs index 699c9af18d3f..f9d9c8254927 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdUser_Get.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdUser_Get.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -40,6 +41,15 @@ public partial class GetAzADUser_Get : global::System.Management.Automation.PSCm /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] @@ -68,9 +78,10 @@ public partial class GetAzADUser_Get : global::System.Management.Automation.PSCm public string ConsistencyLevel { get => this._consistencyLevel; set => this._consistencyLevel = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -106,21 +117,6 @@ public partial class GetAzADUser_Get : global::System.Management.Automation.PSCm [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private string _id; - - /// key: id of user - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of user")] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"key: id of user", - SerializedName = @"user-id", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("UserId")] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] - public string Id { get => this._id; set => this._id = value; } - /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -168,6 +164,20 @@ public partial class GetAzADUser_Get : global::System.Management.Automation.PSCm [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Query)] public string[] Select { get => this._select; set => this._select = value; } + /// Backing field for property. + private string _userId; + + /// key: id of user + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of user")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of user", + SerializedName = @"user-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string UserId { get => this._userId; set => this._userId = value; } + /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior @@ -213,10 +223,32 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. public GetAzADUser_Get() { @@ -292,7 +324,7 @@ public GetAzADUser_Get() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -358,12 +390,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.UsersUserGetUser(Id, this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */, onOk, onDefault, this, Pipeline); + await this.Client.UsersUserGetUser(UserId, this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id,ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { UserId=UserId,ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -382,6 +414,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -409,14 +456,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id, ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id, ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -444,7 +491,25 @@ protected override void StopProcessing() } // onOk - response for 200 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdUser_List.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdUser_List.cs index 5979280c7dbc..11ec6e2e8998 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdUser_List.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/GetAzAdUser_List.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -40,12 +41,21 @@ public partial class GetAzADUser_List : global::System.Management.Automation.PSC /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] @@ -88,9 +98,10 @@ public partial class GetAzADUser_List : global::System.Management.Automation.PSC public global::System.Management.Automation.SwitchParameter Count { get => this._count; set => this._count = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -261,10 +272,32 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. public GetAzADUser_List() { @@ -340,7 +373,7 @@ public GetAzADUser_List() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -406,12 +439,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.UsersUserListUser(this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */, onOk, onDefault, this, Pipeline); + await this.Client.UsersUserListUser(this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null,Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?),Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null,Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?),Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* fixedArrayOf */,Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* fixedArrayOf */,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* fixedArrayOf */}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -430,6 +463,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -457,14 +505,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ConsistencyLevel=this.InvocationInformation.BoundParameters.ContainsKey("ConsistencyLevel") ? ConsistencyLevel : null, Search=this.InvocationInformation.BoundParameters.ContainsKey("Search") ? Search : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Count=this.InvocationInformation.BoundParameters.ContainsKey("Count") ? Count : default(global::System.Management.Automation.SwitchParameter?), Orderby=this.InvocationInformation.BoundParameters.ContainsKey("Orderby") ? Orderby : null /* arrayOf */, Select=this.InvocationInformation.BoundParameters.ContainsKey("Select") ? Select : null /* arrayOf */, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null /* arrayOf */ }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -491,10 +539,11 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.ICollectionOfUser + var result = (await response); // clientside pagination enabled // response should be returning an array of some kind. +Pageable // pageable / value / @odata.nextLink - var result = await response; if ((ulong)result.Value.Length <= this.PagingParameters.Skip) { this.PagingParameters.Skip = this.PagingParameters.Skip - (ulong)result.Value.Length; @@ -503,7 +552,29 @@ protected override void StopProcessing() { ulong toRead = Math.Min(this.PagingParameters.First, (ulong)result.Value.Length - this.PagingParameters.Skip); var requiredResult = result.Value.SubArray((int)this.PagingParameters.Skip, (int)toRead); - WriteObject(requiredResult, true); + if (null != requiredResult) + { + if (0 == _responseSize && 1 == requiredResult.Length) + { + _firstResponse = requiredResult[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in requiredResult ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values.ToArray(), true); + _responseSize = 2; + } + } this.PagingParameters.Skip = 0; this.PagingParameters.First = this.PagingParameters.First <= toRead ? 0 : this.PagingParameters.First - toRead; } @@ -511,7 +582,7 @@ protected override void StopProcessing() if (_isFirst) { _isFirst = false; - while (_nextLink != null && this.PagingParameters.First > 0) + while (!String.IsNullOrEmpty(_nextLink) && this.PagingParameters.First > 0) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADAppFederatedCredential_CreateExpanded.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADAppFederatedCredential_CreateExpanded.cs index 794c968d6a46..c3b90ba43688 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADAppFederatedCredential_CreateExpanded.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADAppFederatedCredential_CreateExpanded.cs @@ -6,17 +6,18 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; - /// Create new navigation property to federatedIdentityCredentials for applications + /// create new navigation property to federatedIdentityCredentials for applications /// /// [OpenAPI] CreateFederatedIdentityCredentials=>POST:"/applications/{application-id}/federatedIdentityCredentials" /// [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADAppFederatedCredential_CreateExpanded", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Create new navigation property to federatedIdentityCredentials for applications")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"create new navigation property to federatedIdentityCredentials for applications")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/applications/{application-id}/federatedIdentityCredentials", ApiVersion = "v1.0")] public partial class NewAzADAppFederatedCredential_CreateExpanded : global::System.Management.Automation.PSCmdlet, @@ -43,6 +44,15 @@ public partial class NewAzADAppFederatedCredential_CreateExpanded : global::Syst /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional Parameters")] public global::System.Collections.Hashtable AdditionalProperties { get; set; } @@ -75,7 +85,7 @@ public partial class NewAzADAppFederatedCredential_CreateExpanded : global::Syst Description = @"Lists the audiences that can appear in the external token. This field is mandatory, and defaults to 'api://AzureADTokenExchange'. It says what Microsoft identity platform should accept in the aud claim in the incoming token. This value represents Azure AD in your external identity provider and has no fixed value across identity providers - you may need to create a new application registration in your identity provider to serve as the audience of this token. Required.", SerializedName = @"audiences", PossibleTypes = new [] { typeof(string) })] - public string[] Audience { get => _body.Audience ?? null /* arrayOf */; set => _body.Audience = value; } + public string[] Audience { get => _body.Audience ?? null /* fixedArrayOf */; set => _body.Audience = value; } /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] @@ -89,9 +99,10 @@ public partial class NewAzADAppFederatedCredential_CreateExpanded : global::Syst public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -246,7 +257,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -319,7 +352,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -329,7 +362,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzADAppFederatedCredential_CreateExpanded() { @@ -402,7 +435,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -421,6 +454,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential @@ -441,7 +489,25 @@ protected override void StopProcessing() } // onCreated - response for 201 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -472,14 +538,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADAppFederatedCredential_CreateViaJsonFilePath.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADAppFederatedCredential_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..99c2f13feed8 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADAppFederatedCredential_CreateViaJsonFilePath.cs @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// create new navigation property to federatedIdentityCredentials for applications + /// + /// [OpenAPI] CreateFederatedIdentityCredentials=>POST:"/applications/{application-id}/federatedIdentityCredentials" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADAppFederatedCredential_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"create new navigation property to federatedIdentityCredentials for applications")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/applications/{application-id}/federatedIdentityCredentials", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class NewAzADAppFederatedCredential_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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; + + /// Backing field for property. + private string _applicationObjectId; + + /// key: id of application + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of application")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of application", + SerializedName = @"application-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ApplicationObjectId { get => this._applicationObjectId; set => this._applicationObjectId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 NewAzADAppFederatedCredential_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ApplicationsCreateFederatedIdentityCredentials' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ApplicationsCreateFederatedIdentityCredentialsViaJsonString(ApplicationObjectId, _jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADAppFederatedCredential_CreateViaJsonString.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADAppFederatedCredential_CreateViaJsonString.cs new file mode 100644 index 000000000000..f3d31dbf8d71 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADAppFederatedCredential_CreateViaJsonString.cs @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// create new navigation property to federatedIdentityCredentials for applications + /// + /// [OpenAPI] CreateFederatedIdentityCredentials=>POST:"/applications/{application-id}/federatedIdentityCredentials" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADAppFederatedCredential_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"create new navigation property to federatedIdentityCredentials for applications")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/applications/{application-id}/federatedIdentityCredentials", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class NewAzADAppFederatedCredential_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Backing field for property. + private string _applicationObjectId; + + /// key: id of application + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of application")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of application", + SerializedName = @"application-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ApplicationObjectId { get => this._applicationObjectId; set => this._applicationObjectId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 NewAzADAppFederatedCredential_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ApplicationsCreateFederatedIdentityCredentials' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ApplicationsCreateFederatedIdentityCredentialsViaJsonString(ApplicationObjectId, _jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADApplication_CreateViaJsonFilePath.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADApplication_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..338086648d77 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADApplication_CreateViaJsonFilePath.cs @@ -0,0 +1,477 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Add new entity to applications + /// + /// [OpenAPI] CreateApplication=>POST:"/applications" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADApplication_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Add new entity to applications")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/applications", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class NewAzADApplication_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 NewAzADApplication_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ApplicationsApplicationCreateApplication' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ApplicationsApplicationCreateApplicationViaJsonString(_jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADApplication_CreateViaJsonString.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADApplication_CreateViaJsonString.cs new file mode 100644 index 000000000000..d7e33b9c2cca --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADApplication_CreateViaJsonString.cs @@ -0,0 +1,475 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Add new entity to applications + /// + /// [OpenAPI] CreateApplication=>POST:"/applications" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADApplication_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Add new entity to applications")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/applications", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class NewAzADApplication_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 NewAzADApplication_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ApplicationsApplicationCreateApplication' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ApplicationsApplicationCreateApplicationViaJsonString(_jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroupGraphRefMember_Create.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroupGraphRefMember_Create.cs index 34731b6c2ed0..f41681666ae1 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroupGraphRefMember_Create.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroupGraphRefMember_Create.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -18,6 +19,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADGroupGraphRefMember_Create", SupportsShouldProcess = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PreviewMessage("This cmdlet is using API version beta which is under preview.")] [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"UMembers of this group, who can be users, devices, other groups, or service principals. Supports the List members, Add member, and Remove member operations. Nullable. Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=members($select=id,userPrincipalName,displayName).")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] @@ -43,6 +45,15 @@ public partial class NewAzADGroupGraphRefMember_Create : global::System.Manageme /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.IDictionaryOfany _body; @@ -70,9 +81,10 @@ public partial class NewAzADGroupGraphRefMember_Create : global::System.Manageme public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -189,7 +201,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -262,7 +296,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -272,7 +306,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzADGroupGraphRefMember_Create() { @@ -344,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId,body=Body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -363,6 +397,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -390,14 +439,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId, body=Body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId, body=Body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroupGraphRefMember_CreateExpanded.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroupGraphRefMember_CreateExpanded.cs index a924b4df06b8..22c61c71fa09 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroupGraphRefMember_CreateExpanded.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroupGraphRefMember_CreateExpanded.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -18,6 +19,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADGroupGraphRefMember_CreateExpanded", SupportsShouldProcess = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PreviewMessage("This cmdlet is using API version beta which is under preview.")] [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"UMembers of this group, who can be users, devices, other groups, or service principals. Supports the List members, Add member, and Remove member operations. Nullable. Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=members($select=id,userPrincipalName,displayName).")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] @@ -46,6 +48,15 @@ public partial class NewAzADGroupGraphRefMember_CreateExpanded : global::System. /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional Parameters")] public global::System.Collections.Hashtable AdditionalProperties { get; set; } @@ -61,9 +72,10 @@ public partial class NewAzADGroupGraphRefMember_CreateExpanded : global::System. public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -180,7 +192,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -253,7 +287,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -263,7 +297,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzADGroupGraphRefMember_CreateExpanded() { @@ -336,7 +370,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -355,6 +389,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -382,14 +431,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroupGraphRefMember_CreateViaJsonFilePath.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroupGraphRefMember_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..b310c16d8476 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroupGraphRefMember_CreateViaJsonFilePath.cs @@ -0,0 +1,482 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// + /// UMembers of this group, who can be users, devices, other groups, or service principals. Supports the List members, Add + /// member, and Remove member operations. Nullable. Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=members($select=id,userPrincipalName,displayName). + /// + /// + /// [OpenAPI] CreateGraphRefMembers=>POST:"/groups/{group-id}/members/$ref" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADGroupGraphRefMember_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PreviewMessage("This cmdlet is using API version beta which is under preview.")] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"UMembers of this group, who can be users, devices, other groups, or service principals. Supports the List members, Add member, and Remove member operations. Nullable. Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=members($select=id,userPrincipalName,displayName).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/groups/{group-id}/members/$ref", ApiVersion = "v1.0-beta")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class NewAzADGroupGraphRefMember_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// Backing field for property. + private string _groupId; + + /// key: id of group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of group")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of group", + SerializedName = @"group-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string GroupId { get => this._groupId; set => this._groupId = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 NewAzADGroupGraphRefMember_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'GroupsCreateGraphRefMembers' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.GroupsCreateGraphRefMembersViaJsonString(GroupId, _jsonString, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroupGraphRefMember_CreateViaJsonString.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroupGraphRefMember_CreateViaJsonString.cs new file mode 100644 index 000000000000..dbf7f945efaf --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroupGraphRefMember_CreateViaJsonString.cs @@ -0,0 +1,480 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// + /// UMembers of this group, who can be users, devices, other groups, or service principals. Supports the List members, Add + /// member, and Remove member operations. Nullable. Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=members($select=id,userPrincipalName,displayName). + /// + /// + /// [OpenAPI] CreateGraphRefMembers=>POST:"/groups/{group-id}/members/$ref" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADGroupGraphRefMember_CreateViaJsonString", SupportsShouldProcess = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PreviewMessage("This cmdlet is using API version beta which is under preview.")] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"UMembers of this group, who can be users, devices, other groups, or service principals. Supports the List members, Add member, and Remove member operations. Nullable. Supports $expand including nested $select. For example, /groups?$filter=startsWith(displayName,'Role')&$select=id,displayName&$expand=members($select=id,userPrincipalName,displayName).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/groups/{group-id}/members/$ref", ApiVersion = "v1.0-beta")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class NewAzADGroupGraphRefMember_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// Backing field for property. + private string _groupId; + + /// key: id of group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of group")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of group", + SerializedName = @"group-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string GroupId { get => this._groupId; set => this._groupId = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 NewAzADGroupGraphRefMember_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'GroupsCreateGraphRefMembers' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.GroupsCreateGraphRefMembersViaJsonString(GroupId, _jsonString, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroupOwnerGraphBPreRef_CreateExpanded.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroupOwnerGraphBPreRef_CreateExpanded.cs index e3fc078fbd08..30204135e6f4 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroupOwnerGraphBPreRef_CreateExpanded.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroupOwnerGraphBPreRef_CreateExpanded.cs @@ -6,17 +6,18 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; - /// Create new navigation property ref to owners for groups + /// create new navigation property ref to owners for groups /// /// [OpenAPI] CreateOwnersGraphBPreRef=>POST:"/groups/{group-id}/owners/$ref" /// [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADGroupOwnerGraphBPreRef_CreateExpanded", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Create new navigation property ref to owners for groups")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"create new navigation property ref to owners for groups")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/groups/{group-id}/owners/$ref", ApiVersion = "v1.0")] public partial class NewAzADGroupOwnerGraphBPreRef_CreateExpanded : global::System.Management.Automation.PSCmdlet, @@ -42,6 +43,15 @@ public partial class NewAzADGroupOwnerGraphBPreRef_CreateExpanded : global::Syst /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional Parameters")] public global::System.Collections.Hashtable AdditionalProperties { get; set; } @@ -57,9 +67,10 @@ public partial class NewAzADGroupOwnerGraphBPreRef_CreateExpanded : global::Syst public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -187,7 +198,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -260,7 +293,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -270,7 +303,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzADGroupOwnerGraphBPreRef_CreateExpanded() { @@ -343,7 +376,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -362,6 +395,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -389,14 +437,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroup_CreateViaJsonFilePath.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroup_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..8cd0ca183541 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroup_CreateViaJsonFilePath.cs @@ -0,0 +1,477 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Add new entity to groups + /// + /// [OpenAPI] CreateGroup=>POST:"/groups" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADGroup_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Add new entity to groups")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/groups", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class NewAzADGroup_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 NewAzADGroup_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'GroupsGroupCreateGroup' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.GroupsGroupCreateGroupViaJsonString(_jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroup_CreateViaJsonString.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroup_CreateViaJsonString.cs new file mode 100644 index 000000000000..6b6edd652c0b --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADGroup_CreateViaJsonString.cs @@ -0,0 +1,475 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Add new entity to groups + /// + /// [OpenAPI] CreateGroup=>POST:"/groups" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADGroup_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Add new entity to groups")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/groups", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class NewAzADGroup_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 NewAzADGroup_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'GroupsGroupCreateGroup' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.GroupsGroupCreateGroupViaJsonString(_jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADOrganization_Create.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADOrganization_Create.cs index 2295f5654c6e..8008cd812c7c 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADOrganization_Create.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADOrganization_Create.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -40,6 +41,15 @@ public partial class NewAzADOrganization_Create : global::System.Management.Auto /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganization _body; @@ -66,9 +76,10 @@ public partial class NewAzADOrganization_Create : global::System.Management.Auto public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -166,7 +177,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -239,7 +272,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -249,7 +282,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzADOrganization_Create() { @@ -321,7 +354,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 } }); @@ -340,6 +373,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganization @@ -360,7 +408,25 @@ protected override void StopProcessing() } // onCreated - response for 201 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganization - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -391,14 +457,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADOrganization_CreateExpanded.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADOrganization_CreateExpanded.cs index eadde3e1c9ea..d8f9d19c2930 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADOrganization_CreateExpanded.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADOrganization_CreateExpanded.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -43,6 +44,15 @@ public partial class NewAzADOrganization_CreateExpanded : global::System.Managem /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional Parameters")] public global::System.Collections.Hashtable AdditionalProperties { get; set; } @@ -56,7 +66,7 @@ public partial class NewAzADOrganization_CreateExpanded : global::System.Managem Description = @"The collection of service plans associated with the tenant. Not nullable.", SerializedName = @"assignedPlans", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAssignedPlan) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAssignedPlan[] AssignedPlan { get => _body.AssignedPlan ?? null /* arrayOf */; set => _body.AssignedPlan = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAssignedPlan[] AssignedPlan { get => _body.AssignedPlan ?? null /* fixedArrayOf */; set => _body.AssignedPlan = value; } /// organizationalBranding [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "organizationalBranding")] @@ -86,7 +96,7 @@ public partial class NewAzADOrganization_CreateExpanded : global::System.Managem Description = @"Telephone number for the organization. Although this is a string collection, only one number can be set for this property.", SerializedName = @"businessPhones", PossibleTypes = new [] { typeof(string) })] - public string[] BusinessPhone { get => _body.BusinessPhone ?? null /* arrayOf */; set => _body.BusinessPhone = value; } + public string[] BusinessPhone { get => _body.BusinessPhone ?? null /* fixedArrayOf */; set => _body.BusinessPhone = value; } /// Accessor for cancellationTokenSource. public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } @@ -104,7 +114,7 @@ public partial class NewAzADOrganization_CreateExpanded : global::System.Managem Description = @"Navigation property to manage certificate-based authentication configuration. Only a single instance of certificateBasedAuthConfiguration can be created in the collection.", SerializedName = @"certificateBasedAuthConfiguration", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphCertificateBasedAuthConfiguration) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphCertificateBasedAuthConfiguration[] CertificateBasedAuthConfiguration { get => _body.CertificateBasedAuthConfiguration ?? null /* arrayOf */; set => _body.CertificateBasedAuthConfiguration = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphCertificateBasedAuthConfiguration[] CertificateBasedAuthConfiguration { get => _body.CertificateBasedAuthConfiguration ?? null /* fixedArrayOf */; set => _body.CertificateBasedAuthConfiguration = value; } /// City name of the address for the organization. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "City name of the address for the organization.")] @@ -158,9 +168,10 @@ public partial class NewAzADOrganization_CreateExpanded : global::System.Managem public global::System.DateTime CreatedDateTime { get => _body.CreatedDateTime ?? default(global::System.DateTime); set => _body.CreatedDateTime = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -203,7 +214,7 @@ public partial class NewAzADOrganization_CreateExpanded : global::System.Managem Description = @"The collection of open extensions defined for the organization. Read-only. Nullable.", SerializedName = @"extensions", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphExtension) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphExtension[] Extension { get => _body.Extension ?? null /* arrayOf */; set => _body.Extension = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphExtension[] Extension { get => _body.Extension ?? null /* fixedArrayOf */; set => _body.Extension = value; } /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] @@ -230,7 +241,7 @@ public partial class NewAzADOrganization_CreateExpanded : global::System.Managem Description = @"Not nullable.", SerializedName = @"marketingNotificationEmails", PossibleTypes = new [] { typeof(string) })] - public string[] MarketingNotificationEmail { get => _body.MarketingNotificationEmail ?? null /* arrayOf */; set => _body.MarketingNotificationEmail = value; } + public string[] MarketingNotificationEmail { get => _body.MarketingNotificationEmail ?? null /* fixedArrayOf */; set => _body.MarketingNotificationEmail = value; } /// /// cancellation delegate. Stops the cmdlet when called. @@ -248,9 +259,9 @@ public partial class NewAzADOrganization_CreateExpanded : global::System.Managem ReadOnly = false, Description = @"Mobile device management authority.", SerializedName = @"mobileDeviceManagementAuthority", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority))] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority MobileDeviceManagementAuthority { get => _body.MobileDeviceManagementAuthority ?? ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority)""); set => _body.MobileDeviceManagementAuthority = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PSArgumentCompleterAttribute("unknown", "intune", "sccm", "office365")] + public string MobileDeviceManagementAuthority { get => _body.MobileDeviceManagementAuthority ?? null; set => _body.MobileDeviceManagementAuthority = value; } /// /// The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date @@ -331,7 +342,7 @@ public partial class NewAzADOrganization_CreateExpanded : global::System.Managem Description = @"Not nullable.", SerializedName = @"provisionedPlans", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphProvisionedPlan) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphProvisionedPlan[] ProvisionedPlan { get => _body.ProvisionedPlan ?? null /* arrayOf */; set => _body.ProvisionedPlan = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphProvisionedPlan[] ProvisionedPlan { get => _body.ProvisionedPlan ?? null /* fixedArrayOf */; set => _body.ProvisionedPlan = value; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -359,7 +370,7 @@ public partial class NewAzADOrganization_CreateExpanded : global::System.Managem Description = @".", SerializedName = @"securityComplianceNotificationMails", PossibleTypes = new [] { typeof(string) })] - public string[] SecurityComplianceNotificationMail { get => _body.SecurityComplianceNotificationMail ?? null /* arrayOf */; set => _body.SecurityComplianceNotificationMail = value; } + public string[] SecurityComplianceNotificationMail { get => _body.SecurityComplianceNotificationMail ?? null /* fixedArrayOf */; set => _body.SecurityComplianceNotificationMail = value; } /// . [global::System.Management.Automation.AllowEmptyCollection] @@ -371,7 +382,7 @@ public partial class NewAzADOrganization_CreateExpanded : global::System.Managem Description = @".", SerializedName = @"securityComplianceNotificationPhones", PossibleTypes = new [] { typeof(string) })] - public string[] SecurityComplianceNotificationPhone { get => _body.SecurityComplianceNotificationPhone ?? null /* arrayOf */; set => _body.SecurityComplianceNotificationPhone = value; } + public string[] SecurityComplianceNotificationPhone { get => _body.SecurityComplianceNotificationPhone ?? null /* fixedArrayOf */; set => _body.SecurityComplianceNotificationPhone = value; } /// State name of the address for the organization. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "State name of the address for the organization.")] @@ -405,7 +416,7 @@ public partial class NewAzADOrganization_CreateExpanded : global::System.Managem Description = @"Not nullable.", SerializedName = @"technicalNotificationMails", PossibleTypes = new [] { typeof(string) })] - public string[] TechnicalNotificationMail { get => _body.TechnicalNotificationMail ?? null /* arrayOf */; set => _body.TechnicalNotificationMail = value; } + public string[] TechnicalNotificationMail { get => _body.TechnicalNotificationMail ?? null /* fixedArrayOf */; set => _body.TechnicalNotificationMail = value; } /// . [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] @@ -428,7 +439,7 @@ public partial class NewAzADOrganization_CreateExpanded : global::System.Managem Description = @"The collection of domains associated with this tenant. Not nullable.", SerializedName = @"verifiedDomains", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphVerifiedDomain) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphVerifiedDomain[] VerifiedDomain { get => _body.VerifiedDomain ?? null /* arrayOf */; set => _body.VerifiedDomain = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphVerifiedDomain[] VerifiedDomain { get => _body.VerifiedDomain ?? null /* fixedArrayOf */; set => _body.VerifiedDomain = value; } /// /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what @@ -475,7 +486,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -548,7 +581,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -558,7 +591,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzADOrganization_CreateExpanded() { @@ -631,7 +664,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 } }); @@ -650,6 +683,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganization @@ -670,7 +718,25 @@ protected override void StopProcessing() } // onCreated - response for 201 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganization - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -701,14 +767,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADOrganization_CreateViaJsonFilePath.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADOrganization_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..4efc5320ba50 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADOrganization_CreateViaJsonFilePath.cs @@ -0,0 +1,477 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Add new entity to organization + /// + /// [OpenAPI] CreateOrganization=>POST:"/organization" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADOrganization_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganization))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Add new entity to organization")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/organization", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class NewAzADOrganization_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganization + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphODataErrorsOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 NewAzADOrganization_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'OrganizationCreateOrganization' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OrganizationCreateOrganizationViaJsonString(_jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganization + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganization + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphODataErrorsOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADOrganization_CreateViaJsonString.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADOrganization_CreateViaJsonString.cs new file mode 100644 index 000000000000..2c18c614f8a6 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADOrganization_CreateViaJsonString.cs @@ -0,0 +1,475 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Add new entity to organization + /// + /// [OpenAPI] CreateOrganization=>POST:"/organization" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADOrganization_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganization))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Add new entity to organization")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/organization", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class NewAzADOrganization_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganization + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphODataErrorsOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 NewAzADOrganization_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'OrganizationCreateOrganization' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OrganizationCreateOrganizationViaJsonString(_jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganization + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganization + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphODataErrorsOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipalAppRoleAssignment_Create.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipalAppRoleAssignment_Create.cs index b44513dde080..58d25b3d37bd 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipalAppRoleAssignment_Create.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipalAppRoleAssignment_Create.cs @@ -6,17 +6,18 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; - /// Create new navigation property to appRoleAssignments for servicePrincipals + /// create new navigation property to appRoleAssignments for servicePrincipals /// /// [OpenAPI] CreateAppRoleAssignments=>POST:"/servicePrincipals/{servicePrincipal-id}/appRoleAssignments" /// [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADServicePrincipalAppRoleAssignment_Create", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Create new navigation property to appRoleAssignments for servicePrincipals")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"create new navigation property to appRoleAssignments for servicePrincipals")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}/appRoleAssignments", ApiVersion = "v1.0")] public partial class NewAzADServicePrincipalAppRoleAssignment_Create : global::System.Management.Automation.PSCmdlet, @@ -40,6 +41,15 @@ public partial class NewAzADServicePrincipalAppRoleAssignment_Create : global::S /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment _body; @@ -69,9 +79,10 @@ public partial class NewAzADServicePrincipalAppRoleAssignment_Create : global::S public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -183,7 +194,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -256,7 +289,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -266,7 +299,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzADServicePrincipalAppRoleAssignment_Create() { @@ -338,7 +371,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,body=Body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -357,6 +390,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment @@ -377,7 +425,25 @@ protected override void StopProcessing() } // onCreated - response for 201 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -408,14 +474,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, body=Body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, body=Body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipalAppRoleAssignment_CreateExpanded.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipalAppRoleAssignment_CreateExpanded.cs index 49b708bad89c..28da4a509ed0 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipalAppRoleAssignment_CreateExpanded.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipalAppRoleAssignment_CreateExpanded.cs @@ -6,17 +6,18 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; - /// Create new navigation property to appRoleAssignments for servicePrincipals + /// create new navigation property to appRoleAssignments for servicePrincipals /// /// [OpenAPI] CreateAppRoleAssignments=>POST:"/servicePrincipals/{servicePrincipal-id}/appRoleAssignments" /// [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADServicePrincipalAppRoleAssignment_CreateExpanded", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Create new navigation property to appRoleAssignments for servicePrincipals")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"create new navigation property to appRoleAssignments for servicePrincipals")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}/appRoleAssignments", ApiVersion = "v1.0")] public partial class NewAzADServicePrincipalAppRoleAssignment_CreateExpanded : global::System.Management.Automation.PSCmdlet, @@ -46,6 +47,15 @@ public partial class NewAzADServicePrincipalAppRoleAssignment_CreateExpanded : g /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional Parameters")] public global::System.Collections.Hashtable AdditionalProperties { get; set; } @@ -77,9 +87,10 @@ public partial class NewAzADServicePrincipalAppRoleAssignment_CreateExpanded : g public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -254,7 +265,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -327,7 +360,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -337,7 +370,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzADServicePrincipalAppRoleAssignment_CreateExpanded() { @@ -414,7 +447,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -433,6 +466,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment @@ -453,7 +501,25 @@ protected override void StopProcessing() } // onCreated - response for 201 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -484,14 +550,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipalAppRoleAssignment_CreateViaJsonFilePath.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipalAppRoleAssignment_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..671f3612b575 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipalAppRoleAssignment_CreateViaJsonFilePath.cs @@ -0,0 +1,492 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// create new navigation property to appRoleAssignments for servicePrincipals + /// + /// [OpenAPI] CreateAppRoleAssignments=>POST:"/servicePrincipals/{servicePrincipal-id}/appRoleAssignments" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADServicePrincipalAppRoleAssignment_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"create new navigation property to appRoleAssignments for servicePrincipals")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}/appRoleAssignments", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class NewAzADServicePrincipalAppRoleAssignment_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 NewAzADServicePrincipalAppRoleAssignment_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicePrincipalsCreateAppRoleAssignments' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsCreateAppRoleAssignmentsViaJsonString(ServicePrincipalId, _jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipalAppRoleAssignment_CreateViaJsonString.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipalAppRoleAssignment_CreateViaJsonString.cs new file mode 100644 index 000000000000..6d61eb8758b5 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipalAppRoleAssignment_CreateViaJsonString.cs @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// create new navigation property to appRoleAssignments for servicePrincipals + /// + /// [OpenAPI] CreateAppRoleAssignments=>POST:"/servicePrincipals/{servicePrincipal-id}/appRoleAssignments" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADServicePrincipalAppRoleAssignment_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"create new navigation property to appRoleAssignments for servicePrincipals")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}/appRoleAssignments", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class NewAzADServicePrincipalAppRoleAssignment_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 NewAzADServicePrincipalAppRoleAssignment_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicePrincipalsCreateAppRoleAssignments' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsCreateAppRoleAssignmentsViaJsonString(ServicePrincipalId, _jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipal_CreateViaJsonFilePath.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipal_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..d0d22154f0e1 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipal_CreateViaJsonFilePath.cs @@ -0,0 +1,477 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Add new entity to servicePrincipals + /// + /// [OpenAPI] CreateServicePrincipal=>POST:"/servicePrincipals" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADServicePrincipal_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Add new entity to servicePrincipals")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class NewAzADServicePrincipal_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 NewAzADServicePrincipal_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicePrincipalsServicePrincipalCreateServicePrincipal' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsServicePrincipalCreateServicePrincipalViaJsonString(_jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipal_CreateViaJsonString.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipal_CreateViaJsonString.cs new file mode 100644 index 000000000000..c50939059f97 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADServicePrincipal_CreateViaJsonString.cs @@ -0,0 +1,475 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Add new entity to servicePrincipals + /// + /// [OpenAPI] CreateServicePrincipal=>POST:"/servicePrincipals" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADServicePrincipal_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Add new entity to servicePrincipals")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class NewAzADServicePrincipal_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 NewAzADServicePrincipal_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicePrincipalsServicePrincipalCreateServicePrincipal' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsServicePrincipalCreateServicePrincipalViaJsonString(_jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADUser_CreateViaJsonFilePath.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADUser_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..7342d41379b7 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADUser_CreateViaJsonFilePath.cs @@ -0,0 +1,477 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Add new entity to users + /// + /// [OpenAPI] CreateUser=>POST:"/users" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADUser_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Add new entity to users")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/users", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class NewAzADUser_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 NewAzADUser_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'UsersUserCreateUser' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.UsersUserCreateUserViaJsonString(_jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADUser_CreateViaJsonString.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADUser_CreateViaJsonString.cs new file mode 100644 index 000000000000..9580ffef4261 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzADUser_CreateViaJsonString.cs @@ -0,0 +1,475 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Add new entity to users + /// + /// [OpenAPI] CreateUser=>POST:"/users" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzADUser_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Add new entity to users")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/users", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class NewAzADUser_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 NewAzADUser_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'UsersUserCreateUser' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.UsersUserCreateUserViaJsonString(_jsonString, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzAdApplication_CreateExpanded.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzAdApplication_CreateExpanded.cs index bbb84241ef1c..b6a44dd39ea3 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzAdApplication_CreateExpanded.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzAdApplication_CreateExpanded.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -46,6 +47,15 @@ public partial class NewAzADApplication_CreateExpanded : global::System.Manageme /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// /// Defines custom behavior that a consuming service can use to call an app in specific contexts. For example, applications /// that can render file streams may set the addIns property for its 'FileHandler' functionality. This will let services like @@ -60,7 +70,7 @@ public partial class NewAzADApplication_CreateExpanded : global::System.Manageme Description = @"Defines custom behavior that a consuming service can use to call an app in specific contexts. For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. This will let services like Office 365 call the application in the context of a document the user is working on.", SerializedName = @"addIns", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn[] AddIn { get => _body.AddIn ?? null /* arrayOf */; set => _body.AddIn = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn[] AddIn { get => _body.AddIn ?? null /* fixedArrayOf */; set => _body.AddIn = value; } [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional Parameters")] public global::System.Collections.Hashtable AdditionalProperties { get; set; } @@ -89,7 +99,7 @@ public partial class NewAzADApplication_CreateExpanded : global::System.Manageme Description = @"The collection of roles assigned to the application. With app role assignments, these roles can be assigned to users, groups, or service principals associated with other applications. Not nullable.", SerializedName = @"appRoles", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole[] AppRole { get => _body.AppRole ?? null /* arrayOf */; set => _body.AppRole = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole[] AppRole { get => _body.AppRole ?? null /* fixedArrayOf */; set => _body.AppRole = value; } /// Unique identifier of the applicationTemplate. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Unique identifier of the applicationTemplate.")] @@ -136,9 +146,10 @@ public partial class NewAzADApplication_CreateExpanded : global::System.Manageme public string CreatedOnBehalfOfDisplayName { get => _body.CreatedOnBehalfOfDisplayName ?? null; set => _body.CreatedOnBehalfOfDisplayName = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -210,7 +221,7 @@ public partial class NewAzADApplication_CreateExpanded : global::System.Manageme Description = @"Federated identities for applications. Supports $expand and $filter (eq when counting empty collections).", SerializedName = @"federatedIdentityCredentials", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential[] FederatedIdentityCredentials { get => _body.FederatedIdentityCredentials ?? null /* arrayOf */; set => _body.FederatedIdentityCredentials = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential[] FederatedIdentityCredentials { get => _body.FederatedIdentityCredentials ?? null /* fixedArrayOf */; set => _body.FederatedIdentityCredentials = value; } /// /// Configures the groups claim issued in a user or OAuth 2.0 access token that the application expects. To set this attribute, @@ -237,7 +248,7 @@ public partial class NewAzADApplication_CreateExpanded : global::System.Manageme Description = @".", SerializedName = @"homeRealmDiscoveryPolicies", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy[] HomeRealmDiscoveryPolicy { get => _body.HomeRealmDiscoveryPolicy ?? null /* arrayOf */; set => _body.HomeRealmDiscoveryPolicy = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy[] HomeRealmDiscoveryPolicy { get => _body.HomeRealmDiscoveryPolicy ?? null /* fixedArrayOf */; set => _body.HomeRealmDiscoveryPolicy = value; } /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] @@ -265,7 +276,7 @@ public partial class NewAzADApplication_CreateExpanded : global::System.Manageme Description = @"The URIs that identify the application within its Azure AD tenant, or within a verified custom domain if the application is multi-tenant. For more information, see Application Objects and Service Principal Objects. The any operator is required for filter expressions on multi-valued properties. Not nullable. Supports $filter (eq, ne, ge, le, startsWith).", SerializedName = @"identifierUris", PossibleTypes = new [] { typeof(string) })] - public string[] IdentifierUri { get => _body.IdentifierUri ?? null /* arrayOf */; set => _body.IdentifierUri = value; } + public string[] IdentifierUri { get => _body.IdentifierUri ?? null /* fixedArrayOf */; set => _body.IdentifierUri = value; } /// informationalUrl [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "informationalUrl")] @@ -323,7 +334,7 @@ public partial class NewAzADApplication_CreateExpanded : global::System.Manageme Description = @"The collection of key credentials associated with the application. Not nullable. Supports $filter (eq, NOT, ge, le).", SerializedName = @"keyCredentials", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential[] KeyCredentials { get => _body.KeyCredentials ?? null /* arrayOf */; set => _body.KeyCredentials = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential[] KeyCredentials { get => _body.KeyCredentials ?? null /* fixedArrayOf */; set => _body.KeyCredentials = value; } /// The main logo for the application. Not nullable. internal byte[] Logo { get => _body.Logo ?? null /* byte array */; set => _body.Logo = value; } @@ -412,7 +423,7 @@ public string LogoInputFile Description = @"The collection of password credentials associated with the application. Not nullable.", SerializedName = @"passwordCredentials", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential[] PasswordCredentials { get => _body.PasswordCredentials ?? null /* arrayOf */; set => _body.PasswordCredentials = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential[] PasswordCredentials { get => _body.PasswordCredentials ?? null /* fixedArrayOf */; set => _body.PasswordCredentials = value; } /// /// The instance of the that the remote call will use. @@ -460,7 +471,7 @@ public string LogoInputFile Description = @"Specifies the resources that the application needs to access. This property also specifies the set of OAuth permission scopes and application roles that it needs for each of those resources. This configuration of access to the required resources drives the consent experience. Not nullable. Supports $filter (eq, NOT, ge, le).", SerializedName = @"requiredResourceAccess", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphRequiredResourceAccess) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphRequiredResourceAccess[] RequiredResourceAccess { get => _body.RequiredResourceAccess ?? null /* arrayOf */; set => _body.RequiredResourceAccess = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphRequiredResourceAccess[] RequiredResourceAccess { get => _body.RequiredResourceAccess ?? null /* fixedArrayOf */; set => _body.RequiredResourceAccess = value; } /// /// References application or service contact information from a Service or Asset Management database. Nullable. @@ -513,7 +524,7 @@ public string LogoInputFile Description = @"Custom strings that can be used to categorize and identify the application. Not nullable.Supports $filter (eq, NOT, ge, le, startsWith).", SerializedName = @"tags", PossibleTypes = new [] { typeof(string) })] - public string[] Tag { get => _body.Tag ?? null /* arrayOf */; set => _body.Tag = value; } + public string[] Tag { get => _body.Tag ?? null /* fixedArrayOf */; set => _body.Tag = value; } /// /// Specifies the keyId of a public key from the keyCredentials collection. When configured, Azure AD encrypts all the tokens @@ -540,7 +551,7 @@ public string LogoInputFile Description = @".", SerializedName = @"tokenIssuancePolicies", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy[] TokenIssuancePolicy { get => _body.TokenIssuancePolicy ?? null /* arrayOf */; set => _body.TokenIssuancePolicy = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy[] TokenIssuancePolicy { get => _body.TokenIssuancePolicy ?? null /* fixedArrayOf */; set => _body.TokenIssuancePolicy = value; } /// The tokenLifetimePolicies assigned to this application. Supports $expand. [global::System.Management.Automation.AllowEmptyCollection] @@ -552,7 +563,7 @@ public string LogoInputFile Description = @"The tokenLifetimePolicies assigned to this application. Supports $expand.", SerializedName = @"tokenLifetimePolicies", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy[] TokenLifetimePolicy { get => _body.TokenLifetimePolicy ?? null /* arrayOf */; set => _body.TokenLifetimePolicy = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy[] TokenLifetimePolicy { get => _body.TokenLifetimePolicy ?? null /* fixedArrayOf */; set => _body.TokenLifetimePolicy = value; } /// webApplication [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "webApplication")] @@ -610,7 +621,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -683,7 +716,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -693,7 +726,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzADApplication_CreateExpanded() { @@ -766,7 +799,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 } }); @@ -785,6 +818,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication @@ -805,7 +853,25 @@ protected override void StopProcessing() } // onCreated - response for 201 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -836,14 +902,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzAdGroup_CreateExpanded.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzAdGroup_CreateExpanded.cs index 7347b5ff3f63..b809b4b18d80 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzAdGroup_CreateExpanded.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzAdGroup_CreateExpanded.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -46,6 +47,15 @@ public partial class NewAzADGroup_CreateExpanded : global::System.Management.Aut /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional Parameters")] public global::System.Collections.Hashtable AdditionalProperties { get; set; } @@ -61,7 +71,7 @@ public partial class NewAzADGroup_CreateExpanded : global::System.Management.Aut Description = @"Represents the app roles a group has been granted for an application. Supports $expand.", SerializedName = @"appRoleAssignments", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentAutoGenerated) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentAutoGenerated[] AppRoleAssignment { get => _body.AppRoleAssignment ?? null /* arrayOf */; set => _body.AppRoleAssignment = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentAutoGenerated[] AppRoleAssignment { get => _body.AppRoleAssignment ?? null /* fixedArrayOf */; set => _body.AppRoleAssignment = value; } /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] @@ -104,9 +114,10 @@ public partial class NewAzADGroup_CreateExpanded : global::System.Management.Aut public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject CreatedOnBehalfOf { get => _body.CreatedOnBehalfOf ?? null /* object */; set => _body.CreatedOnBehalfOf = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -164,7 +175,7 @@ public partial class NewAzADGroup_CreateExpanded : global::System.Management.Aut Description = @"Specifies the group type and its membership. If the collection contains Unified, the group is a Microsoft 365 group; otherwise, it's either a security group or distribution group. For details, see groups overview.If the collection includes DynamicMembership, the group has dynamic membership; otherwise, membership is static. Returned by default. Supports $filter (eq, NOT).", SerializedName = @"groupTypes", PossibleTypes = new [] { typeof(string) })] - public string[] GroupType { get => _body.GroupType ?? null /* arrayOf */; set => _body.GroupType = value; } + public string[] GroupType { get => _body.GroupType ?? null /* fixedArrayOf */; set => _body.GroupType = value; } /// /// Indicates whether there are members in this group that have license errors from its group-based license assignment. This @@ -302,7 +313,7 @@ public partial class NewAzADGroup_CreateExpanded : global::System.Management.Aut Description = @"The permissions that have been granted for a group to a specific application. Supports $expand.", SerializedName = @"permissionGrants", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphResourceSpecificPermissionGrant) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphResourceSpecificPermissionGrant[] PermissionGrant { get => _body.PermissionGrant ?? null /* arrayOf */; set => _body.PermissionGrant = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphResourceSpecificPermissionGrant[] PermissionGrant { get => _body.PermissionGrant ?? null /* fixedArrayOf */; set => _body.PermissionGrant = value; } /// /// The instance of the that the remote call will use. @@ -454,7 +465,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -527,7 +560,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -537,7 +570,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzADGroup_CreateExpanded() { @@ -610,7 +643,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 } }); @@ -629,6 +662,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup @@ -649,7 +697,25 @@ protected override void StopProcessing() } // onCreated - response for 201 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -680,14 +746,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzAdServicePrincipal_CreateExpanded.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzAdServicePrincipal_CreateExpanded.cs index 1ed75434d7e2..c61ded24334d 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzAdServicePrincipal_CreateExpanded.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzAdServicePrincipal_CreateExpanded.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -46,6 +47,15 @@ public partial class NewAzADServicePrincipal_CreateExpanded : global::System.Man /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// /// true if the service principal account is enabled; otherwise, false. Supports $filter (eq, ne, NOT, in). /// @@ -73,7 +83,7 @@ public partial class NewAzADServicePrincipal_CreateExpanded : global::System.Man Description = @"Defines custom behavior that a consuming service can use to call an app in specific contexts. For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. This will let services like Microsoft 365 call the application in the context of a document the user is working on.", SerializedName = @"addIns", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn[] AddIn { get => _body.AddIn ?? null /* arrayOf */; set => _body.AddIn = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn[] AddIn { get => _body.AddIn ?? null /* fixedArrayOf */; set => _body.AddIn = value; } [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional Parameters")] public global::System.Collections.Hashtable AdditionalProperties { get; set; } @@ -91,7 +101,7 @@ public partial class NewAzADServicePrincipal_CreateExpanded : global::System.Man Description = @"Used to retrieve service principals by subscription, identify resource group and full resource ids for managed identities. Supports $filter (eq, NOT, ge, le, startsWith).", SerializedName = @"alternativeNames", PossibleTypes = new [] { typeof(string) })] - public string[] AlternativeName { get => _body.AlternativeName ?? null /* arrayOf */; set => _body.AlternativeName = value; } + public string[] AlternativeName { get => _body.AlternativeName ?? null /* fixedArrayOf */; set => _body.AlternativeName = value; } /// The description exposed by the associated application. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The description exposed by the associated application.")] @@ -153,7 +163,7 @@ public partial class NewAzADServicePrincipal_CreateExpanded : global::System.Man Description = @"The roles exposed by the application which this service principal represents. For more information see the appRoles property definition on the application entity. Not nullable.", SerializedName = @"appRoles", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole[] AppRole { get => _body.AppRole ?? null /* arrayOf */; set => _body.AppRole = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole[] AppRole { get => _body.AppRole ?? null /* fixedArrayOf */; set => _body.AppRole = value; } /// /// App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. @@ -167,7 +177,7 @@ public partial class NewAzADServicePrincipal_CreateExpanded : global::System.Man Description = @"App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand.", SerializedName = @"appRoleAssignedTo", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment[] AppRoleAssignedTo { get => _body.AppRoleAssignedTo ?? null /* arrayOf */; set => _body.AppRoleAssignedTo = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment[] AppRoleAssignedTo { get => _body.AppRoleAssignedTo ?? null /* fixedArrayOf */; set => _body.AppRoleAssignedTo = value; } /// /// App role assignment for another app or service, granted to this service principal. Supports $expand. @@ -181,7 +191,7 @@ public partial class NewAzADServicePrincipal_CreateExpanded : global::System.Man Description = @"App role assignment for another app or service, granted to this service principal. Supports $expand.", SerializedName = @"appRoleAssignments", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment[] AppRoleAssignment { get => _body.AppRoleAssignment ?? null /* arrayOf */; set => _body.AppRoleAssignment = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment[] AppRoleAssignment { get => _body.AppRoleAssignment ?? null /* fixedArrayOf */; set => _body.AppRoleAssignment = value; } /// /// Specifies whether users or other service principals need to be granted an app role assignment for this service principal @@ -215,15 +225,16 @@ public partial class NewAzADServicePrincipal_CreateExpanded : global::System.Man Description = @"The claimsMappingPolicies assigned to this service principal. Supports $expand.", SerializedName = @"claimsMappingPolicies", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphClaimsMappingPolicy) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphClaimsMappingPolicy[] ClaimsMappingPolicy { get => _body.ClaimsMappingPolicy ?? null /* arrayOf */; set => _body.ClaimsMappingPolicy = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphClaimsMappingPolicy[] ClaimsMappingPolicy { get => _body.ClaimsMappingPolicy ?? null /* fixedArrayOf */; set => _body.ClaimsMappingPolicy = value; } /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -242,7 +253,7 @@ public partial class NewAzADServicePrincipal_CreateExpanded : global::System.Man Description = @"The permission classifications for delegated permissions exposed by the app that this service principal represents. Supports $expand.", SerializedName = @"delegatedPermissionClassifications", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDelegatedPermissionClassification) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDelegatedPermissionClassification[] DelegatedPermissionClassification { get => _body.DelegatedPermissionClassification ?? null /* arrayOf */; set => _body.DelegatedPermissionClassification = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDelegatedPermissionClassification[] DelegatedPermissionClassification { get => _body.DelegatedPermissionClassification ?? null /* fixedArrayOf */; set => _body.DelegatedPermissionClassification = value; } /// . [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] @@ -309,7 +320,7 @@ public partial class NewAzADServicePrincipal_CreateExpanded : global::System.Man Description = @"Endpoints available for discovery. Services like Sharepoint populate this property with a tenant specific SharePoint endpoints that other applications can discover and use in their experiences.", SerializedName = @"endpoints", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEndpoint) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEndpoint[] Endpoint { get => _body.Endpoint ?? null /* arrayOf */; set => _body.Endpoint = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEndpoint[] Endpoint { get => _body.Endpoint ?? null /* fixedArrayOf */; set => _body.Endpoint = value; } /// Accessor for extensibleParameters. public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } @@ -324,7 +335,7 @@ public partial class NewAzADServicePrincipal_CreateExpanded : global::System.Man Description = @".", SerializedName = @"federatedIdentityCredentials", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential[] FederatedIdentityCredentials { get => _body.FederatedIdentityCredentials ?? null /* arrayOf */; set => _body.FederatedIdentityCredentials = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential[] FederatedIdentityCredentials { get => _body.FederatedIdentityCredentials ?? null /* fixedArrayOf */; set => _body.FederatedIdentityCredentials = value; } /// /// The homeRealmDiscoveryPolicies assigned to this service principal. Supports $expand. @@ -338,7 +349,7 @@ public partial class NewAzADServicePrincipal_CreateExpanded : global::System.Man Description = @"The homeRealmDiscoveryPolicies assigned to this service principal. Supports $expand.", SerializedName = @"homeRealmDiscoveryPolicies", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy[] HomeRealmDiscoveryPolicy { get => _body.HomeRealmDiscoveryPolicy ?? null /* arrayOf */; set => _body.HomeRealmDiscoveryPolicy = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy[] HomeRealmDiscoveryPolicy { get => _body.HomeRealmDiscoveryPolicy ?? null /* fixedArrayOf */; set => _body.HomeRealmDiscoveryPolicy = value; } /// Home page or landing page of the application. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Home page or landing page of the application.")] @@ -390,7 +401,7 @@ public partial class NewAzADServicePrincipal_CreateExpanded : global::System.Man Description = @"The collection of key credentials associated with the service principal. Not nullable. Supports $filter (eq, NOT, ge, le).", SerializedName = @"keyCredentials", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential[] KeyCredentials { get => _body.KeyCredentials ?? null /* arrayOf */; set => _body.KeyCredentials = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential[] KeyCredentials { get => _body.KeyCredentials ?? null /* fixedArrayOf */; set => _body.KeyCredentials = value; } /// /// Specifies the URL where the service provider redirects the user to Azure AD to authenticate. Azure AD uses the URL to @@ -457,7 +468,7 @@ public partial class NewAzADServicePrincipal_CreateExpanded : global::System.Man Description = @"Specifies the list of email addresses where Azure AD sends a notification when the active certificate is near the expiration date. This is only for the certificates used to sign the SAML token issued for Azure AD Gallery applications.", SerializedName = @"notificationEmailAddresses", PossibleTypes = new [] { typeof(string) })] - public string[] NotificationEmailAddress { get => _body.NotificationEmailAddress ?? null /* arrayOf */; set => _body.NotificationEmailAddress = value; } + public string[] NotificationEmailAddress { get => _body.NotificationEmailAddress ?? null /* fixedArrayOf */; set => _body.NotificationEmailAddress = value; } /// /// The delegated permissions exposed by the application. For more information see the oauth2PermissionScopes property on @@ -472,7 +483,7 @@ public partial class NewAzADServicePrincipal_CreateExpanded : global::System.Man Description = @"The delegated permissions exposed by the application. For more information see the oauth2PermissionScopes property on the application entity's api property. Not nullable.", SerializedName = @"oauth2PermissionScopes", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPermissionScope) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPermissionScope[] Oauth2PermissionScope { get => _body.Oauth2PermissionScope ?? null /* arrayOf */; set => _body.Oauth2PermissionScope = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPermissionScope[] Oauth2PermissionScope { get => _body.Oauth2PermissionScope ?? null /* fixedArrayOf */; set => _body.Oauth2PermissionScope = value; } /// /// The collection of password credentials associated with the service principal. Not nullable. @@ -486,7 +497,7 @@ public partial class NewAzADServicePrincipal_CreateExpanded : global::System.Man Description = @"The collection of password credentials associated with the service principal. Not nullable.", SerializedName = @"passwordCredentials", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential[] PasswordCredentials { get => _body.PasswordCredentials ?? null /* arrayOf */; set => _body.PasswordCredentials = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential[] PasswordCredentials { get => _body.PasswordCredentials ?? null /* fixedArrayOf */; set => _body.PasswordCredentials = value; } /// /// The instance of the that the remote call will use. @@ -550,7 +561,7 @@ public partial class NewAzADServicePrincipal_CreateExpanded : global::System.Man Description = @"The URLs that user tokens are sent to for sign in with the associated application, or the redirect URIs that OAuth 2.0 authorization codes and access tokens are sent to for the associated application. Not nullable.", SerializedName = @"replyUrls", PossibleTypes = new [] { typeof(string) })] - public string[] ReplyUrl { get => _body.ReplyUrl ?? null /* arrayOf */; set => _body.ReplyUrl = value; } + public string[] ReplyUrl { get => _body.ReplyUrl ?? null /* fixedArrayOf */; set => _body.ReplyUrl = value; } /// samlSingleSignOnSettings [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "samlSingleSignOnSettings")] @@ -579,7 +590,7 @@ public partial class NewAzADServicePrincipal_CreateExpanded : global::System.Man Description = @"Contains the list of identifiersUris, copied over from the associated application. Additional values can be added to hybrid applications. These values can be used to identify the permissions exposed by this app within Azure AD. For example,Client apps can specify a resource URI which is based on the values of this property to acquire an access token, which is the URI returned in the 'aud' claim.The any operator is required for filter expressions on multi-valued properties. Not nullable. Supports $filter (eq, NOT, ge, le, startsWith).", SerializedName = @"servicePrincipalNames", PossibleTypes = new [] { typeof(string) })] - public string[] ServicePrincipalName { get => _body.ServicePrincipalName ?? null /* arrayOf */; set => _body.ServicePrincipalName = value; } + public string[] ServicePrincipalName { get => _body.ServicePrincipalName ?? null /* fixedArrayOf */; set => _body.ServicePrincipalName = value; } /// /// Identifies if the service principal represents an application or a managed identity. This is set by Azure AD internally. @@ -609,7 +620,7 @@ public partial class NewAzADServicePrincipal_CreateExpanded : global::System.Man Description = @"Custom strings that can be used to categorize and identify the service principal. Not nullable. Supports $filter (eq, NOT, ge, le, startsWith).", SerializedName = @"tags", PossibleTypes = new [] { typeof(string) })] - public string[] Tag { get => _body.Tag ?? null /* arrayOf */; set => _body.Tag = value; } + public string[] Tag { get => _body.Tag ?? null /* fixedArrayOf */; set => _body.Tag = value; } /// /// Specifies the keyId of a public key from the keyCredentials collection. When configured, Azure AD issues tokens for this @@ -636,7 +647,7 @@ public partial class NewAzADServicePrincipal_CreateExpanded : global::System.Man Description = @"The tokenIssuancePolicies assigned to this service principal. Supports $expand.", SerializedName = @"tokenIssuancePolicies", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy[] TokenIssuancePolicy { get => _body.TokenIssuancePolicy ?? null /* arrayOf */; set => _body.TokenIssuancePolicy = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy[] TokenIssuancePolicy { get => _body.TokenIssuancePolicy ?? null /* fixedArrayOf */; set => _body.TokenIssuancePolicy = value; } /// The tokenLifetimePolicies assigned to this service principal. Supports $expand. [global::System.Management.Automation.AllowEmptyCollection] @@ -648,7 +659,7 @@ public partial class NewAzADServicePrincipal_CreateExpanded : global::System.Man Description = @"The tokenLifetimePolicies assigned to this service principal. Supports $expand.", SerializedName = @"tokenLifetimePolicies", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy[] TokenLifetimePolicy { get => _body.TokenLifetimePolicy ?? null /* arrayOf */; set => _body.TokenLifetimePolicy = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy[] TokenLifetimePolicy { get => _body.TokenLifetimePolicy ?? null /* fixedArrayOf */; set => _body.TokenLifetimePolicy = value; } /// . [global::System.Management.Automation.AllowEmptyCollection] @@ -660,7 +671,7 @@ public partial class NewAzADServicePrincipal_CreateExpanded : global::System.Man Description = @".", SerializedName = @"transitiveMemberOf", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject[] TransitiveMemberOf { get => _body.TransitiveMemberOf ?? null /* arrayOf */; set => _body.TransitiveMemberOf = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject[] TransitiveMemberOf { get => _body.TransitiveMemberOf ?? null /* fixedArrayOf */; set => _body.TransitiveMemberOf = value; } /// /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what @@ -707,7 +718,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -780,7 +813,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -790,7 +823,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzADServicePrincipal_CreateExpanded() { @@ -863,7 +896,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 } }); @@ -882,6 +915,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal @@ -902,7 +950,25 @@ protected override void StopProcessing() } // onCreated - response for 201 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -933,14 +999,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzAdUser_CreateExpanded.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzAdUser_CreateExpanded.cs index 78cd121f4128..5f1728f7b4c5 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzAdUser_CreateExpanded.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/NewAzAdUser_CreateExpanded.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -43,6 +44,15 @@ public partial class NewAzADUser_CreateExpanded : global::System.Management.Auto /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// /// true if the account is enabled; otherwise, false. This property is required when a user is created. Supports $filter (eq, /// ne, NOT, and in). @@ -170,9 +180,10 @@ public partial class NewAzADUser_CreateExpanded : global::System.Management.Auto public string Country { get => _body.Country ?? null; set => _body.Country = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -362,7 +373,7 @@ public partial class NewAzADUser_CreateExpanded : global::System.Management.Auto Description = @"Represents the identities that can be used to sign in to this user account. An identity can be provided by Microsoft (also known as a local account), by organizations, or by social identity providers such as Facebook, Google, and Microsoft, and tied to a user account. May contain multiple items with the same signInType value. Supports $filter (eq) only where the signInType is not userPrincipalName.", SerializedName = @"identities", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphObjectIdentity) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphObjectIdentity[] Identity { get => _body.Identity ?? null /* arrayOf */; set => _body.Identity = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphObjectIdentity[] Identity { get => _body.Identity ?? null /* fixedArrayOf */; set => _body.Identity = value; } /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -541,7 +552,7 @@ public partial class NewAzADUser_CreateExpanded : global::System.Management.Auto Description = @"A list of additional email addresses for the user; for example: ['bob@contoso.com', 'Robert@fabrikam.com'].NOTE: While this property can contain accent characters, they can cause access issues to first-party applications for the user.Supports $filter (eq, NOT, ge, le, in, startsWith).", SerializedName = @"otherMails", PossibleTypes = new [] { typeof(string) })] - public string[] OtherMail { get => _body.OtherMail ?? null /* arrayOf */; set => _body.OtherMail = value; } + public string[] OtherMail { get => _body.OtherMail ?? null /* fixedArrayOf */; set => _body.OtherMail = value; } /// /// Specifies password policies for the user. This value is an enumeration with one possible value being DisableStrongPassword, @@ -582,7 +593,7 @@ public partial class NewAzADUser_CreateExpanded : global::System.Management.Auto Description = @"For internal use only. Not nullable. Supports $filter (eq, not, ge, le, startsWith).", SerializedName = @"physicalIds", PossibleTypes = new [] { typeof(string) })] - public string[] PhysicalId { get => _body.PhysicalId ?? null /* arrayOf */; set => _body.PhysicalId = value; } + public string[] PhysicalId { get => _body.PhysicalId ?? null /* fixedArrayOf */; set => _body.PhysicalId = value; } /// /// The instance of the that the remote call will use. @@ -798,7 +809,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -871,7 +904,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -881,7 +914,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzADUser_CreateExpanded() { @@ -954,7 +987,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 } }); @@ -973,6 +1006,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser @@ -993,7 +1041,25 @@ protected override void StopProcessing() } // onCreated - response for 201 / application/json // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser - WriteObject((await response)); + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -1024,14 +1090,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADAppFederatedCredential_Delete.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADAppFederatedCredential_Delete.cs index 9708d48e598c..b8a0d3ea19b5 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADAppFederatedCredential_Delete.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADAppFederatedCredential_Delete.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -39,6 +40,15 @@ public partial class RemoveAzADAppFederatedCredential_Delete : global::System.Ma /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _applicationObjectId; @@ -65,9 +75,10 @@ public partial class RemoveAzADAppFederatedCredential_Delete : global::System.Ma public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -198,7 +209,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -271,7 +304,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -345,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId,FederatedCredentialId=FederatedCredentialId,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId,FederatedCredentialId=FederatedCredentialId,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -358,7 +391,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzADAppFederatedCredential_Delete() { @@ -372,6 +405,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -399,14 +447,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId, FederatedCredentialId=FederatedCredentialId, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId, FederatedCredentialId=FederatedCredentialId, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADApplicationKey_RemoveViaJsonFilePath.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADApplicationKey_RemoveViaJsonFilePath.cs new file mode 100644 index 000000000000..683436174212 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADApplicationKey_RemoveViaJsonFilePath.cs @@ -0,0 +1,478 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Invoke action removeKey + /// + /// [OpenAPI] RemoveKey=>POST:"/applications/{application-id}/microsoft.graph.removeKey" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzADApplicationKey_RemoveViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Invoke action removeKey")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/applications/{application-id}/microsoft.graph.removeKey", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class RemoveAzADApplicationKey_RemoveViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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; + + /// Backing field for property. + private string _applicationId; + + /// key: id of application + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of application")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of application", + SerializedName = @"application-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ApplicationId { get => this._applicationId; set => this._applicationId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 Remove operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Remove operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Remove operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ApplicationsRemoveKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ApplicationsRemoveKeyViaJsonString(ApplicationId, _jsonString, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzADApplicationKey_RemoveViaJsonFilePath() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADApplicationKey_RemoveViaJsonString.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADApplicationKey_RemoveViaJsonString.cs new file mode 100644 index 000000000000..b1452b82fad4 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADApplicationKey_RemoveViaJsonString.cs @@ -0,0 +1,476 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Invoke action removeKey + /// + /// [OpenAPI] RemoveKey=>POST:"/applications/{application-id}/microsoft.graph.removeKey" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzADApplicationKey_RemoveViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Invoke action removeKey")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/applications/{application-id}/microsoft.graph.removeKey", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class RemoveAzADApplicationKey_RemoveViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Backing field for property. + private string _applicationId; + + /// key: id of application + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of application")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of application", + SerializedName = @"application-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ApplicationId { get => this._applicationId; set => this._applicationId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 Remove operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Remove operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Remove operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ApplicationsRemoveKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ApplicationsRemoveKeyViaJsonString(ApplicationId, _jsonString, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzADApplicationKey_RemoveViaJsonString() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADApplicationPassword_RemoveViaJsonFilePath.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADApplicationPassword_RemoveViaJsonFilePath.cs new file mode 100644 index 000000000000..935f4374234e --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADApplicationPassword_RemoveViaJsonFilePath.cs @@ -0,0 +1,478 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Invoke action removePassword + /// + /// [OpenAPI] RemovePassword=>POST:"/applications/{application-id}/microsoft.graph.removePassword" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzADApplicationPassword_RemoveViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Invoke action removePassword")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/applications/{application-id}/microsoft.graph.removePassword", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class RemoveAzADApplicationPassword_RemoveViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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; + + /// Backing field for property. + private string _applicationId; + + /// key: id of application + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of application")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of application", + SerializedName = @"application-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ApplicationId { get => this._applicationId; set => this._applicationId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 Remove operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Remove operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Remove operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ApplicationsRemovePassword' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ApplicationsRemovePasswordViaJsonString(ApplicationId, _jsonString, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzADApplicationPassword_RemoveViaJsonFilePath() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADApplicationPassword_RemoveViaJsonString.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADApplicationPassword_RemoveViaJsonString.cs new file mode 100644 index 000000000000..c78986f530f4 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADApplicationPassword_RemoveViaJsonString.cs @@ -0,0 +1,476 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Invoke action removePassword + /// + /// [OpenAPI] RemovePassword=>POST:"/applications/{application-id}/microsoft.graph.removePassword" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzADApplicationPassword_RemoveViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Invoke action removePassword")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/applications/{application-id}/microsoft.graph.removePassword", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class RemoveAzADApplicationPassword_RemoveViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Backing field for property. + private string _applicationId; + + /// key: id of application + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of application")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of application", + SerializedName = @"application-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ApplicationId { get => this._applicationId; set => this._applicationId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 Remove operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Remove operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Remove operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ApplicationsRemovePassword' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ApplicationsRemovePasswordViaJsonString(ApplicationId, _jsonString, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzADApplicationPassword_RemoveViaJsonString() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADGroupOwner_Delete.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADGroupOwner_Delete.cs index f11f31600d03..42884acaae0f 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADGroupOwner_Delete.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADGroupOwner_Delete.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -39,6 +40,15 @@ public partial class RemoveAzADGroupOwner_Delete : global::System.Management.Aut /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] @@ -51,9 +61,10 @@ public partial class RemoveAzADGroupOwner_Delete : global::System.Management.Aut public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -214,7 +225,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -287,7 +320,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -369,7 +402,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId,OwnerId=OwnerId,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,Id=this.InvocationInformation.BoundParameters.ContainsKey("Id") ? Id : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId,OwnerId=OwnerId,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,Id=this.InvocationInformation.BoundParameters.ContainsKey("Id") ? Id : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -382,7 +415,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzADGroupOwner_Delete() { @@ -396,6 +429,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -423,14 +471,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId, OwnerId=OwnerId, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, Id=this.InvocationInformation.BoundParameters.ContainsKey("Id") ? Id : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId, OwnerId=OwnerId, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, Id=this.InvocationInformation.BoundParameters.ContainsKey("Id") ? Id : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADServicePrincipalAppRoleAssignment_Delete.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADServicePrincipalAppRoleAssignment_Delete.cs index c877761402af..313cef644ae3 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADServicePrincipalAppRoleAssignment_Delete.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADServicePrincipalAppRoleAssignment_Delete.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -39,6 +40,15 @@ public partial class RemoveAzADServicePrincipalAppRoleAssignment_Delete : global /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _appRoleAssignmentId; @@ -65,9 +75,10 @@ public partial class RemoveAzADServicePrincipalAppRoleAssignment_Delete : global public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -198,7 +209,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -271,7 +304,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -345,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,AppRoleAssignmentId=AppRoleAssignmentId,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,AppRoleAssignmentId=AppRoleAssignmentId,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -358,7 +391,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzADServicePrincipalAppRoleAssignment_Delete() { @@ -372,6 +405,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -399,14 +447,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, AppRoleAssignmentId=AppRoleAssignmentId, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, AppRoleAssignmentId=AppRoleAssignmentId, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADServicePrincipalKey_RemoveViaJsonFilePath.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADServicePrincipalKey_RemoveViaJsonFilePath.cs new file mode 100644 index 000000000000..6e4a7e9bef53 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADServicePrincipalKey_RemoveViaJsonFilePath.cs @@ -0,0 +1,478 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Invoke action removeKey + /// + /// [OpenAPI] RemoveKey=>POST:"/servicePrincipals/{servicePrincipal-id}/microsoft.graph.removeKey" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzADServicePrincipalKey_RemoveViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Invoke action removeKey")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}/microsoft.graph.removeKey", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class RemoveAzADServicePrincipalKey_RemoveViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 Remove operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Remove operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Remove operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicePrincipalsRemoveKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsRemoveKeyViaJsonString(ServicePrincipalId, _jsonString, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzADServicePrincipalKey_RemoveViaJsonFilePath() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADServicePrincipalKey_RemoveViaJsonString.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADServicePrincipalKey_RemoveViaJsonString.cs new file mode 100644 index 000000000000..fae4a848bdc3 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADServicePrincipalKey_RemoveViaJsonString.cs @@ -0,0 +1,476 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Invoke action removeKey + /// + /// [OpenAPI] RemoveKey=>POST:"/servicePrincipals/{servicePrincipal-id}/microsoft.graph.removeKey" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzADServicePrincipalKey_RemoveViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Invoke action removeKey")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}/microsoft.graph.removeKey", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class RemoveAzADServicePrincipalKey_RemoveViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 Remove operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Remove operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Remove operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicePrincipalsRemoveKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsRemoveKeyViaJsonString(ServicePrincipalId, _jsonString, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzADServicePrincipalKey_RemoveViaJsonString() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADServicePrincipalPassword_RemoveViaJsonFilePath.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADServicePrincipalPassword_RemoveViaJsonFilePath.cs new file mode 100644 index 000000000000..2a3738772360 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADServicePrincipalPassword_RemoveViaJsonFilePath.cs @@ -0,0 +1,478 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Invoke action removePassword + /// + /// [OpenAPI] RemovePassword=>POST:"/servicePrincipals/{servicePrincipal-id}/microsoft.graph.removePassword" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzADServicePrincipalPassword_RemoveViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Invoke action removePassword")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}/microsoft.graph.removePassword", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class RemoveAzADServicePrincipalPassword_RemoveViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 Remove operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Remove operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Remove operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicePrincipalsRemovePassword' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsRemovePasswordViaJsonString(ServicePrincipalId, _jsonString, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzADServicePrincipalPassword_RemoveViaJsonFilePath() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADServicePrincipalPassword_RemoveViaJsonString.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADServicePrincipalPassword_RemoveViaJsonString.cs new file mode 100644 index 000000000000..631d061e1133 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzADServicePrincipalPassword_RemoveViaJsonString.cs @@ -0,0 +1,476 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Invoke action removePassword + /// + /// [OpenAPI] RemovePassword=>POST:"/servicePrincipals/{servicePrincipal-id}/microsoft.graph.removePassword" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzADServicePrincipalPassword_RemoveViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Invoke action removePassword")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}/microsoft.graph.removePassword", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class RemoveAzADServicePrincipalPassword_RemoveViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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 Remove operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Remove operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Remove operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicePrincipalsRemovePassword' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsRemovePasswordViaJsonString(ServicePrincipalId, _jsonString, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzADServicePrincipalPassword_RemoveViaJsonString() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdApplicationKey_Remove.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdApplicationKey_Remove.cs index 98fae205381d..15248d10b2ec 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdApplicationKey_Remove.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdApplicationKey_Remove.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -40,6 +41,15 @@ public partial class RemoveAzADApplicationKey_Remove : global::System.Management /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _applicationId; @@ -79,9 +89,10 @@ public partial class RemoveAzADApplicationKey_Remove : global::System.Management public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -184,7 +195,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -257,7 +290,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -331,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId,body=Body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -344,7 +377,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzADApplicationKey_Remove() { @@ -358,6 +391,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -385,14 +433,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId, body=Body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId, body=Body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdApplicationKey_RemoveExpanded.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdApplicationKey_RemoveExpanded.cs index 4c830815157a..3d4b87d12fd6 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdApplicationKey_RemoveExpanded.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdApplicationKey_RemoveExpanded.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -42,6 +43,15 @@ public partial class RemoveAzADApplicationKey_RemoveExpanded : global::System.Ma /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional Parameters")] public global::System.Collections.Hashtable AdditionalProperties { get; set; } @@ -71,9 +81,10 @@ public partial class RemoveAzADApplicationKey_RemoveExpanded : global::System.Ma public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -198,7 +209,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -271,7 +304,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -346,7 +379,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -359,7 +392,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzADApplicationKey_RemoveExpanded() { @@ -373,6 +406,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -400,14 +448,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdApplicationPassword_Remove.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdApplicationPassword_Remove.cs index f5a4cb336426..052490dfb17e 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdApplicationPassword_Remove.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdApplicationPassword_Remove.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -40,6 +41,15 @@ public partial class RemoveAzADApplicationPassword_Remove : global::System.Manag /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _applicationId; @@ -79,9 +89,10 @@ public partial class RemoveAzADApplicationPassword_Remove : global::System.Manag public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -184,7 +195,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -257,7 +290,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -331,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId,body=Body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -344,7 +377,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzADApplicationPassword_Remove() { @@ -358,6 +391,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -385,14 +433,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId, body=Body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId, body=Body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdApplicationPassword_RemoveExpanded.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdApplicationPassword_RemoveExpanded.cs index 403629f082bb..0ea3446759ce 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdApplicationPassword_RemoveExpanded.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdApplicationPassword_RemoveExpanded.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -42,6 +43,15 @@ public partial class RemoveAzADApplicationPassword_RemoveExpanded : global::Syst /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional Parameters")] public global::System.Collections.Hashtable AdditionalProperties { get; set; } @@ -71,9 +81,10 @@ public partial class RemoveAzADApplicationPassword_RemoveExpanded : global::Syst public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -187,7 +198,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -260,7 +293,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -335,7 +368,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -348,7 +381,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzADApplicationPassword_RemoveExpanded() { @@ -362,6 +395,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -389,14 +437,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdApplication_Delete.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdApplication_Delete.cs index aa307a57c5d3..153f6ce9dbc0 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdApplication_Delete.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdApplication_Delete.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -43,6 +44,29 @@ public partial class RemoveAzADApplication_Delete : global::System.Management.Au /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Backing field for property. + private string _applicationId; + + /// key: id of application + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of application")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of application", + SerializedName = @"application-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ApplicationId { get => this._applicationId; set => this._applicationId = value; } + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] @@ -55,9 +79,10 @@ public partial class RemoveAzADApplication_Delete : global::System.Management.Au public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -78,21 +103,6 @@ public partial class RemoveAzADApplication_Delete : global::System.Management.Au [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private string _id; - - /// key: id of application - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of application")] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"key: id of application", - SerializedName = @"application-id", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("ApplicationId")] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] - public string Id { get => this._id; set => this._id = value; } - /// Backing field for property. private string _ifMatch; @@ -189,7 +199,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -262,7 +294,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -331,12 +363,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ApplicationsApplicationDeleteApplication(Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, onNoContent, onDefault, this, Pipeline); + await this.Client.ApplicationsApplicationDeleteApplication(ApplicationId, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, onNoContent, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -349,7 +381,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzADApplication_Delete() { @@ -363,6 +395,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -390,14 +437,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdGroupRefMember_Delete.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdGroupRefMember_Delete.cs index f2bcbc4fffd9..5d572db33955 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdGroupRefMember_Delete.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdGroupRefMember_Delete.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -19,6 +20,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzADGroupRefMember_Delete", SupportsShouldProcess = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PreviewMessage("This cmdlet is using API version beta which is under preview.")] [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Users, contacts, and groups that are members of this group. HTTP Methods: GET (supported for all groups), POST (supported for security groups and mail-enabled security groups), DELETE (supported only for security groups) Read-only. Nullable. Supports $expand.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] @@ -44,6 +46,15 @@ public partial class RemoveAzADGroupRefMember_Delete : global::System.Management /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] @@ -56,9 +67,10 @@ public partial class RemoveAzADGroupRefMember_Delete : global::System.Management public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -189,7 +201,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -262,7 +296,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -336,7 +370,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId,MemberId=MemberId}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId,MemberId=MemberId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -349,7 +383,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzADGroupRefMember_Delete() { @@ -363,6 +397,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -390,14 +439,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId, MemberId=MemberId }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId, MemberId=MemberId }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdGroup_Delete.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdGroup_Delete.cs index ee1d2c6c67ac..bb2a682238da 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdGroup_Delete.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdGroup_Delete.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -43,6 +44,15 @@ public partial class RemoveAzADGroup_Delete : global::System.Management.Automati /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] @@ -55,9 +65,10 @@ public partial class RemoveAzADGroup_Delete : global::System.Management.Automati public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -66,6 +77,20 @@ public partial class RemoveAzADGroup_Delete : global::System.Management.Automati /// Accessor for extensibleParameters. public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Backing field for property. + private string _groupId; + + /// key: id of group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of group")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of group", + SerializedName = @"group-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string GroupId { get => this._groupId; set => this._groupId = value; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -78,21 +103,6 @@ public partial class RemoveAzADGroup_Delete : global::System.Management.Automati [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private string _id; - - /// key: id of group - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of group")] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"key: id of group", - SerializedName = @"group-id", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("GroupId")] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] - public string Id { get => this._id; set => this._id = value; } - /// Backing field for property. private string _ifMatch; @@ -189,7 +199,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -262,7 +294,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -331,12 +363,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.GroupsGroupDeleteGroup(Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, onNoContent, onDefault, this, Pipeline); + await this.Client.GroupsGroupDeleteGroup(GroupId, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, onNoContent, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId=GroupId,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -349,7 +381,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzADGroup_Delete() { @@ -363,6 +395,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -390,14 +437,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdServicePrincipalKey_Remove.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdServicePrincipalKey_Remove.cs index a430f3e9cd88..b101b68a58c6 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdServicePrincipalKey_Remove.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdServicePrincipalKey_Remove.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -40,6 +41,15 @@ public partial class RemoveAzADServicePrincipalKey_Remove : global::System.Manag /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPaths1UhuhlbServiceprincipalsServiceprincipalIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema _body; @@ -65,9 +75,10 @@ public partial class RemoveAzADServicePrincipalKey_Remove : global::System.Manag public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -184,7 +195,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -257,7 +290,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -331,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,body=Body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -344,7 +377,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzADServicePrincipalKey_Remove() { @@ -358,6 +391,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -385,14 +433,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, body=Body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, body=Body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdServicePrincipalKey_RemoveExpanded.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdServicePrincipalKey_RemoveExpanded.cs index 314f53b34292..82899f3eb8b8 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdServicePrincipalKey_RemoveExpanded.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdServicePrincipalKey_RemoveExpanded.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -42,6 +43,15 @@ public partial class RemoveAzADServicePrincipalKey_RemoveExpanded : global::Syst /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional Parameters")] public global::System.Collections.Hashtable AdditionalProperties { get; set; } @@ -57,9 +67,10 @@ public partial class RemoveAzADServicePrincipalKey_RemoveExpanded : global::Syst public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -198,7 +209,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -271,7 +304,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -346,7 +379,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -359,7 +392,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzADServicePrincipalKey_RemoveExpanded() { @@ -373,6 +406,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -400,14 +448,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdServicePrincipalPassword_Remove.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdServicePrincipalPassword_Remove.cs index c20335802ee3..e39569aa6e9c 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdServicePrincipalPassword_Remove.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdServicePrincipalPassword_Remove.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -40,6 +41,15 @@ public partial class RemoveAzADServicePrincipalPassword_Remove : global::System. /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPaths1Idoj4GServiceprincipalsServiceprincipalIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema _body; @@ -65,9 +75,10 @@ public partial class RemoveAzADServicePrincipalPassword_Remove : global::System. public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -184,7 +195,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -257,7 +290,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -331,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,body=Body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -344,7 +377,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzADServicePrincipalPassword_Remove() { @@ -358,6 +391,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -385,14 +433,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, body=Body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, body=Body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdServicePrincipalPassword_RemoveExpanded.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdServicePrincipalPassword_RemoveExpanded.cs index 531672f7080a..0bae7e861980 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdServicePrincipalPassword_RemoveExpanded.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdServicePrincipalPassword_RemoveExpanded.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -42,6 +43,15 @@ public partial class RemoveAzADServicePrincipalPassword_RemoveExpanded : global: /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional Parameters")] public global::System.Collections.Hashtable AdditionalProperties { get; set; } @@ -57,9 +67,10 @@ public partial class RemoveAzADServicePrincipalPassword_RemoveExpanded : global: public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -187,7 +198,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -260,7 +293,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -335,7 +368,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -348,7 +381,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzADServicePrincipalPassword_RemoveExpanded() { @@ -362,6 +395,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -389,14 +437,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdServicePrincipal_Delete.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdServicePrincipal_Delete.cs index f84e959a996c..5ef5ccbc3126 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdServicePrincipal_Delete.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdServicePrincipal_Delete.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -43,6 +44,15 @@ public partial class RemoveAzADServicePrincipal_Delete : global::System.Manageme /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] @@ -55,9 +65,10 @@ public partial class RemoveAzADServicePrincipal_Delete : global::System.Manageme public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -78,21 +89,6 @@ public partial class RemoveAzADServicePrincipal_Delete : global::System.Manageme [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private string _id; - - /// key: id of servicePrincipal - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"key: id of servicePrincipal", - SerializedName = @"servicePrincipal-id", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("ServicePrincipalId")] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] - public string Id { get => this._id; set => this._id = value; } - /// Backing field for property. private string _ifMatch; @@ -146,6 +142,20 @@ public partial class RemoveAzADServicePrincipal_Delete : global::System.Manageme [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = value; } + /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior @@ -189,7 +199,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -262,7 +294,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -331,12 +363,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ServicePrincipalsServicePrincipalDeleteServicePrincipal(Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, onNoContent, onDefault, this, Pipeline); + await this.Client.ServicePrincipalsServicePrincipalDeleteServicePrincipal(ServicePrincipalId, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, onNoContent, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -349,7 +381,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzADServicePrincipal_Delete() { @@ -363,6 +395,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -390,14 +437,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdUser_Delete.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdUser_Delete.cs index 24782934c476..e56e649168d2 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdUser_Delete.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/RemoveAzAdUser_Delete.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -40,6 +41,15 @@ public partial class RemoveAzADUser_Delete : global::System.Management.Automatio /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] @@ -52,9 +62,10 @@ public partial class RemoveAzADUser_Delete : global::System.Management.Automatio public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -75,21 +86,6 @@ public partial class RemoveAzADUser_Delete : global::System.Management.Automatio [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private string _id; - - /// key: id of user - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of user")] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"key: id of user", - SerializedName = @"user-id", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("UserId")] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] - public string Id { get => this._id; set => this._id = value; } - /// Backing field for property. private string _ifMatch; @@ -143,6 +139,20 @@ public partial class RemoveAzADUser_Delete : global::System.Management.Automatio [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + /// Backing field for property. + private string _userId; + + /// key: id of user + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of user")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of user", + SerializedName = @"user-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string UserId { get => this._userId; set => this._userId = value; } + /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior @@ -186,7 +196,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -259,7 +291,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -328,12 +360,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.UsersUserDeleteUser(Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, onNoContent, onDefault, this, Pipeline); + await this.Client.UsersUserDeleteUser(UserId, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, onNoContent, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { UserId=UserId,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -346,7 +378,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzADUser_Delete() { @@ -360,6 +392,21 @@ protected override void StopProcessing() base.StopProcessing(); } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -387,14 +434,14 @@ protected override void StopProcessing() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADAppFederatedCredential_UpdateExpanded.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADAppFederatedCredential_UpdateExpanded.cs index c75e78c1aaf5..3af77f41dbfb 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADAppFederatedCredential_UpdateExpanded.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADAppFederatedCredential_UpdateExpanded.cs @@ -6,16 +6,17 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; - /// Update the navigation property federatedIdentityCredentials in applications + /// update the navigation property federatedIdentityCredentials in applications /// /// [OpenAPI] UpdateFederatedIdentityCredentials=>PATCH:"/applications/{application-id}/federatedIdentityCredentials/{federatedIdentityCredential-id}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzADAppFederatedCredential_UpdateExpanded", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Update the navigation property federatedIdentityCredentials in applications")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"update the navigation property federatedIdentityCredentials in applications")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/applications/{application-id}/federatedIdentityCredentials/{federatedIdentityCredential-id}", ApiVersion = "v1.0")] public partial class UpdateAzADAppFederatedCredential_UpdateExpanded : global::System.Management.Automation.PSCmdlet, @@ -42,6 +43,15 @@ public partial class UpdateAzADAppFederatedCredential_UpdateExpanded : global::S /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional Parameters")] public global::System.Collections.Hashtable AdditionalProperties { get; set; } @@ -74,7 +84,7 @@ public partial class UpdateAzADAppFederatedCredential_UpdateExpanded : global::S Description = @"Lists the audiences that can appear in the external token. This field is mandatory, and defaults to 'api://AzureADTokenExchange'. It says what Microsoft identity platform should accept in the aud claim in the incoming token. This value represents Azure AD in your external identity provider and has no fixed value across identity providers - you may need to create a new application registration in your identity provider to serve as the audience of this token. Required.", SerializedName = @"audiences", PossibleTypes = new [] { typeof(string) })] - public string[] Audience { get => _body.Audience ?? null /* arrayOf */; set => _body.Audience = value; } + public string[] Audience { get => _body.Audience ?? null /* fixedArrayOf */; set => _body.Audience = value; } /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] @@ -88,9 +98,10 @@ public partial class UpdateAzADAppFederatedCredential_UpdateExpanded : global::S public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -265,7 +276,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -338,7 +371,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -417,7 +450,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId,FederatedCredentialId=FederatedCredentialId,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId,FederatedCredentialId=FederatedCredentialId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -437,13 +470,28 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzADAppFederatedCredential_UpdateExpanded() { } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -471,14 +519,14 @@ public UpdateAzADAppFederatedCredential_UpdateExpanded() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId, FederatedCredentialId=FederatedCredentialId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId, FederatedCredentialId=FederatedCredentialId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADAppFederatedCredential_UpdateViaJsonFilePath.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADAppFederatedCredential_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..41a74f6ed1d4 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADAppFederatedCredential_UpdateViaJsonFilePath.cs @@ -0,0 +1,491 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// update the navigation property federatedIdentityCredentials in applications + /// + /// [OpenAPI] UpdateFederatedIdentityCredentials=>PATCH:"/applications/{application-id}/federatedIdentityCredentials/{federatedIdentityCredential-id}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzADAppFederatedCredential_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"update the navigation property federatedIdentityCredentials in applications")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/applications/{application-id}/federatedIdentityCredentials/{federatedIdentityCredential-id}", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class UpdateAzADAppFederatedCredential_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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; + + /// Backing field for property. + private string _applicationObjectId; + + /// key: id of application + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of application")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of application", + SerializedName = @"application-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ApplicationObjectId { get => this._applicationObjectId; set => this._applicationObjectId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// Backing field for property. + private string _federatedCredentialId; + + /// key: id of federatedIdentityCredential + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of federatedIdentityCredential")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of federatedIdentityCredential", + SerializedName = @"federatedIdentityCredential-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string FederatedCredentialId { get => this._federatedCredentialId; set => this._federatedCredentialId = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Update operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ApplicationsUpdateFederatedIdentityCredentials' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ApplicationsUpdateFederatedIdentityCredentialsViaJsonString(ApplicationObjectId, FederatedCredentialId, _jsonString, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId,FederatedCredentialId=FederatedCredentialId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzADAppFederatedCredential_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADAppFederatedCredential_UpdateViaJsonString.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADAppFederatedCredential_UpdateViaJsonString.cs new file mode 100644 index 000000000000..1cb3fefbe22e --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADAppFederatedCredential_UpdateViaJsonString.cs @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// update the navigation property federatedIdentityCredentials in applications + /// + /// [OpenAPI] UpdateFederatedIdentityCredentials=>PATCH:"/applications/{application-id}/federatedIdentityCredentials/{federatedIdentityCredential-id}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzADAppFederatedCredential_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"update the navigation property federatedIdentityCredentials in applications")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/applications/{application-id}/federatedIdentityCredentials/{federatedIdentityCredential-id}", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class UpdateAzADAppFederatedCredential_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Backing field for property. + private string _applicationObjectId; + + /// key: id of application + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of application")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of application", + SerializedName = @"application-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ApplicationObjectId { get => this._applicationObjectId; set => this._applicationObjectId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// Backing field for property. + private string _federatedCredentialId; + + /// key: id of federatedIdentityCredential + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of federatedIdentityCredential")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of federatedIdentityCredential", + SerializedName = @"federatedIdentityCredential-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string FederatedCredentialId { get => this._federatedCredentialId; set => this._federatedCredentialId = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ApplicationsUpdateFederatedIdentityCredentials' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ApplicationsUpdateFederatedIdentityCredentialsViaJsonString(ApplicationObjectId, FederatedCredentialId, _jsonString, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationObjectId=ApplicationObjectId,FederatedCredentialId=FederatedCredentialId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzADAppFederatedCredential_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADApplication_UpdateViaJsonFilePath.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADApplication_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..002516af242d --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADApplication_UpdateViaJsonFilePath.cs @@ -0,0 +1,481 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. + /// + /// + /// [OpenAPI] UpdateApplication=>PATCH:"/applications/{application-id}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzADApplication_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity types.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/applications/{application-id}", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class UpdateAzADApplication_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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; + + /// Backing field for property. + private string _applicationId; + + /// key: id of application + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of application")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of application", + SerializedName = @"application-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ApplicationId { get => this._applicationId; set => this._applicationId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Update operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ApplicationsApplicationUpdateApplication' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ApplicationsApplicationUpdateApplicationViaJsonString(ApplicationId, _jsonString, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzADApplication_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADApplication_UpdateViaJsonString.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADApplication_UpdateViaJsonString.cs new file mode 100644 index 000000000000..10cfd82b4ffe --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADApplication_UpdateViaJsonString.cs @@ -0,0 +1,479 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. + /// + /// + /// [OpenAPI] UpdateApplication=>PATCH:"/applications/{application-id}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzADApplication_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity types.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/applications/{application-id}", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class UpdateAzADApplication_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Backing field for property. + private string _applicationId; + + /// key: id of application + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of application")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of application", + SerializedName = @"application-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ApplicationId { get => this._applicationId; set => this._applicationId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ApplicationsApplicationUpdateApplication' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ApplicationsApplicationUpdateApplicationViaJsonString(ApplicationId, _jsonString, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzADApplication_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADGroup_UpdateViaJsonFilePath.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADGroup_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..bae597881098 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADGroup_UpdateViaJsonFilePath.cs @@ -0,0 +1,478 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// update entity in groups + /// + /// [OpenAPI] UpdateGroup=>PATCH:"/groups/{group-id}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzADGroup_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"update entity in groups")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/groups/{group-id}", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class UpdateAzADGroup_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Update operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _objectId; + + /// key: id of group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of group")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of group", + SerializedName = @"group-id", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("GroupId")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ObjectId { get => this._objectId; set => this._objectId = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'GroupsGroupUpdateGroup' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.GroupsGroupUpdateGroupViaJsonString(ObjectId, _jsonString, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ObjectId=ObjectId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzADGroup_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADGroup_UpdateViaJsonString.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADGroup_UpdateViaJsonString.cs new file mode 100644 index 000000000000..e2a221e9fb54 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADGroup_UpdateViaJsonString.cs @@ -0,0 +1,476 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// update entity in groups + /// + /// [OpenAPI] UpdateGroup=>PATCH:"/groups/{group-id}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzADGroup_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"update entity in groups")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/groups/{group-id}", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class UpdateAzADGroup_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _objectId; + + /// key: id of group + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of group")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of group", + SerializedName = @"group-id", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("GroupId")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ObjectId { get => this._objectId; set => this._objectId = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'GroupsGroupUpdateGroup' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.GroupsGroupUpdateGroupViaJsonString(ObjectId, _jsonString, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ObjectId=ObjectId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzADGroup_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipalAppRoleAssignment_Update.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipalAppRoleAssignment_Update.cs index 5d8f3a900745..de3e9845f2a9 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipalAppRoleAssignment_Update.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipalAppRoleAssignment_Update.cs @@ -6,16 +6,17 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; - /// Update the navigation property appRoleAssignments in servicePrincipals + /// update the navigation property appRoleAssignments in servicePrincipals /// /// [OpenAPI] UpdateAppRoleAssignments=>PATCH:"/servicePrincipals/{servicePrincipal-id}/appRoleAssignments/{appRoleAssignment-id}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzADServicePrincipalAppRoleAssignment_Update", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Update the navigation property appRoleAssignments in servicePrincipals")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"update the navigation property appRoleAssignments in servicePrincipals")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}/appRoleAssignments/{appRoleAssignment-id}", ApiVersion = "v1.0")] public partial class UpdateAzADServicePrincipalAppRoleAssignment_Update : global::System.Management.Automation.PSCmdlet, @@ -39,6 +40,15 @@ public partial class UpdateAzADServicePrincipalAppRoleAssignment_Update : global /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _appRoleAssignmentId; @@ -82,9 +92,10 @@ public partial class UpdateAzADServicePrincipalAppRoleAssignment_Update : global public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -201,7 +212,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -274,7 +307,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -348,7 +381,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,AppRoleAssignmentId=AppRoleAssignmentId,body=Body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,AppRoleAssignmentId=AppRoleAssignmentId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -368,13 +401,28 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzADServicePrincipalAppRoleAssignment_Update() { } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -402,14 +450,14 @@ public UpdateAzADServicePrincipalAppRoleAssignment_Update() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, AppRoleAssignmentId=AppRoleAssignmentId, body=Body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, AppRoleAssignmentId=AppRoleAssignmentId, body=Body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipalAppRoleAssignment_UpdateExpanded.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipalAppRoleAssignment_UpdateExpanded.cs index be6f1fed61a1..6082bcb5a7b3 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipalAppRoleAssignment_UpdateExpanded.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipalAppRoleAssignment_UpdateExpanded.cs @@ -6,16 +6,17 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; - /// Update the navigation property appRoleAssignments in servicePrincipals + /// update the navigation property appRoleAssignments in servicePrincipals /// /// [OpenAPI] UpdateAppRoleAssignments=>PATCH:"/servicePrincipals/{servicePrincipal-id}/appRoleAssignments/{appRoleAssignment-id}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzADServicePrincipalAppRoleAssignment_UpdateExpanded", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Update the navigation property appRoleAssignments in servicePrincipals")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"update the navigation property appRoleAssignments in servicePrincipals")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}/appRoleAssignments/{appRoleAssignment-id}", ApiVersion = "v1.0")] public partial class UpdateAzADServicePrincipalAppRoleAssignment_UpdateExpanded : global::System.Management.Automation.PSCmdlet, @@ -45,6 +46,15 @@ public partial class UpdateAzADServicePrincipalAppRoleAssignment_UpdateExpanded /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional Parameters")] public global::System.Collections.Hashtable AdditionalProperties { get; set; } @@ -90,9 +100,10 @@ public partial class UpdateAzADServicePrincipalAppRoleAssignment_UpdateExpanded public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -276,7 +287,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -349,7 +382,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -444,7 +477,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,AppRoleAssignmentId=AppRoleAssignmentId,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,AppRoleAssignmentId=AppRoleAssignmentId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -464,13 +497,28 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzADServicePrincipalAppRoleAssignment_UpdateExpanded() { } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -498,14 +546,14 @@ public UpdateAzADServicePrincipalAppRoleAssignment_UpdateExpanded() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, AppRoleAssignmentId=AppRoleAssignmentId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId, AppRoleAssignmentId=AppRoleAssignmentId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipalAppRoleAssignment_UpdateViaJsonFilePath.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipalAppRoleAssignment_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..881975b377d5 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipalAppRoleAssignment_UpdateViaJsonFilePath.cs @@ -0,0 +1,492 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// update the navigation property appRoleAssignments in servicePrincipals + /// + /// [OpenAPI] UpdateAppRoleAssignments=>PATCH:"/servicePrincipals/{servicePrincipal-id}/appRoleAssignments/{appRoleAssignment-id}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzADServicePrincipalAppRoleAssignment_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"update the navigation property appRoleAssignments in servicePrincipals")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}/appRoleAssignments/{appRoleAssignment-id}", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class UpdateAzADServicePrincipalAppRoleAssignment_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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; + + /// Backing field for property. + private string _appRoleAssignmentId; + + /// key: id of appRoleAssignment + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of appRoleAssignment")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of appRoleAssignment", + SerializedName = @"appRoleAssignment-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string AppRoleAssignmentId { get => this._appRoleAssignmentId; set => this._appRoleAssignmentId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Update operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicePrincipalsUpdateAppRoleAssignments' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsUpdateAppRoleAssignmentsViaJsonString(ServicePrincipalId, AppRoleAssignmentId, _jsonString, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,AppRoleAssignmentId=AppRoleAssignmentId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzADServicePrincipalAppRoleAssignment_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipalAppRoleAssignment_UpdateViaJsonString.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipalAppRoleAssignment_UpdateViaJsonString.cs new file mode 100644 index 000000000000..3d84f068f393 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipalAppRoleAssignment_UpdateViaJsonString.cs @@ -0,0 +1,490 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// update the navigation property appRoleAssignments in servicePrincipals + /// + /// [OpenAPI] UpdateAppRoleAssignments=>PATCH:"/servicePrincipals/{servicePrincipal-id}/appRoleAssignments/{appRoleAssignment-id}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzADServicePrincipalAppRoleAssignment_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"update the navigation property appRoleAssignments in servicePrincipals")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}/appRoleAssignments/{appRoleAssignment-id}", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class UpdateAzADServicePrincipalAppRoleAssignment_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Backing field for property. + private string _appRoleAssignmentId; + + /// key: id of appRoleAssignment + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of appRoleAssignment")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of appRoleAssignment", + SerializedName = @"appRoleAssignment-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string AppRoleAssignmentId { get => this._appRoleAssignmentId; set => this._appRoleAssignmentId = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicePrincipalsUpdateAppRoleAssignments' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsUpdateAppRoleAssignmentsViaJsonString(ServicePrincipalId, AppRoleAssignmentId, _jsonString, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId,AppRoleAssignmentId=AppRoleAssignmentId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzADServicePrincipalAppRoleAssignment_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipal_UpdateViaJsonFilePath.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipal_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..9f23120a5abd --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipal_UpdateViaJsonFilePath.cs @@ -0,0 +1,481 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. + /// + /// + /// [OpenAPI] UpdateServicePrincipal=>PATCH:"/servicePrincipals/{servicePrincipal-id}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzADServicePrincipal_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity types.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class UpdateAzADServicePrincipal_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Update operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicePrincipalsServicePrincipalUpdateServicePrincipal' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsServicePrincipalUpdateServicePrincipalViaJsonString(ServicePrincipalId, _jsonString, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzADServicePrincipal_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipal_UpdateViaJsonString.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipal_UpdateViaJsonString.cs new file mode 100644 index 000000000000..2b2e1af430a3 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADServicePrincipal_UpdateViaJsonString.cs @@ -0,0 +1,479 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// + /// Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity + /// types. + /// + /// + /// [OpenAPI] UpdateServicePrincipal=>PATCH:"/servicePrincipals/{servicePrincipal-id}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzADServicePrincipal_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Represents an Azure Active Directory object. The directoryObject type is the base type for many other directory entity types.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/servicePrincipals/{servicePrincipal-id}", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class UpdateAzADServicePrincipal_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ServicePrincipalsServicePrincipalUpdateServicePrincipal' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ServicePrincipalsServicePrincipalUpdateServicePrincipalViaJsonString(ServicePrincipalId, _jsonString, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzADServicePrincipal_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADUser_UpdateViaJsonFilePath.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADUser_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..9ed66268d77b --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADUser_UpdateViaJsonFilePath.cs @@ -0,0 +1,478 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Represents an Azure Active Directory user object. + /// + /// [OpenAPI] UpdateUser=>PATCH:"/users/{user-id}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzADUser_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Represents an Azure Active Directory user object.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/users/{user-id}", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class UpdateAzADUser_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Update operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _userId; + + /// key: id of user + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of user")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of user", + SerializedName = @"user-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string UserId { get => this._userId; set => this._userId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'UsersUserUpdateUser' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.UsersUserUpdateUserViaJsonString(UserId, _jsonString, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { UserId=UserId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzADUser_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADUser_UpdateViaJsonString.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADUser_UpdateViaJsonString.cs new file mode 100644 index 000000000000..06a07f518f13 --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzADUser_UpdateViaJsonString.cs @@ -0,0 +1,476 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; + using System; + + /// Represents an Azure Active Directory user object. + /// + /// [OpenAPI] UpdateUser=>PATCH:"/users/{user-id}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzADUser_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Represents an Azure Active Directory user object.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/users/{user-id}", ApiVersion = "v1.0")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.NotSuggestDefaultParameterSet] + public partial class UpdateAzADUser_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.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.Resources.MSGraph.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.Resources.MSGraph.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _userId; + + /// key: id of user + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of user")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of user", + SerializedName = @"user-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string UserId { get => this._userId; set => this._userId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'UsersUserUpdateUser' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.UsersUserUpdateUserViaJsonString(UserId, _jsonString, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { UserId=UserId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzADUser_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10Beta.IOdataError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Error?.Code; + var message = (await response)?.Error?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzAdApplication_UpdateExpanded.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzAdApplication_UpdateExpanded.cs index df4cd6749abf..b84f8eb5a69f 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzAdApplication_UpdateExpanded.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzAdApplication_UpdateExpanded.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -49,6 +50,15 @@ public partial class UpdateAzADApplication_UpdateExpanded : global::System.Manag /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// /// Defines custom behavior that a consuming service can use to call an app in specific contexts. For example, applications /// that can render file streams may set the addIns property for its 'FileHandler' functionality. This will let services like @@ -63,7 +73,7 @@ public partial class UpdateAzADApplication_UpdateExpanded : global::System.Manag Description = @"Defines custom behavior that a consuming service can use to call an app in specific contexts. For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. This will let services like Office 365 call the application in the context of a document the user is working on.", SerializedName = @"addIns", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn[] AddIn { get => _body.AddIn ?? null /* arrayOf */; set => _body.AddIn = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn[] AddIn { get => _body.AddIn ?? null /* fixedArrayOf */; set => _body.AddIn = value; } [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional Parameters")] public global::System.Collections.Hashtable AdditionalProperties { get; set; } @@ -92,7 +102,21 @@ public partial class UpdateAzADApplication_UpdateExpanded : global::System.Manag Description = @"The collection of roles assigned to the application. With app role assignments, these roles can be assigned to users, groups, or service principals associated with other applications. Not nullable.", SerializedName = @"appRoles", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole[] AppRole { get => _body.AppRole ?? null /* arrayOf */; set => _body.AppRole = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole[] AppRole { get => _body.AppRole ?? null /* fixedArrayOf */; set => _body.AppRole = value; } + + /// Backing field for property. + private string _applicationId; + + /// key: id of application + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of application")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of application", + SerializedName = @"application-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ApplicationId { get => this._applicationId; set => this._applicationId = value; } /// Unique identifier of the applicationTemplate. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Unique identifier of the applicationTemplate.")] @@ -139,9 +163,10 @@ public partial class UpdateAzADApplication_UpdateExpanded : global::System.Manag public string CreatedOnBehalfOfDisplayName { get => _body.CreatedOnBehalfOfDisplayName ?? null; set => _body.CreatedOnBehalfOfDisplayName = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -213,7 +238,7 @@ public partial class UpdateAzADApplication_UpdateExpanded : global::System.Manag Description = @"Federated identities for applications. Supports $expand and $filter (eq when counting empty collections).", SerializedName = @"federatedIdentityCredentials", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential[] FederatedIdentityCredentials { get => _body.FederatedIdentityCredentials ?? null /* arrayOf */; set => _body.FederatedIdentityCredentials = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential[] FederatedIdentityCredentials { get => _body.FederatedIdentityCredentials ?? null /* fixedArrayOf */; set => _body.FederatedIdentityCredentials = value; } /// /// Configures the groups claim issued in a user or OAuth 2.0 access token that the application expects. To set this attribute, @@ -240,7 +265,7 @@ public partial class UpdateAzADApplication_UpdateExpanded : global::System.Manag Description = @".", SerializedName = @"homeRealmDiscoveryPolicies", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy[] HomeRealmDiscoveryPolicy { get => _body.HomeRealmDiscoveryPolicy ?? null /* arrayOf */; set => _body.HomeRealmDiscoveryPolicy = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy[] HomeRealmDiscoveryPolicy { get => _body.HomeRealmDiscoveryPolicy ?? null /* fixedArrayOf */; set => _body.HomeRealmDiscoveryPolicy = value; } /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] @@ -254,21 +279,6 @@ public partial class UpdateAzADApplication_UpdateExpanded : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private string _id; - - /// key: id of application - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of application")] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"key: id of application", - SerializedName = @"application-id", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("ApplicationId")] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] - public string Id { get => this._id; set => this._id = value; } - /// /// The URIs that identify the application within its Azure AD tenant, or within a verified custom domain if the application /// is multi-tenant. For more information, see Application Objects and Service Principal Objects. The any operator is required @@ -283,7 +293,7 @@ public partial class UpdateAzADApplication_UpdateExpanded : global::System.Manag Description = @"The URIs that identify the application within its Azure AD tenant, or within a verified custom domain if the application is multi-tenant. For more information, see Application Objects and Service Principal Objects. The any operator is required for filter expressions on multi-valued properties. Not nullable. Supports $filter (eq, ne, ge, le, startsWith).", SerializedName = @"identifierUris", PossibleTypes = new [] { typeof(string) })] - public string[] IdentifierUri { get => _body.IdentifierUri ?? null /* arrayOf */; set => _body.IdentifierUri = value; } + public string[] IdentifierUri { get => _body.IdentifierUri ?? null /* fixedArrayOf */; set => _body.IdentifierUri = value; } /// informationalUrl [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "informationalUrl")] @@ -341,7 +351,7 @@ public partial class UpdateAzADApplication_UpdateExpanded : global::System.Manag Description = @"The collection of key credentials associated with the application. Not nullable. Supports $filter (eq, NOT, ge, le).", SerializedName = @"keyCredentials", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential[] KeyCredentials { get => _body.KeyCredentials ?? null /* arrayOf */; set => _body.KeyCredentials = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential[] KeyCredentials { get => _body.KeyCredentials ?? null /* fixedArrayOf */; set => _body.KeyCredentials = value; } /// The main logo for the application. Not nullable. internal byte[] Logo { get => _body.Logo ?? null /* byte array */; set => _body.Logo = value; } @@ -437,7 +447,7 @@ public string LogoInputFile Description = @"The collection of password credentials associated with the application. Not nullable.", SerializedName = @"passwordCredentials", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential[] PasswordCredentials { get => _body.PasswordCredentials ?? null /* arrayOf */; set => _body.PasswordCredentials = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential[] PasswordCredentials { get => _body.PasswordCredentials ?? null /* fixedArrayOf */; set => _body.PasswordCredentials = value; } /// /// The instance of the that the remote call will use. @@ -485,7 +495,7 @@ public string LogoInputFile Description = @"Specifies the resources that the application needs to access. This property also specifies the set of OAuth permission scopes and application roles that it needs for each of those resources. This configuration of access to the required resources drives the consent experience. Not nullable. Supports $filter (eq, NOT, ge, le).", SerializedName = @"requiredResourceAccess", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphRequiredResourceAccess) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphRequiredResourceAccess[] RequiredResourceAccess { get => _body.RequiredResourceAccess ?? null /* arrayOf */; set => _body.RequiredResourceAccess = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphRequiredResourceAccess[] RequiredResourceAccess { get => _body.RequiredResourceAccess ?? null /* fixedArrayOf */; set => _body.RequiredResourceAccess = value; } /// /// References application or service contact information from a Service or Asset Management database. Nullable. @@ -538,7 +548,7 @@ public string LogoInputFile Description = @"Custom strings that can be used to categorize and identify the application. Not nullable.Supports $filter (eq, NOT, ge, le, startsWith).", SerializedName = @"tags", PossibleTypes = new [] { typeof(string) })] - public string[] Tag { get => _body.Tag ?? null /* arrayOf */; set => _body.Tag = value; } + public string[] Tag { get => _body.Tag ?? null /* fixedArrayOf */; set => _body.Tag = value; } /// /// Specifies the keyId of a public key from the keyCredentials collection. When configured, Azure AD encrypts all the tokens @@ -565,7 +575,7 @@ public string LogoInputFile Description = @".", SerializedName = @"tokenIssuancePolicies", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy[] TokenIssuancePolicy { get => _body.TokenIssuancePolicy ?? null /* arrayOf */; set => _body.TokenIssuancePolicy = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy[] TokenIssuancePolicy { get => _body.TokenIssuancePolicy ?? null /* fixedArrayOf */; set => _body.TokenIssuancePolicy = value; } /// The tokenLifetimePolicies assigned to this application. Supports $expand. [global::System.Management.Automation.AllowEmptyCollection] @@ -577,7 +587,7 @@ public string LogoInputFile Description = @"The tokenLifetimePolicies assigned to this application. Supports $expand.", SerializedName = @"tokenLifetimePolicies", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy[] TokenLifetimePolicy { get => _body.TokenLifetimePolicy ?? null /* arrayOf */; set => _body.TokenLifetimePolicy = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy[] TokenLifetimePolicy { get => _body.TokenLifetimePolicy ?? null /* fixedArrayOf */; set => _body.TokenLifetimePolicy = value; } /// webApplication [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "webApplication")] @@ -633,7 +643,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -706,7 +738,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -776,12 +808,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ApplicationsApplicationUpdateApplication(Id, _body, onNoContent, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate); + await this.Client.ApplicationsApplicationUpdateApplication(ApplicationId, _body, onNoContent, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ApplicationId=ApplicationId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -801,13 +833,28 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzADApplication_UpdateExpanded() { } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -835,14 +882,14 @@ public UpdateAzADApplication_UpdateExpanded() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzAdGroup_UpdateExpanded.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzAdGroup_UpdateExpanded.cs index b57a73d6b806..630003350c3c 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzAdGroup_UpdateExpanded.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzAdGroup_UpdateExpanded.cs @@ -6,16 +6,17 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; - /// Update entity in groups + /// update entity in groups /// /// [OpenAPI] UpdateGroup=>PATCH:"/groups/{group-id}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzADGroup_UpdateExpanded", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"Update entity in groups")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Description(@"update entity in groups")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.HttpPath(Path = "/groups/{group-id}", ApiVersion = "v1.0")] public partial class UpdateAzADGroup_UpdateExpanded : global::System.Management.Automation.PSCmdlet, @@ -45,6 +46,15 @@ public partial class UpdateAzADGroup_UpdateExpanded : global::System.Management. /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional Parameters")] public global::System.Collections.Hashtable AdditionalProperties { get; set; } @@ -60,7 +70,7 @@ public partial class UpdateAzADGroup_UpdateExpanded : global::System.Management. Description = @"Represents the app roles a group has been granted for an application. Supports $expand.", SerializedName = @"appRoleAssignments", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentAutoGenerated) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentAutoGenerated[] AppRoleAssignment { get => _body.AppRoleAssignment ?? null /* arrayOf */; set => _body.AppRoleAssignment = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentAutoGenerated[] AppRoleAssignment { get => _body.AppRoleAssignment ?? null /* fixedArrayOf */; set => _body.AppRoleAssignment = value; } /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] @@ -103,9 +113,10 @@ public partial class UpdateAzADGroup_UpdateExpanded : global::System.Management. public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject CreatedOnBehalfOf { get => _body.CreatedOnBehalfOf ?? null /* object */; set => _body.CreatedOnBehalfOf = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -163,7 +174,7 @@ public partial class UpdateAzADGroup_UpdateExpanded : global::System.Management. Description = @"Specifies the group type and its membership. If the collection contains Unified, the group is a Microsoft 365 group; otherwise, it's either a security group or distribution group. For details, see groups overview.If the collection includes DynamicMembership, the group has dynamic membership; otherwise, membership is static. Returned by default. Supports $filter (eq, NOT).", SerializedName = @"groupTypes", PossibleTypes = new [] { typeof(string) })] - public string[] GroupType { get => _body.GroupType ?? null /* arrayOf */; set => _body.GroupType = value; } + public string[] GroupType { get => _body.GroupType ?? null /* fixedArrayOf */; set => _body.GroupType = value; } /// /// Indicates whether there are members in this group that have license errors from its group-based license assignment. This @@ -323,7 +334,7 @@ public partial class UpdateAzADGroup_UpdateExpanded : global::System.Management. Description = @"The permissions that have been granted for a group to a specific application. Supports $expand.", SerializedName = @"permissionGrants", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphResourceSpecificPermissionGrant) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphResourceSpecificPermissionGrant[] PermissionGrant { get => _body.PermissionGrant ?? null /* arrayOf */; set => _body.PermissionGrant = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphResourceSpecificPermissionGrant[] PermissionGrant { get => _body.PermissionGrant ?? null /* fixedArrayOf */; set => _body.PermissionGrant = value; } /// /// The instance of the that the remote call will use. @@ -473,7 +484,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -546,7 +579,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -621,7 +654,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ObjectId=ObjectId,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ObjectId=ObjectId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -641,13 +674,28 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzADGroup_UpdateExpanded() { } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -675,14 +723,14 @@ public UpdateAzADGroup_UpdateExpanded() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ObjectId=ObjectId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ObjectId=ObjectId, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzAdServicePrincipal_UpdateExpanded.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzAdServicePrincipal_UpdateExpanded.cs index 70afd8d59e33..98407a9b88bd 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzAdServicePrincipal_UpdateExpanded.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzAdServicePrincipal_UpdateExpanded.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -49,6 +50,15 @@ public partial class UpdateAzADServicePrincipal_UpdateExpanded : global::System. /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// /// true if the service principal account is enabled; otherwise, false. Supports $filter (eq, ne, NOT, in). /// @@ -76,7 +86,7 @@ public partial class UpdateAzADServicePrincipal_UpdateExpanded : global::System. Description = @"Defines custom behavior that a consuming service can use to call an app in specific contexts. For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. This will let services like Microsoft 365 call the application in the context of a document the user is working on.", SerializedName = @"addIns", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn[] AddIn { get => _body.AddIn ?? null /* arrayOf */; set => _body.AddIn = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn[] AddIn { get => _body.AddIn ?? null /* fixedArrayOf */; set => _body.AddIn = value; } [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Additional Parameters")] public global::System.Collections.Hashtable AdditionalProperties { get; set; } @@ -94,7 +104,7 @@ public partial class UpdateAzADServicePrincipal_UpdateExpanded : global::System. Description = @"Used to retrieve service principals by subscription, identify resource group and full resource ids for managed identities. Supports $filter (eq, NOT, ge, le, startsWith).", SerializedName = @"alternativeNames", PossibleTypes = new [] { typeof(string) })] - public string[] AlternativeName { get => _body.AlternativeName ?? null /* arrayOf */; set => _body.AlternativeName = value; } + public string[] AlternativeName { get => _body.AlternativeName ?? null /* fixedArrayOf */; set => _body.AlternativeName = value; } /// The description exposed by the associated application. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The description exposed by the associated application.")] @@ -156,7 +166,7 @@ public partial class UpdateAzADServicePrincipal_UpdateExpanded : global::System. Description = @"The roles exposed by the application which this service principal represents. For more information see the appRoles property definition on the application entity. Not nullable.", SerializedName = @"appRoles", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole[] AppRole { get => _body.AppRole ?? null /* arrayOf */; set => _body.AppRole = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole[] AppRole { get => _body.AppRole ?? null /* fixedArrayOf */; set => _body.AppRole = value; } /// /// App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. @@ -170,7 +180,7 @@ public partial class UpdateAzADServicePrincipal_UpdateExpanded : global::System. Description = @"App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand.", SerializedName = @"appRoleAssignedTo", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment[] AppRoleAssignedTo { get => _body.AppRoleAssignedTo ?? null /* arrayOf */; set => _body.AppRoleAssignedTo = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment[] AppRoleAssignedTo { get => _body.AppRoleAssignedTo ?? null /* fixedArrayOf */; set => _body.AppRoleAssignedTo = value; } /// /// App role assignment for another app or service, granted to this service principal. Supports $expand. @@ -184,7 +194,7 @@ public partial class UpdateAzADServicePrincipal_UpdateExpanded : global::System. Description = @"App role assignment for another app or service, granted to this service principal. Supports $expand.", SerializedName = @"appRoleAssignments", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment[] AppRoleAssignment { get => _body.AppRoleAssignment ?? null /* arrayOf */; set => _body.AppRoleAssignment = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment[] AppRoleAssignment { get => _body.AppRoleAssignment ?? null /* fixedArrayOf */; set => _body.AppRoleAssignment = value; } /// /// Specifies whether users or other service principals need to be granted an app role assignment for this service principal @@ -218,15 +228,16 @@ public partial class UpdateAzADServicePrincipal_UpdateExpanded : global::System. Description = @"The claimsMappingPolicies assigned to this service principal. Supports $expand.", SerializedName = @"claimsMappingPolicies", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphClaimsMappingPolicy) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphClaimsMappingPolicy[] ClaimsMappingPolicy { get => _body.ClaimsMappingPolicy ?? null /* arrayOf */; set => _body.ClaimsMappingPolicy = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphClaimsMappingPolicy[] ClaimsMappingPolicy { get => _body.ClaimsMappingPolicy ?? null /* fixedArrayOf */; set => _body.ClaimsMappingPolicy = value; } /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.MSGraph Client => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -245,7 +256,7 @@ public partial class UpdateAzADServicePrincipal_UpdateExpanded : global::System. Description = @"The permission classifications for delegated permissions exposed by the app that this service principal represents. Supports $expand.", SerializedName = @"delegatedPermissionClassifications", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDelegatedPermissionClassification) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDelegatedPermissionClassification[] DelegatedPermissionClassification { get => _body.DelegatedPermissionClassification ?? null /* arrayOf */; set => _body.DelegatedPermissionClassification = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDelegatedPermissionClassification[] DelegatedPermissionClassification { get => _body.DelegatedPermissionClassification ?? null /* fixedArrayOf */; set => _body.DelegatedPermissionClassification = value; } /// . [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] @@ -312,7 +323,7 @@ public partial class UpdateAzADServicePrincipal_UpdateExpanded : global::System. Description = @"Endpoints available for discovery. Services like Sharepoint populate this property with a tenant specific SharePoint endpoints that other applications can discover and use in their experiences.", SerializedName = @"endpoints", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEndpoint) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEndpoint[] Endpoint { get => _body.Endpoint ?? null /* arrayOf */; set => _body.Endpoint = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEndpoint[] Endpoint { get => _body.Endpoint ?? null /* fixedArrayOf */; set => _body.Endpoint = value; } /// Accessor for extensibleParameters. public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } @@ -327,7 +338,7 @@ public partial class UpdateAzADServicePrincipal_UpdateExpanded : global::System. Description = @".", SerializedName = @"federatedIdentityCredentials", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential[] FederatedIdentityCredentials { get => _body.FederatedIdentityCredentials ?? null /* arrayOf */; set => _body.FederatedIdentityCredentials = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential[] FederatedIdentityCredentials { get => _body.FederatedIdentityCredentials ?? null /* fixedArrayOf */; set => _body.FederatedIdentityCredentials = value; } /// /// The homeRealmDiscoveryPolicies assigned to this service principal. Supports $expand. @@ -341,7 +352,7 @@ public partial class UpdateAzADServicePrincipal_UpdateExpanded : global::System. Description = @"The homeRealmDiscoveryPolicies assigned to this service principal. Supports $expand.", SerializedName = @"homeRealmDiscoveryPolicies", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy[] HomeRealmDiscoveryPolicy { get => _body.HomeRealmDiscoveryPolicy ?? null /* arrayOf */; set => _body.HomeRealmDiscoveryPolicy = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy[] HomeRealmDiscoveryPolicy { get => _body.HomeRealmDiscoveryPolicy ?? null /* fixedArrayOf */; set => _body.HomeRealmDiscoveryPolicy = value; } /// Home page or landing page of the application. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Home page or landing page of the application.")] @@ -366,21 +377,6 @@ public partial class UpdateAzADServicePrincipal_UpdateExpanded : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private string _id; - - /// key: id of servicePrincipal - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"key: id of servicePrincipal", - SerializedName = @"servicePrincipal-id", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("ServicePrincipalId")] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] - public string Id { get => this._id; set => this._id = value; } - /// informationalUrl [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "informationalUrl")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Body)] @@ -408,7 +404,7 @@ public partial class UpdateAzADServicePrincipal_UpdateExpanded : global::System. Description = @"The collection of key credentials associated with the service principal. Not nullable. Supports $filter (eq, NOT, ge, le).", SerializedName = @"keyCredentials", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential[] KeyCredentials { get => _body.KeyCredentials ?? null /* arrayOf */; set => _body.KeyCredentials = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential[] KeyCredentials { get => _body.KeyCredentials ?? null /* fixedArrayOf */; set => _body.KeyCredentials = value; } /// /// Specifies the URL where the service provider redirects the user to Azure AD to authenticate. Azure AD uses the URL to @@ -475,7 +471,7 @@ public partial class UpdateAzADServicePrincipal_UpdateExpanded : global::System. Description = @"Specifies the list of email addresses where Azure AD sends a notification when the active certificate is near the expiration date. This is only for the certificates used to sign the SAML token issued for Azure AD Gallery applications.", SerializedName = @"notificationEmailAddresses", PossibleTypes = new [] { typeof(string) })] - public string[] NotificationEmailAddress { get => _body.NotificationEmailAddress ?? null /* arrayOf */; set => _body.NotificationEmailAddress = value; } + public string[] NotificationEmailAddress { get => _body.NotificationEmailAddress ?? null /* fixedArrayOf */; set => _body.NotificationEmailAddress = value; } /// /// The delegated permissions exposed by the application. For more information see the oauth2PermissionScopes property on @@ -490,7 +486,7 @@ public partial class UpdateAzADServicePrincipal_UpdateExpanded : global::System. Description = @"The delegated permissions exposed by the application. For more information see the oauth2PermissionScopes property on the application entity's api property. Not nullable.", SerializedName = @"oauth2PermissionScopes", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPermissionScope) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPermissionScope[] Oauth2PermissionScope { get => _body.Oauth2PermissionScope ?? null /* arrayOf */; set => _body.Oauth2PermissionScope = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPermissionScope[] Oauth2PermissionScope { get => _body.Oauth2PermissionScope ?? null /* fixedArrayOf */; set => _body.Oauth2PermissionScope = value; } /// /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. @@ -511,7 +507,7 @@ public partial class UpdateAzADServicePrincipal_UpdateExpanded : global::System. Description = @"The collection of password credentials associated with the service principal. Not nullable.", SerializedName = @"passwordCredentials", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential[] PasswordCredentials { get => _body.PasswordCredentials ?? null /* arrayOf */; set => _body.PasswordCredentials = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential[] PasswordCredentials { get => _body.PasswordCredentials ?? null /* fixedArrayOf */; set => _body.PasswordCredentials = value; } /// /// The instance of the that the remote call will use. @@ -575,7 +571,7 @@ public partial class UpdateAzADServicePrincipal_UpdateExpanded : global::System. Description = @"The URLs that user tokens are sent to for sign in with the associated application, or the redirect URIs that OAuth 2.0 authorization codes and access tokens are sent to for the associated application. Not nullable.", SerializedName = @"replyUrls", PossibleTypes = new [] { typeof(string) })] - public string[] ReplyUrl { get => _body.ReplyUrl ?? null /* arrayOf */; set => _body.ReplyUrl = value; } + public string[] ReplyUrl { get => _body.ReplyUrl ?? null /* fixedArrayOf */; set => _body.ReplyUrl = value; } /// samlSingleSignOnSettings [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "samlSingleSignOnSettings")] @@ -588,6 +584,20 @@ public partial class UpdateAzADServicePrincipal_UpdateExpanded : global::System. PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphSamlSingleSignOnSettings) })] public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphSamlSingleSignOnSettings SamlSingleSignOnSetting { get => _body.SamlSingleSignOnSetting ?? null /* object */; set => _body.SamlSingleSignOnSetting = value; } + /// Backing field for property. + private string _servicePrincipalId; + + /// key: id of servicePrincipal + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of servicePrincipal")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of servicePrincipal", + SerializedName = @"servicePrincipal-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string ServicePrincipalId { get => this._servicePrincipalId; set => this._servicePrincipalId = value; } + /// /// Contains the list of identifiersUris, copied over from the associated application. Additional values can be added to hybrid /// applications. These values can be used to identify the permissions exposed by this app within Azure AD. For example,Client @@ -604,7 +614,7 @@ public partial class UpdateAzADServicePrincipal_UpdateExpanded : global::System. Description = @"Contains the list of identifiersUris, copied over from the associated application. Additional values can be added to hybrid applications. These values can be used to identify the permissions exposed by this app within Azure AD. For example,Client apps can specify a resource URI which is based on the values of this property to acquire an access token, which is the URI returned in the 'aud' claim.The any operator is required for filter expressions on multi-valued properties. Not nullable. Supports $filter (eq, NOT, ge, le, startsWith).", SerializedName = @"servicePrincipalNames", PossibleTypes = new [] { typeof(string) })] - public string[] ServicePrincipalName { get => _body.ServicePrincipalName ?? null /* arrayOf */; set => _body.ServicePrincipalName = value; } + public string[] ServicePrincipalName { get => _body.ServicePrincipalName ?? null /* fixedArrayOf */; set => _body.ServicePrincipalName = value; } /// /// Identifies if the service principal represents an application or a managed identity. This is set by Azure AD internally. @@ -634,7 +644,7 @@ public partial class UpdateAzADServicePrincipal_UpdateExpanded : global::System. Description = @"Custom strings that can be used to categorize and identify the service principal. Not nullable. Supports $filter (eq, NOT, ge, le, startsWith).", SerializedName = @"tags", PossibleTypes = new [] { typeof(string) })] - public string[] Tag { get => _body.Tag ?? null /* arrayOf */; set => _body.Tag = value; } + public string[] Tag { get => _body.Tag ?? null /* fixedArrayOf */; set => _body.Tag = value; } /// /// Specifies the keyId of a public key from the keyCredentials collection. When configured, Azure AD issues tokens for this @@ -661,7 +671,7 @@ public partial class UpdateAzADServicePrincipal_UpdateExpanded : global::System. Description = @"The tokenIssuancePolicies assigned to this service principal. Supports $expand.", SerializedName = @"tokenIssuancePolicies", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy[] TokenIssuancePolicy { get => _body.TokenIssuancePolicy ?? null /* arrayOf */; set => _body.TokenIssuancePolicy = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy[] TokenIssuancePolicy { get => _body.TokenIssuancePolicy ?? null /* fixedArrayOf */; set => _body.TokenIssuancePolicy = value; } /// The tokenLifetimePolicies assigned to this service principal. Supports $expand. [global::System.Management.Automation.AllowEmptyCollection] @@ -673,7 +683,7 @@ public partial class UpdateAzADServicePrincipal_UpdateExpanded : global::System. Description = @"The tokenLifetimePolicies assigned to this service principal. Supports $expand.", SerializedName = @"tokenLifetimePolicies", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy[] TokenLifetimePolicy { get => _body.TokenLifetimePolicy ?? null /* arrayOf */; set => _body.TokenLifetimePolicy = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy[] TokenLifetimePolicy { get => _body.TokenLifetimePolicy ?? null /* fixedArrayOf */; set => _body.TokenLifetimePolicy = value; } /// . [global::System.Management.Automation.AllowEmptyCollection] @@ -685,7 +695,7 @@ public partial class UpdateAzADServicePrincipal_UpdateExpanded : global::System. Description = @".", SerializedName = @"transitiveMemberOf", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject[] TransitiveMemberOf { get => _body.TransitiveMemberOf ?? null /* arrayOf */; set => _body.TransitiveMemberOf = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject[] TransitiveMemberOf { get => _body.TransitiveMemberOf ?? null /* fixedArrayOf */; set => _body.TransitiveMemberOf = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what @@ -730,7 +740,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -803,7 +835,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -873,12 +905,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ServicePrincipalsServicePrincipalUpdateServicePrincipal(Id, _body, onNoContent, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate); + await this.Client.ServicePrincipalsServicePrincipalUpdateServicePrincipal(ServicePrincipalId, _body, onNoContent, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ServicePrincipalId=ServicePrincipalId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -898,13 +930,28 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzADServicePrincipal_UpdateExpanded() { } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -932,14 +979,14 @@ public UpdateAzADServicePrincipal_UpdateExpanded() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzAdUser_UpdateExpanded.cs b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzAdUser_UpdateExpanded.cs index 1280be92284d..6e0ee3f5e500 100644 --- a/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzAdUser_UpdateExpanded.cs +++ b/generated/Resources/MSGraph.Autorest/generated/cmdlets/UpdateAzAdUser_UpdateExpanded.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell; using Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Cmdlets; using System; @@ -43,6 +44,15 @@ public partial class UpdateAzADUser_UpdateExpanded : global::System.Management.A /// A dictionary to carry over additional data for pipeline. private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// /// true for enabling the account; otherwise, false. Always true when combined with `-Password`. `-AccountEnabled $false` /// is ignored when changing the account's password. @@ -170,9 +180,10 @@ public partial class UpdateAzADUser_UpdateExpanded : global::System.Management.A public string Country { get => _body.Country ?? null; set => _body.Country = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription /// - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] [global::System.Management.Automation.ValidateNotNull] [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Azure)] @@ -347,21 +358,6 @@ public partial class UpdateAzADUser_UpdateExpanded : global::System.Management.A [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } - /// Backing field for property. - private string _id; - - /// key: id of user - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of user")] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"key: id of user", - SerializedName = @"user-id", - PossibleTypes = new [] { typeof(string) })] - [global::System.Management.Automation.Alias("UserId")] - [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] - public string Id { get => this._id; set => this._id = value; } - /// /// Represents the identities that can be used to sign in to this user account. An identity can be provided by Microsoft (also /// known as a local account), by organizations, or by social identity providers such as Facebook, Google, and Microsoft, @@ -377,7 +373,7 @@ public partial class UpdateAzADUser_UpdateExpanded : global::System.Management.A Description = @"Represents the identities that can be used to sign in to this user account. An identity can be provided by Microsoft (also known as a local account), by organizations, or by social identity providers such as Facebook, Google, and Microsoft, and tied to a user account. May contain multiple items with the same signInType value. Supports $filter (eq) only where the signInType is not userPrincipalName.", SerializedName = @"identities", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphObjectIdentity) })] - public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphObjectIdentity[] Identity { get => _body.Identity ?? null /* arrayOf */; set => _body.Identity = value; } + public Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphObjectIdentity[] Identity { get => _body.Identity ?? null /* fixedArrayOf */; set => _body.Identity = value; } /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -556,7 +552,7 @@ public partial class UpdateAzADUser_UpdateExpanded : global::System.Management.A Description = @"A list of additional email addresses for the user; for example: ['bob@contoso.com', 'Robert@fabrikam.com'].NOTE: While this property can contain accent characters, they can cause access issues to first-party applications for the user.Supports $filter (eq, NOT, ge, le, in, startsWith).", SerializedName = @"otherMails", PossibleTypes = new [] { typeof(string) })] - public string[] OtherMail { get => _body.OtherMail ?? null /* arrayOf */; set => _body.OtherMail = value; } + public string[] OtherMail { get => _body.OtherMail ?? null /* fixedArrayOf */; set => _body.OtherMail = value; } /// /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. @@ -604,7 +600,7 @@ public partial class UpdateAzADUser_UpdateExpanded : global::System.Management.A Description = @"For internal use only. Not nullable. Supports $filter (eq, not, ge, le, startsWith).", SerializedName = @"physicalIds", PossibleTypes = new [] { typeof(string) })] - public string[] PhysicalId { get => _body.PhysicalId ?? null /* arrayOf */; set => _body.PhysicalId = value; } + public string[] PhysicalId { get => _body.PhysicalId ?? null /* fixedArrayOf */; set => _body.PhysicalId = value; } /// /// The instance of the that the remote call will use. @@ -743,6 +739,20 @@ public partial class UpdateAzADUser_UpdateExpanded : global::System.Management.A PossibleTypes = new [] { typeof(string) })] public string UsageLocation { get => _body.UsageLocation ?? null; set => _body.UsageLocation = value; } + /// Backing field for property. + private string _userId; + + /// key: id of user + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "key: id of user")] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"key: id of user", + SerializedName = @"user-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.ParameterCategory.Path)] + public string UserId { get => this._userId; set => this._userId = value; } + /// /// The user principal name (UPN) of the user. The UPN is an Internet-style login name for the user based on the Internet /// standard RFC 822. By convention, this should map to the user's email name. The general format is alias@domain, where domain @@ -818,7 +828,29 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } } /// Handles/Dispatches events during the call to the REST service. @@ -891,7 +923,7 @@ protected override void EndProcessing() return ; } } - await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -961,12 +993,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.UsersUserUpdateUser(Id, _body, onNoContent, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate); + await this.Client.UsersUserUpdateUser(UserId, _body, onNoContent, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { UserId=UserId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -986,13 +1018,28 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzADUser_UpdateExpanded() { } + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + /// /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// @@ -1020,14 +1067,14 @@ public UpdateAzADUser_UpdateExpanded() { // Unrecognized Response. Create an error record based on what we have. var ex = new Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/Resources/MSGraph.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/generated/Resources/MSGraph.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..c113a03c04eb --- /dev/null +++ b/generated/Resources/MSGraph.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs @@ -0,0 +1,52 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Management.Automation; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph +{ + public class PSArgumentCompleterAttribute : ArgumentCompleterAttribute + { + internal string[] ResourceTypes; + + public PSArgumentCompleterAttribute(params string[] argumentList) : base(CreateScriptBlock(argumentList)) + { + ResourceTypes = argumentList; + } + + public static ScriptBlock CreateScriptBlock(string[] resourceTypes) + { + List outputResourceTypes = new List(); + foreach (string resourceType in resourceTypes) + { + if (resourceType.Contains(" ")) + { + outputResourceTypes.Add("\'\'" + resourceType + "\'\'"); + } + else + { + outputResourceTypes.Add(resourceType); + } + } + string scriptResourceTypeList = "'" + String.Join("' , '", outputResourceTypes) + "'"; + string script = "param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)\n" + + String.Format("$values = {0}\n", scriptResourceTypeList) + + "$values | Where-Object { $_ -Like \"$wordToComplete*\" -or $_ -Like \"'$wordToComplete*\" } | Sort-Object | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) }"; + ScriptBlock scriptBlock = ScriptBlock.Create(script); + return scriptBlock; + } + } +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index 445aa6b3f5b0..cbf108b4355e 100644 --- a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs @@ -20,11 +20,13 @@ public class ExportFormatPs1xml : PSCmdlet public string FilePath { get; set; } private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; private const string PropertiesExcludedForTableview = @""; private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + private static string SelectedBySuffix = @"#Multiple"; + protected override void ProcessRecord() { try @@ -76,7 +78,7 @@ private static View CreateViewModel(ViewParameters viewParameters) Name = viewParameters.Type.FullName, ViewSelectedBy = new ViewSelectedBy { - TypeName = viewParameters.Type.FullName + TypeName = string.Concat(viewParameters.Type.FullName, SelectedBySuffix) }, TableControl = new TableControl { diff --git a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs b/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs index 8b351f91a102..7fe603a7f9c1 100644 --- a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs +++ b/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs @@ -33,6 +33,9 @@ public class ExportHelpMarkdown : PSCmdlet [ValidateNotNullOrEmpty] public string ExamplesFolder { get; set; } + [Parameter()] + public SwitchParameter AddComplexInterfaceInfo { get; set; } + protected override void ProcessRecord() { try @@ -41,7 +44,7 @@ protected override void ProcessRecord() var variantGroups = FunctionInfo.Select(fi => fi.BaseObject).Cast() .Join(helpInfos, fi => fi.Name, phi => phi.CmdletName, (fi, phi) => fi.ToVariants(phi)) .Select(va => new VariantGroup(ModuleInfo.Name, va.First().CmdletName, va, String.Empty)); - WriteMarkdowns(variantGroups, ModuleInfo.ToModuleInfo(), DocsFolder, ExamplesFolder); + WriteMarkdowns(variantGroups, ModuleInfo.ToModuleInfo(), DocsFolder, ExamplesFolder, AddComplexInterfaceInfo.IsPresent); } catch (Exception ee) { diff --git a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index 53e99337109c..0947c897c4af 100644 --- a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs @@ -24,7 +24,7 @@ public class ExportModelSurface : PSCmdlet public bool UseExpandedFormat { get; set; } private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index df03c8c5e066..d197cb724035 100644 --- a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs @@ -52,6 +52,9 @@ public class ExportProxyCmdlet : PSCmdlet [Parameter(Mandatory = true, ParameterSetName = "NoDocs")] public SwitchParameter ExcludeDocs { get; set; } + [Parameter(ParameterSetName = "Docs")] + public SwitchParameter AddComplexInterfaceInfo { get; set; } + protected override void ProcessRecord() { try @@ -67,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(@" # ---------------------------------------------------------------------------------- @@ -111,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; @@ -163,7 +166,7 @@ protected override void ProcessRecord() var isValidProfile = !String.IsNullOrEmpty(profileName) && profileName != NoProfiles; var docsFolder = isValidProfile ? Path.Combine(DocsFolder, profileName) : DocsFolder; var examplesFolder = isValidProfile ? Path.Combine(ExamplesFolder, profileName) : ExamplesFolder; - WriteMarkdowns(variantGroupsByProfile, moduleInfo, docsFolder, examplesFolder); + WriteMarkdowns(variantGroupsByProfile, moduleInfo, docsFolder, examplesFolder, AddComplexInterfaceInfo.IsPresent); } } } diff --git a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index d47853dd6575..f42b6449c9e4 100644 --- a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/generated/Resources/MSGraph.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 @@ -163,7 +165,7 @@ protected override void ProcessRecord() if (previewVersion != null) { - sb.AppendLine($@"{Indent}{Indent}{Indent}Prerelease = {previewVersion}"); + sb.AppendLine($@"{Indent}{Indent}{Indent}Prerelease = '{previewVersion}'"); } sb.AppendLine($@"{Indent}{Indent}{Indent}Tags = {"Azure ResourceManager ARM PSModule MSGraph".Split(' ').ToPsList().NullIfEmpty() ?? "''"}"); sb.AppendLine($@"{Indent}{Indent}{Indent}LicenseUri = '{"https://aka.ms/azps-license"}'"); diff --git a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index caab6f0caeeb..0f0c728e5815 100644 --- a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,50 +12,96 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShell { - [Cmdlet(VerbsData.Export, "TestStub")] - [DoNotExport] - public class ExportTestStub : PSCmdlet - { - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string ModuleName { get; set; } - - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string ExportsFolder { get; set; } - - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string OutputFolder { get; set; } - - [Parameter] - public SwitchParameter IncludeGenerated { get; set; } - - protected override void ProcessRecord() + [Cmdlet(VerbsData.Export, "TestStub")] + [DoNotExport] + public class ExportTestStub : PSCmdlet { - try - { - if (!Directory.Exists(ExportsFolder)) - { - throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); - } + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } - var exportDirectories = Directory.GetDirectories(ExportsFolder); - if (!exportDirectories.Any()) - { - exportDirectories = new[] { ExportsFolder }; - } - var utilFile = Path.Combine(OutputFolder, "utils.ps1"); - if (!File.Exists(utilFile)) + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public SwitchParameter IncludeGenerated { get; set; } + + protected override void ProcessRecord() { - var sc = new StringBuilder(); - sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + var exportDirectories = Directory.GetDirectories(ExportsFolder); + if (!exportDirectories.Any()) + { + exportDirectories = new[] { ExportsFolder }; + } + /*var loadEnvFile = Path.Combine(OutputFolder, "loadEnv.ps1"); + if (!File.Exists(loadEnvFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@" +$envFile = 'env.json' +if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' +} + +if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) { + $envFilePath = Join-Path $PSScriptRoot $envFile +} else { + $envFilePath = Join-Path $PSScriptRoot '..\$envFile' +} +$env = @{} +if (Test-Path -Path $envFilePath) { + $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json +}"); + File.WriteAllText(loadEnvFile, sc.ToString()); + }*/ + var utilFile = Path.Combine(OutputFolder, "utils.ps1"); + if (!File.Exists(utilFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { if ($allChars) { return -join ((33..126) | Get-Random -Count $len | % {[char]$_}) } else { return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_}) } } +function Start-TestSleep { + [CmdletBinding(DefaultParameterSetName = 'SleepBySeconds')] + param( + [parameter(Mandatory = $true, Position = 0, ParameterSetName = 'SleepBySeconds')] + [ValidateRange(0.0, 2147483.0)] + [double] $Seconds, + + [parameter(Mandatory = $true, ParameterSetName = 'SleepByMilliseconds')] + [ValidateRange('NonNegative')] + [Alias('ms')] + [int] $Milliseconds + ) + + if ($TestMode -ne 'playback') { + switch ($PSCmdlet.ParameterSetName) { + 'SleepBySeconds' { + Start-Sleep -Seconds $Seconds + } + 'SleepByMilliseconds' { + Start-Sleep -Milliseconds $Milliseconds + } + } + } +} + $env = @{} if ($UsePreviousConfigForRecord) { $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json @@ -80,37 +126,40 @@ function cleanupEnv() { # Clean resources you create for testing } "); - File.WriteAllText(utilFile, sc.ToString()); - } - foreach (var exportDirectory in exportDirectories) - { - var outputFolder = OutputFolder; - if (exportDirectory != ExportsFolder) - { - outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); - Directory.CreateDirectory(outputFolder); - } - - var variantGroups = GetScriptCmdlets(exportDirectory) - .SelectMany(fi => fi.ToVariants()) - .Where(v => !v.IsDoNotExport) - .GroupBy(v => v.CmdletName) - .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) - .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); - - foreach (var variantGroup in variantGroups) - { - var sb = new StringBuilder(); - sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); - sb.AppendLine(@"{ + File.WriteAllText(utilFile, sc.ToString()); + } + + + + foreach (var exportDirectory in exportDirectories) + { + var outputFolder = OutputFolder; + if (exportDirectory != ExportsFolder) + { + outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); + Directory.CreateDirectory(outputFolder); + } + + var variantGroups = GetScriptCmdlets(exportDirectory) + .SelectMany(fi => fi.ToVariants()) + .Where(v => !v.IsDoNotExport) + .GroupBy(v => v.CmdletName) + .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) + .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); + + foreach (var variantGroup in variantGroups) + { + var sb = new StringBuilder(); + sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); + sb.AppendLine(@"{ $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' if (-Not (Test-Path -Path $loadEnvPath)) { $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' } . ($loadEnvPath)" -); - sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); - sb.AppendLine(@" $currentPath = $PSScriptRoot + ); + sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); + sb.AppendLine(@" $currentPath = $PSScriptRoot while(-not $mockingPath) { $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File $currentPath = Split-Path -Path $currentPath -Parent @@ -120,29 +169,29 @@ function cleanupEnv() { "); - sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); - var variants = variantGroup.Variants - .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) - .ToList(); + sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); + var variants = variantGroup.Variants + .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) + .ToList(); - foreach (var variant in variants) + foreach (var variant in variants) + { + sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); + sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); + var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; + sb.AppendLine($"{Indent}}}{variantSeparator}"); + } + sb.AppendLine("}"); + + File.WriteAllText(variantGroup.FilePath, sb.ToString()); + } + } + } + catch (Exception ee) { - sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); - sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); - var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; - sb.AppendLine($"{Indent}}}{variantSeparator}"); + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; } - sb.AppendLine("}"); - - File.WriteAllText(variantGroup.FilePath, sb.ToString()); - } } - } - catch (Exception ee) - { - Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); - throw ee; - } } - } } diff --git a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index 7a97e9a7fb4c..6cc79a696b8b 100644 --- a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShel { internal static class MarkdownRenderer { - public static void WriteMarkdowns(IEnumerable variantGroups, PsModuleHelpInfo moduleHelpInfo, string docsFolder, string examplesFolder) + public static void WriteMarkdowns(IEnumerable variantGroups, PsModuleHelpInfo moduleHelpInfo, string docsFolder, string examplesFolder, bool AddComplexInterfaceInfo = true) { Directory.CreateDirectory(docsFolder); var markdownInfos = variantGroups.Where(vg => !vg.IsInternal).Select(vg => new MarkdownHelpInfo(vg, examplesFolder)).OrderBy(mhi => mhi.CmdletName).ToArray(); @@ -69,24 +69,32 @@ public static void WriteMarkdowns(IEnumerable variantGroups, PsMod } sb.Append($"## NOTES{Environment.NewLine}{Environment.NewLine}"); - sb.Append($"ALIASES{Environment.NewLine}{Environment.NewLine}"); - foreach (var alias in markdownInfo.Aliases) + if (markdownInfo.Aliases.Any()) { - sb.Append($"{alias}{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"ALIASES{Environment.NewLine}{Environment.NewLine}"); } - if (markdownInfo.ComplexInterfaceInfos.Any()) + foreach (var alias in markdownInfo.Aliases) { - sb.Append($"{ComplexParameterHeader}{Environment.NewLine}"); + sb.Append($"{alias}{Environment.NewLine}{Environment.NewLine}"); } - foreach (var complexInterfaceInfo in markdownInfo.ComplexInterfaceInfos) + + if (AddComplexInterfaceInfo) { - sb.Append($"{complexInterfaceInfo.ToNoteOutput(includeDashes: true, includeBackticks: true)}{Environment.NewLine}{Environment.NewLine}"); + if (markdownInfo.ComplexInterfaceInfos.Any()) + { + sb.Append($"{ComplexParameterHeader}{Environment.NewLine}"); + } + foreach (var complexInterfaceInfo in markdownInfo.ComplexInterfaceInfos) + { + sb.Append($"{complexInterfaceInfo.ToNoteOutput(includeDashes: true, includeBackticks: true)}{Environment.NewLine}{Environment.NewLine}"); + } + } sb.Append($"## RELATED LINKS{Environment.NewLine}{Environment.NewLine}"); foreach (var relatedLink in markdownInfo.RelatedLinks) { - sb.Append($"{relatedLink}{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"[{relatedLink}]({relatedLink}){Environment.NewLine}{Environment.NewLine}"); } File.WriteAllText(Path.Combine(docsFolder, $"{markdownInfo.CmdletName}.md"), sb.ToString()); diff --git a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index 2ab11359960f..be73fb10f305 100644 --- a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/Resources/MSGraph.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; @@ -191,15 +207,22 @@ public BeginOutput(VariantGroup variantGroup) : base(variantGroup) public string GetProcessCustomAttributesAtRuntime() { - return VariantGroup.IsInternal ? "" : $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet]{Environment.NewLine}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; + return VariantGroup.IsInternal ? "" : IsAzure ? $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet] +{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){{ +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) +{Indent}{Indent}}}" : $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet]{Environment.NewLine}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; } + private string GetTelemetry() { if (!VariantGroup.IsInternal && IsAzure) { return $@" {Indent}{Indent}if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {{ -{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() {Indent}{Indent}}} {Indent}{Indent}$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId {Indent}{Indent}if ($preTelemetryId -eq '') {{ @@ -263,15 +286,35 @@ private string GetDefaultValuesStatements() var parameterName = defaultInfo.ParameterGroup.ParameterName; sb.AppendLine(); var setCondition = " "; - if (!String.IsNullOrEmpty(defaultInfo.SetCondition)) { + if (!String.IsNullOrEmpty(defaultInfo.SetCondition)) + { setCondition = $" -and {defaultInfo.SetCondition}"; } - 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}}}"); + //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}'){setCondition}) {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}$testPlayback = $false"); + sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }}"); + sb.AppendLine($"{Indent}{Indent}{Indent}if ($testPlayback) {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')"); + sb.AppendLine($"{Indent}{Indent}{Indent}}} else {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); + sb.AppendLine($"{Indent}{Indent}{Indent}}}"); + sb.Append($"{Indent}{Indent}}}"); + } + else + { + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); + sb.Append($"{Indent}{Indent}}}"); + } + } return sb.ToString(); } + } internal class ProcessOutput : BaseOutput @@ -569,7 +612,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); @@ -610,7 +655,7 @@ string RenderProperty(ComplexInterfaceInfo info, string indent, bool dash, bool return ni.IsComplexInterface ? ni.ToNoteOutput(nestedIndent, includeDashes, includeBackticks, false) : RenderProperty(ni, nestedIndent, includeDashes, includeBackticks); - }).Prepend(RenderProperty(complexInterfaceInfo, currentIndent, !isFirst && includeDashes, !isFirst && includeBackticks)); + }).Prepend(RenderProperty(complexInterfaceInfo, currentIndent, !isFirst && includeDashes, includeBackticks)); return String.Join(Environment.NewLine, nested); } } diff --git a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index ed264e23e7c3..89fb9c06265e 100644 --- a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -31,7 +31,7 @@ internal class VariantGroup { public string ModuleName { get; } - public string RootModuleName {get => @"Az.Resources";} + public string RootModuleName { get => @"Az.Resources"; } public string CmdletName { get; } public string CmdletVerb { get; } public string CmdletNoun { get; } @@ -49,7 +49,6 @@ internal class VariantGroup public PsHelpInfo HelpInfo { get; } public bool IsGenerated { get; } public bool IsInternal { get; } - public string OutputFolder { get; } public string FileName { get; } public string FilePath { get; } @@ -84,7 +83,6 @@ 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; - OutputFolder = outputFolder; FileName = $"{CmdletName}{(isTest ? ".Tests" : String.Empty)}.ps1"; FilePath = Path.Combine(OutputFolder, FileName); @@ -101,12 +99,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; @@ -135,6 +144,7 @@ internal class Variant public Parameter[] CmdletOnlyParameters { get; } public bool IsInternal { 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 +165,7 @@ 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(); + 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 +221,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 +256,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 +265,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 +298,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 +308,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 +331,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 +348,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() @@ -424,6 +437,16 @@ 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; } @@ -485,7 +508,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."; @@ -513,7 +537,7 @@ public static ComplexInterfaceInfo ToComplexInterfaceInfo(this InfoAttribute inf public static CompleterInfo ToCompleterInfo(this CompleterInfoAttribute infoAttribute) => new CompleterInfo(infoAttribute); public static CompleterInfo ToCompleterInfo(this ArgumentCompleterAttribute completerAttribute) => new CompleterInfo(completerAttribute); - + public static PSArgumentCompleterInfo ToPSArgumentCompleterInfo(this PSArgumentCompleterAttribute completerAttribute) => new PSArgumentCompleterInfo(completerAttribute); public static DefaultInfo ToDefaultInfo(this DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) => new DefaultInfo(infoAttribute, parameterGroup); public static DefaultInfo ToDefaultInfo(this PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) => new DefaultInfo(defaultValueAttribute, parameterGroup); } diff --git a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/PsAttributes.cs index 5bf78bfba7c5..74860113bbf9 100644 --- a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/PsAttributes.cs @@ -55,6 +55,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 +114,11 @@ public enum PropertyOrigin Inlined } + [AttributeUsage(AttributeTargets.Property)] + public class ConstantAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Property)] public class FormatTableAttribute : Attribute { diff --git a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/PsExtensions.cs index 3b8b12b362c4..e6ce694f8592 100644 --- a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime.PowerShel { internal static class PsExtensions { + public static PSObject AddMultipleTypeNameIntoPSObject(this object obj, string multipleTag = "#Multiple") + { + var psObj = new PSObject(obj); + psObj.TypeNames.Insert(0, $"{psObj.TypeNames[0]}{multipleTag}"); + return psObj; + } + // https://stackoverflow.com/a/863944/294804 // https://stackoverflow.com/a/4452598/294804 // https://stackoverflow.com/a/28701974/294804 diff --git a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/PsHelpers.cs index c946773f5424..3b470a0890ef 100644 --- a/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/generated/Resources/MSGraph.Autorest/generated/runtime/BuildTime/PsHelpers.cs @@ -39,9 +39,10 @@ public static IEnumerable GetModuleCmdlets(params string[] modulePa public static IEnumerable GetScriptCmdlets(PSCmdlet cmdlet, string scriptFolder) { // https://stackoverflow.com/a/40969712/294804 + var wrappedFolder = scriptFolder.Contains("'") ? $@"""{scriptFolder}""" : $@"'{scriptFolder}'"; var getCmdletsCommand = $@" $currentFunctions = Get-ChildItem function: -Get-ChildItem -Path '{scriptFolder}' -Recurse -Include '*.ps1' -File | ForEach-Object {{ . $_.FullName }} +Get-ChildItem -Path {wrappedFolder} -Recurse -Include '*.ps1' -File | ForEach-Object {{ . $_.FullName }} Get-ChildItem function: | Where-Object {{ ($currentFunctions -notcontains $_) -and $_.CmdletBinding }} "; return cmdlet?.RunScript(getCmdletsCommand) ?? RunScript(getCmdletsCommand); @@ -66,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)) @@ -87,7 +88,7 @@ public static Guid ReadGuidFromPsd1(string psd1Path) if (File.Exists(psd1Path)) { var currentGuid = File.ReadAllLines(psd1Path) - .FirstOrDefault(l => l.StartsWith(GuidStart))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) + .FirstOrDefault(l => l.TrimStart().StartsWith(GuidStart.TrimStart()))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) .LastOrDefault()?.Replace("'", String.Empty); guid = currentGuid != null ? Guid.Parse(currentGuid) : guid; } diff --git a/generated/Resources/MSGraph.Autorest/generated/runtime/ISendAsync.cs b/generated/Resources/MSGraph.Autorest/generated/runtime/ISendAsync.cs index 8b8591290445..75d50bcfe55b 100644 --- a/generated/Resources/MSGraph.Autorest/generated/runtime/ISendAsync.cs +++ b/generated/Resources/MSGraph.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime using System.Threading.Tasks; using System.Collections; using System.Linq; + using System; + /// /// The interface for sending an HTTP request across the wire. @@ -70,6 +72,7 @@ public interface ISendAsyncTerminalFactory public partial class HttpPipeline : ISendAsync { + private const int DefaultMaxRetry = 3; private ISendAsync pipeline; private ISendAsyncTerminalFactory terminal; private List steps = new List(); @@ -92,6 +95,111 @@ public HttpPipeline(ISendAsyncTerminalFactory terminalStep) /// public HttpPipeline Clone() => new HttpPipeline(terminal) { steps = this.steps.ToList(), pipeline = this.pipeline }; + private bool shouldRetry429(HttpResponseMessage response) + { + if (response.StatusCode == (System.Net.HttpStatusCode)429) + { + var retryAfter = response.Headers.RetryAfter; + if (retryAfter != null && retryAfter.Delta.HasValue) + { + return true; + } + } + return false; + } + /// + /// The step to handle 429 response with retry-after header. + /// + public async Task Retry429(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + int retryCount = int.MaxValue; + + try + { + try + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("PS_HTTP_MAX_RETRIES_FOR_429")); + } + finally + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("AZURE_PS_HTTP_MAX_RETRIES_FOR_429")); + } + } + catch (System.Exception) + { + //no action + } + var cloneRequest = await request.CloneWithContent(); + var response = await next.SendAsync(request, callback); + int count = 0; + while (shouldRetry429(response) && count++ < retryCount) + { + request = await cloneRequest.CloneWithContent(); + var retryAfter = response.Headers.RetryAfter; + await Task.Delay(retryAfter.Delta.Value, callback.Token); + await callback.Signal("Debug", $"Start to retry {count} time(s) on status code 429 after waiting {retryAfter.Delta.Value.TotalSeconds} seconds."); + response = await next.SendAsync(request, callback); + } + return response; + } + + private bool shouldRetryError(HttpResponseMessage response) + { + if (response.StatusCode >= System.Net.HttpStatusCode.InternalServerError) + { + if (response.StatusCode != System.Net.HttpStatusCode.NotImplemented && + response.StatusCode != System.Net.HttpStatusCode.HttpVersionNotSupported) + { + return true; + } + } + else if (response.StatusCode == System.Net.HttpStatusCode.RequestTimeout) + { + return true; + } + else if (response.StatusCode == (System.Net.HttpStatusCode)429 && response.Headers.RetryAfter == null) + { + return true; + } + return false; + } + + /// + /// Returns true if status code in HttpRequestExceptionWithStatus exception is greater + /// than or equal to 500 and not NotImplemented (501) or HttpVersionNotSupported (505). + /// Or it's 429 (TOO MANY REQUESTS) without Retry-After header. + /// + public async Task RetryError(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + int retryCount = DefaultMaxRetry; + + try + { + try + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("PS_HTTP_MAX_RETRIES")); + } + finally + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("AZURE_PS_HTTP_MAX_RETRIES")); + } + } + catch (System.Exception) + { + //no action + } + var cloneRequest = await request.CloneWithContent(); + var response = await next.SendAsync(request, callback); + int count = 0; + while (shouldRetryError(response) && count++ < retryCount) + { + await callback.Signal("Debug", $"Start to retry {count} time(s) on status code {response.StatusCode}"); + request = await cloneRequest.CloneWithContent(); + response = await next.SendAsync(request, callback); + } + return response; + } + public ISendAsyncTerminalFactory TerminalFactory { get => terminal; @@ -117,6 +225,11 @@ public ISendAsync Pipeline // create the pipeline from scratch. var next = terminal.Create(); + if (Convert.ToBoolean(@"true")) + { + next = (new SendAsyncFactory(Retry429)).Create(next) ?? next; + next = (new SendAsyncFactory(RetryError)).Create(next) ?? next; + } foreach (var factory in steps) { // skip factories that return null. diff --git a/generated/Resources/MSGraph.Autorest/generated/runtime/MessageAttribute.cs b/generated/Resources/MSGraph.Autorest/generated/runtime/MessageAttribute.cs index 85c2f81d47cb..e7494a466a32 100644 --- a/generated/Resources/MSGraph.Autorest/generated/runtime/MessageAttribute.cs +++ b/generated/Resources/MSGraph.Autorest/generated/runtime/MessageAttribute.cs @@ -21,7 +21,7 @@ public class GenericBreakingChangeAttribute : Attribute //The version the change is effective from, non mandatory public string DeprecateByVersion { get; } - public bool DeprecateByVersionSet { get; } = false; + public string DeprecateByAzVersion { get; } //The date on which the change comes in effect public DateTime ChangeInEfectByDate { get; } @@ -32,23 +32,18 @@ public class GenericBreakingChangeAttribute : Attribute //New way fo calling the cmdlet public string NewWay { get; set; } - public GenericBreakingChangeAttribute(string message) - { - _message = message; - } - - public GenericBreakingChangeAttribute(string message, string deprecateByVersion) + public GenericBreakingChangeAttribute(string message, string deprecateByAzVersion, string deprecateByVersion) { _message = message; + this.DeprecateByAzVersion = deprecateByAzVersion; this.DeprecateByVersion = deprecateByVersion; - this.DeprecateByVersionSet = true; } - public GenericBreakingChangeAttribute(string message, string deprecateByVersion, string changeInEfectByDate) + public GenericBreakingChangeAttribute(string message, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) { _message = message; this.DeprecateByVersion = deprecateByVersion; - this.DeprecateByVersionSet = true; + this.DeprecateByAzVersion = deprecateByAzVersion; if (DateTime.TryParse(changeInEfectByDate, new CultureInfo("en-US"), DateTimeStyles.None, out DateTime result)) { @@ -86,10 +81,8 @@ public void PrintCustomAttributeInfo(Action writeOutput) writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByDateMessage, this.ChangeInEfectByDate.ToString("d"))); } - if (DeprecateByVersionSet) - { - writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion)); - } + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByAzVersion, this.DeprecateByAzVersion)); + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion)); if (OldWay != null && NewWay != null) { @@ -114,18 +107,13 @@ public class CmdletBreakingChangeAttribute : GenericBreakingChangeAttribute public string ReplacementCmdletName { get; set; } - public CmdletBreakingChangeAttribute() : - base(string.Empty) + public CmdletBreakingChangeAttribute(string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) { } - public CmdletBreakingChangeAttribute(string deprecateByVersione) : - base(string.Empty, deprecateByVersione) - { - } - - public CmdletBreakingChangeAttribute(string deprecateByVersion, string changeInEfectByDate) : - base(string.Empty, deprecateByVersion, changeInEfectByDate) + public CmdletBreakingChangeAttribute(string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate) { } @@ -146,20 +134,15 @@ protected override string GetAttributeSpecificMessage() public class ParameterSetBreakingChangeAttribute : GenericBreakingChangeAttribute { public string[] ChangedParameterSet { set; get; } - public ParameterSetBreakingChangeAttribute(string[] changedParameterSet) : - base(string.Empty) - { - ChangedParameterSet = changedParameterSet; - } - public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByVersione) : - base(string.Empty, deprecateByVersione) + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) { ChangedParameterSet = changedParameterSet; } - public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByVersion, string changeInEfectByDate) : - base(string.Empty, deprecateByVersion, changeInEfectByDate) + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate) { ChangedParameterSet = changedParameterSet; } @@ -185,6 +168,11 @@ public class PreviewMessageAttribute : Attribute { public string _message; + public DateTime EstimatedGaDate { get; } + + public bool IsEstimatedGaDateSet { get; } = false; + + public PreviewMessageAttribute() { this._message = Resources.PreviewCmdletMessage; @@ -192,12 +180,26 @@ public PreviewMessageAttribute() public PreviewMessageAttribute(string message) { - this._message = message; + this._message = string.IsNullOrEmpty(message) ? Resources.PreviewCmdletMessage : message; } - public void PrintCustomAttributeInfo(System.Management.Automation.PSCmdlet psCmdlet) + public PreviewMessageAttribute(string message, string estimatedDateOfGa) : this(message) { - psCmdlet.WriteWarning(this._message); + if (DateTime.TryParse(estimatedDateOfGa, new CultureInfo("en-US"), DateTimeStyles.None, out DateTime result)) + { + this.EstimatedGaDate = result; + this.IsEstimatedGaDateSet = true; + } + } + + public void PrintCustomAttributeInfo(Action writeOutput) + { + writeOutput(this._message); + + if (IsEstimatedGaDateSet) + { + writeOutput(string.Format(Resources.PreviewCmdletETAMessage, this.EstimatedGaDate.ToShortDateString())); + } } public virtual bool IsApplicableToInvocation(InvocationInfo invocation) @@ -219,20 +221,14 @@ public class ParameterBreakingChangeAttribute : GenericBreakingChangeAttribute public String NewParameterType { get; set; } - public ParameterBreakingChangeAttribute(string nameOfParameterChanging) : - base(string.Empty) + public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) { this.NameOfParameterChanging = nameOfParameterChanging; } - public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByVersion) : - base(string.Empty, deprecateByVersion) - { - this.NameOfParameterChanging = nameOfParameterChanging; - } - - public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByVersion, string changeInEfectByDate) : - base(string.Empty, deprecateByVersion, changeInEfectByDate) + public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate) { this.NameOfParameterChanging = nameOfParameterChanging; } @@ -298,20 +294,14 @@ public class OutputBreakingChangeAttribute : GenericBreakingChangeAttribute public string[] NewOutputProperties { get; set; } - public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType) : - base(string.Empty) - { - this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; - } - - public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByVersion) : - base(string.Empty, deprecateByVersion) + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) { this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; } - public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByVersion, string changeInEfectByDate) : - base(string.Empty, deprecateByVersion, changeInEfectByDate) + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate) { this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; } diff --git a/generated/Resources/MSGraph.Autorest/generated/runtime/MessageAttributeHelper.cs b/generated/Resources/MSGraph.Autorest/generated/runtime/MessageAttributeHelper.cs index 4a77f865dd54..1299e55e9c48 100644 --- a/generated/Resources/MSGraph.Autorest/generated/runtime/MessageAttributeHelper.cs +++ b/generated/Resources/MSGraph.Autorest/generated/runtime/MessageAttributeHelper.cs @@ -23,6 +23,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Runtime using System.Threading.Tasks; public class MessageAttributeHelper { + private static readonly bool IsAzure = Convert.ToBoolean(@"true"); public const string BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK = "https://aka.ms/azps-changewarnings"; public const string SUPPRESS_ERROR_OR_WARNING_MESSAGE_ENV_VARIABLE_NAME = "SuppressAzurePowerShellBreakingChangeWarnings"; @@ -34,7 +35,7 @@ public class MessageAttributeHelper * the boundParameterNames is a list of parameters bound to the cmdlet at runtime, * We only process the Parameter beaking change attributes attached only params listed in this list (if present) * */ - public static void ProcessCustomAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet) + public static void ProcessCustomAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet, bool showPreviewMessage = true) { bool supressWarningOrError = false; @@ -52,37 +53,53 @@ public static void ProcessCustomAttributesAtRuntime(CommandInfo commandInfo, Inv //Do not process the attributes at runtime... The env variable to override the warning messages is set return; } + if (IsAzure && invocationInfo.BoundParameters.ContainsKey("DefaultProfile")) + { + psCmdlet.WriteWarning("The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription."); + } + + ProcessBreakingChangeAttributesAtRuntime(commandInfo, invocationInfo, parameterSet, psCmdlet); + + } + private static void ProcessBreakingChangeAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet) + { List attributes = new List(GetAllBreakingChangeAttributesInType(commandInfo, invocationInfo, parameterSet)); StringBuilder sb = new StringBuilder(); - Action appendBreakingChangeInfo = (string s) => sb.Append(s); + Action appendAttributeMessage = (string s) => sb.Append(s); if (attributes != null && attributes.Count > 0) { - appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesHeaderMessage, commandInfo.Name.Split('_')[0])); + appendAttributeMessage(string.Format(Resources.BreakingChangesAttributesHeaderMessage, commandInfo.Name.Split('_')[0])); foreach (GenericBreakingChangeAttribute attribute in attributes) { - attribute.PrintCustomAttributeInfo(appendBreakingChangeInfo); + attribute.PrintCustomAttributeInfo(appendAttributeMessage); } - appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesFooterMessage, BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK)); + appendAttributeMessage(string.Format(Resources.BreakingChangesAttributesFooterMessage, BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK)); psCmdlet.WriteWarning(sb.ToString()); } + } + + public static void ProcessPreviewMessageAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet) + { List previewAttributes = new List(GetAllPreviewAttributesInType(commandInfo, invocationInfo)); + StringBuilder sb = new StringBuilder(); + Action appendAttributeMessage = (string s) => sb.Append(s); if (previewAttributes != null && previewAttributes.Count > 0) { foreach (PreviewMessageAttribute attribute in previewAttributes) { - attribute.PrintCustomAttributeInfo(psCmdlet); + attribute.PrintCustomAttributeInfo(appendAttributeMessage); } + psCmdlet.WriteWarning(sb.ToString()); } } - /** * This function takes in a CommandInfo (CmdletInfo or FunctionInfo) * And returns all the deprecation attributes attached to it @@ -124,6 +141,12 @@ private static IEnumerable GetAllBreakingChangeA } return invocationInfo == null ? attributeList : attributeList.Where(e => e.GetType() == typeof(ParameterSetBreakingChangeAttribute) ? ((ParameterSetBreakingChangeAttribute)e).IsApplicableToInvocation(invocationInfo, parameterSet) : e.IsApplicableToInvocation(invocationInfo)); } + + public static bool ContainsPreviewAttribute(CommandInfo commandInfo, InvocationInfo invocationInfo) + { + return GetAllPreviewAttributesInType(commandInfo, invocationInfo)?.Count() > 0; + } + private static IEnumerable GetAllPreviewAttributesInType(CommandInfo commandInfo, InvocationInfo invocationInfo) { List attributeList = new List(); diff --git a/generated/Resources/MSGraph.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/generated/Resources/MSGraph.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index 2c0cb025d8ce..a80f69fc59f5 100644 --- a/generated/Resources/MSGraph.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/generated/Resources/MSGraph.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs @@ -21,6 +21,11 @@ internal XNodeArray(params JsonNode[] values) items = new List(values); } + internal XNodeArray(System.Collections.Generic.List values) + { + items = new List(values); + } + public override JsonNode this[int index] => items[index]; internal override JsonType? ElementType => null; diff --git a/generated/Resources/MSGraph.Autorest/generated/runtime/PipelineMocking.cs b/generated/Resources/MSGraph.Autorest/generated/runtime/PipelineMocking.cs index 103fb6ba7892..190b5a039978 100644 --- a/generated/Resources/MSGraph.Autorest/generated/runtime/PipelineMocking.cs +++ b/generated/Resources/MSGraph.Autorest/generated/runtime/PipelineMocking.cs @@ -259,4 +259,4 @@ public async Task SendAsync(HttpRequestMessage request, IEv } } } -} \ No newline at end of file +} diff --git a/generated/Resources/MSGraph.Autorest/generated/runtime/Properties/Resources.Designer.cs b/generated/Resources/MSGraph.Autorest/generated/runtime/Properties/Resources.Designer.cs index e9911942ee57..16f6010e8b60 100644 --- a/generated/Resources/MSGraph.Autorest/generated/runtime/Properties/Resources.Designer.cs +++ b/generated/Resources/MSGraph.Autorest/generated/runtime/Properties/Resources.Designer.cs @@ -734,7 +734,7 @@ public static string BreakingChangesAttributesInEffectByDateMessage } /// - /// Looks up a localized string similar to Note :The change is expected to take effect from the version : '{0}' + /// Looks up a localized string similar to Note :The change is expected to take effect from version : '{0}' /// ///. /// @@ -746,6 +746,19 @@ public static string BreakingChangesAttributesInEffectByVersion } } + /// + /// Looks up a localized string similar to Note :The change is expected to take effect from az version : '{0}' + /// + ///. + /// + public static string BreakingChangesAttributesInEffectByAzVersion + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesInEffectByAzVersion", resourceCulture); + } + } + /// /// Looks up a localized string similar to ```powershell ///# Old @@ -3122,7 +3135,16 @@ public static string PortalInstructionsGit } /// - /// Looks up a localized string similar to This cmdlet is in preview. The functionality may not be available in the selected subscription. + /// Looks up a localized string similar to The estimated generally available date is '{0}'.. + /// + public static string PreviewCmdletETAMessage { + get { + return ResourceManager.GetString("PreviewCmdletETAMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This cmdlet is in preview. Its behavior is subject to change based on customer feedback.. /// public static string PreviewCmdletMessage { @@ -5630,4 +5652,4 @@ public static string YesHint } } } -} +} \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/runtime/Properties/Resources.resx b/generated/Resources/MSGraph.Autorest/generated/runtime/Properties/Resources.resx index 598cd53e958a..a08a2e50172b 100644 --- a/generated/Resources/MSGraph.Autorest/generated/runtime/Properties/Resources.resx +++ b/generated/Resources/MSGraph.Autorest/generated/runtime/Properties/Resources.resx @@ -1705,7 +1705,7 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can -- The change is expected to take effect from the version : '{0}' +- The change is expected to take effect from version : '{0}' ```powershell @@ -1736,6 +1736,12 @@ The type of the parameter is changing from '{0}' to '{1}'. Note : Go to {0} for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell. - This cmdlet is in preview. The functionality may not be available in the selected subscription. + This cmdlet is in preview. Its behavior is subject to change based on customer feedback. + + + The estimated generally available date is '{0}'. + + + - The change is expected to take effect from Az version : '{0}' \ No newline at end of file diff --git a/generated/Resources/MSGraph.Autorest/generated/runtime/TypeConverterExtensions.cs b/generated/Resources/MSGraph.Autorest/generated/runtime/TypeConverterExtensions.cs index 2175bb39d004..b366a5fcfd84 100644 --- a/generated/Resources/MSGraph.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/generated/Resources/MSGraph.Autorest/generated/runtime/TypeConverterExtensions.cs @@ -62,6 +62,56 @@ internal static T[] SelectToArray(object source, System.Func return result.ToArray(); } + internal static System.Collections.Generic.List SelectToList(object source, System.Func converter) + { + // null begets null + if (source == null) + { + return null; + } + + // single values and strings are just encapsulated in the array. + if (source is string || !(source is System.Collections.IEnumerable)) + { + try + { + return new T[] { (T)converter(source) }.ToList(); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + return new T[0].ToList(); // empty result if couldn't convert. + } + + var result = new System.Collections.Generic.List(); + foreach (var each in (System.Collections.IEnumerable)source) + { + try + { + result.Add((T)converter(each)); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + } + return result; + } internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.Generic.IDictionary dictionary) { if (null != dictionary) diff --git a/generated/Resources/MSGraph.Autorest/internal/Add-AzADApplicationKey.ps1 b/generated/Resources/MSGraph.Autorest/internal/Add-AzADApplicationKey.ps1 index bc06e4c4d0ec..76153bbe8ca3 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Add-AzADApplicationKey.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Add-AzADApplicationKey.ps1 @@ -89,7 +89,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPaths17CrvdcApplicationsApplicationIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema] # . - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='AddExpanded')] @@ -102,14 +101,12 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential] # keyCredential - # To construct, see NOTES section for KEYCREDENTIAL properties and create a hash table. ${KeyCredential}, [Parameter(ParameterSetName='AddExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential] # passwordCredential - # To construct, see NOTES section for PASSWORDCREDENTIAL properties and create a hash table. ${PasswordCredential}, [Parameter(ParameterSetName='AddExpanded')] @@ -118,12 +115,25 @@ param( # . ${Proof}, + [Parameter(ParameterSetName='AddViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Add operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='AddViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Add operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -177,6 +187,8 @@ begin { $mapping = @{ Add = 'Az.MSGraph.private\Add-AzADApplicationKey_Add'; AddExpanded = 'Az.MSGraph.private\Add-AzADApplicationKey_AddExpanded'; + AddViaJsonFilePath = 'Az.MSGraph.private\Add-AzADApplicationKey_AddViaJsonFilePath'; + AddViaJsonString = 'Az.MSGraph.private\Add-AzADApplicationKey_AddViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/generated/Resources/MSGraph.Autorest/internal/Add-AzADApplicationPassword.ps1 b/generated/Resources/MSGraph.Autorest/internal/Add-AzADApplicationPassword.ps1 index 73340d1471fb..c72f88f01b0b 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Add-AzADApplicationPassword.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Add-AzADApplicationPassword.ps1 @@ -67,7 +67,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPaths141Ryo0ApplicationsApplicationIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema] # . - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='AddExpanded')] @@ -80,15 +79,27 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential] # passwordCredential - # To construct, see NOTES section for PASSWORDCREDENTIAL properties and create a hash table. ${PasswordCredential}, + [Parameter(ParameterSetName='AddViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Add operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='AddViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Add operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -142,6 +153,8 @@ begin { $mapping = @{ Add = 'Az.MSGraph.private\Add-AzADApplicationPassword_Add'; AddExpanded = 'Az.MSGraph.private\Add-AzADApplicationPassword_AddExpanded'; + AddViaJsonFilePath = 'Az.MSGraph.private\Add-AzADApplicationPassword_AddViaJsonFilePath'; + AddViaJsonString = 'Az.MSGraph.private\Add-AzADApplicationPassword_AddViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/generated/Resources/MSGraph.Autorest/internal/Add-AzADServicePrincipalKey.ps1 b/generated/Resources/MSGraph.Autorest/internal/Add-AzADServicePrincipalKey.ps1 index 86b62e871deb..e08d7d0ce50c 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Add-AzADServicePrincipalKey.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Add-AzADServicePrincipalKey.ps1 @@ -89,7 +89,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsN3Fx9GServiceprincipalsServiceprincipalIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema] # . - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='AddExpanded')] @@ -102,14 +101,12 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential] # keyCredential - # To construct, see NOTES section for KEYCREDENTIAL properties and create a hash table. ${KeyCredential}, [Parameter(ParameterSetName='AddExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential] # passwordCredential - # To construct, see NOTES section for PASSWORDCREDENTIAL properties and create a hash table. ${PasswordCredential}, [Parameter(ParameterSetName='AddExpanded')] @@ -118,12 +115,25 @@ param( # . ${Proof}, + [Parameter(ParameterSetName='AddViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Add operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='AddViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Add operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -177,6 +187,8 @@ begin { $mapping = @{ Add = 'Az.MSGraph.private\Add-AzADServicePrincipalKey_Add'; AddExpanded = 'Az.MSGraph.private\Add-AzADServicePrincipalKey_AddExpanded'; + AddViaJsonFilePath = 'Az.MSGraph.private\Add-AzADServicePrincipalKey_AddViaJsonFilePath'; + AddViaJsonString = 'Az.MSGraph.private\Add-AzADServicePrincipalKey_AddViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/generated/Resources/MSGraph.Autorest/internal/Add-AzADServicePrincipalPassword.ps1 b/generated/Resources/MSGraph.Autorest/internal/Add-AzADServicePrincipalPassword.ps1 index bb24450cf9e0..a73df4b4cc2f 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Add-AzADServicePrincipalPassword.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Add-AzADServicePrincipalPassword.ps1 @@ -67,7 +67,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsIeboplServiceprincipalsServiceprincipalIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema] # . - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='AddExpanded')] @@ -80,15 +79,27 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential] # passwordCredential - # To construct, see NOTES section for PASSWORDCREDENTIAL properties and create a hash table. ${PasswordCredential}, + [Parameter(ParameterSetName='AddViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Add operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='AddViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Add operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -142,6 +153,8 @@ begin { $mapping = @{ Add = 'Az.MSGraph.private\Add-AzADServicePrincipalPassword_Add'; AddExpanded = 'Az.MSGraph.private\Add-AzADServicePrincipalPassword_AddExpanded'; + AddViaJsonFilePath = 'Az.MSGraph.private\Add-AzADServicePrincipalPassword_AddViaJsonFilePath'; + AddViaJsonString = 'Az.MSGraph.private\Add-AzADServicePrincipalPassword_AddViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/generated/Resources/MSGraph.Autorest/internal/Az.MSGraph.internal.psm1 b/generated/Resources/MSGraph.Autorest/internal/Az.MSGraph.internal.psm1 index 21b4128f4633..a04edf92033c 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Az.MSGraph.internal.psm1 +++ b/generated/Resources/MSGraph.Autorest/internal/Az.MSGraph.internal.psm1 @@ -24,12 +24,12 @@ # Load the last folder if no profile is selected $profileDirectory = $directories | Select-Object -Last 1 } - + if($profileDirectory) { Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'" $exportsPath = $profileDirectory.FullName } - + if($exportsPath) { Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath diff --git a/generated/Resources/MSGraph.Autorest/internal/Get-AzADAppFederatedCredential.ps1 b/generated/Resources/MSGraph.Autorest/internal/Get-AzADAppFederatedCredential.ps1 index cb732d22f0fc..6deed3c83e85 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Get-AzADAppFederatedCredential.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Get-AzADAppFederatedCredential.ps1 @@ -101,7 +101,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] diff --git a/generated/Resources/MSGraph.Autorest/internal/Get-AzADApplication.ps1 b/generated/Resources/MSGraph.Autorest/internal/Get-AzADApplication.ps1 index 69af8b136a57..f3dd76287940 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Get-AzADApplication.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Get-AzADApplication.ps1 @@ -47,11 +47,10 @@ function Get-AzADApplication { [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] - [Alias('ApplicationId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] # key: id of application - ${Id}, + ${ApplicationId}, [Parameter()] [AllowEmptyCollection()] @@ -116,7 +115,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] diff --git a/generated/Resources/MSGraph.Autorest/internal/Get-AzADGroup.ps1 b/generated/Resources/MSGraph.Autorest/internal/Get-AzADGroup.ps1 index ad18228292bc..6a1eb9bff922 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Get-AzADGroup.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Get-AzADGroup.ps1 @@ -43,11 +43,10 @@ function Get-AzADGroup { [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] - [Alias('GroupId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] # key: id of group - ${Id}, + ${GroupId}, [Parameter()] [AllowEmptyCollection()] @@ -112,7 +111,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] diff --git a/generated/Resources/MSGraph.Autorest/internal/Get-AzADGroupMember.ps1 b/generated/Resources/MSGraph.Autorest/internal/Get-AzADGroupMember.ps1 index cb7103af662c..6fc9b11f4f51 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Get-AzADGroupMember.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Get-AzADGroupMember.ps1 @@ -103,7 +103,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] diff --git a/generated/Resources/MSGraph.Autorest/internal/Get-AzADServicePrincipal.ps1 b/generated/Resources/MSGraph.Autorest/internal/Get-AzADServicePrincipal.ps1 index 17164edf8b36..7bec0906f4de 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Get-AzADServicePrincipal.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Get-AzADServicePrincipal.ps1 @@ -47,11 +47,10 @@ function Get-AzADServicePrincipal { [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] - [Alias('ServicePrincipalId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] # key: id of servicePrincipal - ${Id}, + ${ServicePrincipalId}, [Parameter()] [AllowEmptyCollection()] @@ -116,7 +115,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] diff --git a/generated/Resources/MSGraph.Autorest/internal/Get-AzADUser.ps1 b/generated/Resources/MSGraph.Autorest/internal/Get-AzADUser.ps1 index 352af18d4ece..abb7d27eb8b7 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Get-AzADUser.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Get-AzADUser.ps1 @@ -41,11 +41,10 @@ function Get-AzADUser { [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] - [Alias('UserId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] # key: id of user - ${Id}, + ${UserId}, [Parameter()] [AllowEmptyCollection()] @@ -110,7 +109,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] diff --git a/generated/Resources/MSGraph.Autorest/internal/Get-AzADUserOwnedApplication.ps1 b/generated/Resources/MSGraph.Autorest/internal/Get-AzADUserOwnedApplication.ps1 index c540c0de6f11..3bc1ea1567af 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Get-AzADUserOwnedApplication.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Get-AzADUserOwnedApplication.ps1 @@ -77,7 +77,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] diff --git a/generated/Resources/MSGraph.Autorest/internal/Get-AzADUserOwnedObject.ps1 b/generated/Resources/MSGraph.Autorest/internal/Get-AzADUserOwnedObject.ps1 index 545823edf9b0..e17aafaa5586 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Get-AzADUserOwnedObject.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Get-AzADUserOwnedObject.ps1 @@ -77,7 +77,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] diff --git a/generated/Resources/MSGraph.Autorest/internal/Get-AzADUserSigned.ps1 b/generated/Resources/MSGraph.Autorest/internal/Get-AzADUserSigned.ps1 index a73818bf5775..28151f20500e 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Get-AzADUserSigned.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Get-AzADUserSigned.ps1 @@ -52,7 +52,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] diff --git a/generated/Resources/MSGraph.Autorest/internal/New-AzADAppFederatedCredential.ps1 b/generated/Resources/MSGraph.Autorest/internal/New-AzADAppFederatedCredential.ps1 index 41138bda7bc2..519b98b373b1 100644 --- a/generated/Resources/MSGraph.Autorest/internal/New-AzADAppFederatedCredential.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/New-AzADAppFederatedCredential.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Create new navigation property to federatedIdentityCredentials for applications +create new navigation property to federatedIdentityCredentials for applications .Description -Create new navigation property to federatedIdentityCredentials for applications +create new navigation property to federatedIdentityCredentials for applications .Example New-AzADAppFederatedCredential -ApplicationObjectId $appObjectId -Audience api://AzureADTokenExchange -Issuer https://login.microsoftonline.com/3d1e2be9-a10a-4a0c-8380-7ce190f98ed9/v2.0 -name 'test-cred' -Subject 'subject' @@ -37,13 +37,13 @@ param( # key: id of application ${ApplicationObjectId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Collections.Hashtable] # Additional Parameters ${AdditionalProperties}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -54,14 +54,14 @@ param( # Required. ${Audience}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The un-validated, user-provided description of the federated identity credential. # Optional. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The URL of the external identity provider and must match the issuer claim of the external token being exchanged. @@ -69,7 +69,7 @@ param( # Required. ${Issuer}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # is the unique identifier for the federated identity credential, which has a character limit of 120 characters and must be URL friendly. @@ -79,7 +79,7 @@ param( # Supports $filter (eq). ${Name}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Required. @@ -90,12 +90,25 @@ param( # Supports $filter (eq). ${Subject}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -148,6 +161,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.MSGraph.private\New-AzADAppFederatedCredential_CreateExpanded'; + CreateViaJsonFilePath = 'Az.MSGraph.private\New-AzADAppFederatedCredential_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.MSGraph.private\New-AzADAppFederatedCredential_CreateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/generated/Resources/MSGraph.Autorest/internal/New-AzADApplication.ps1 b/generated/Resources/MSGraph.Autorest/internal/New-AzADApplication.ps1 index ce5ec1a133fb..51ed5d0e8dfc 100644 --- a/generated/Resources/MSGraph.Autorest/internal/New-AzADApplication.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/New-AzADApplication.ps1 @@ -121,7 +121,7 @@ HOMEREALMDISCOVERYPOLICY : . [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -385,7 +385,7 @@ TOKENISSUANCEPOLICY : . [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -596,7 +596,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -772,64 +772,61 @@ function New-AzADApplication { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn[]] # Defines custom behavior that a consuming service can use to call an app in specific contexts. # For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. # This will let services like Office 365 call the application in the context of a document the user is working on. - # To construct, see NOTES section for ADDIN properties and create a hash table. ${AddIn}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Collections.Hashtable] # Additional Parameters ${AdditionalProperties}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApiApplication] # apiApplication - # To construct, see NOTES section for API properties and create a hash table. ${Api}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole[]] # The collection of roles assigned to the application. # With app role assignments, these roles can be assigned to users, groups, or service principals associated with other applications. # Not nullable. - # To construct, see NOTES section for APPROLE properties and create a hash table. ${AppRole}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Unique identifier of the applicationTemplate. ${ApplicationTemplateId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # . ${CreatedOnBehalfOfDeletedDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name displayed in directory ${CreatedOnBehalfOfDisplayName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # . ${DeletedDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # An optional description of the application. @@ -837,7 +834,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, startsWith) and $search. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies whether Microsoft has disabled the registered application. @@ -845,37 +842,35 @@ param( # Supports $filter (eq, ne, NOT). ${DisabledByMicrosoftStatus}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name displayed in directory ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential[]] # Federated identities for applications. # Supports $expand and $filter (eq when counting empty collections). - # To construct, see NOTES section for FEDERATEDIDENTITYCREDENTIALS properties and create a hash table. ${FederatedIdentityCredentials}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Configures the groups claim issued in a user or OAuth 2.0 access token that the application expects. # To set this attribute, use one of the following string values: None, SecurityGroup (for security groups and Azure AD roles), All (this gets all security groups, distribution groups, and Azure AD directory roles that the signed-in user is a member of). ${GroupMembershipClaim}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy[]] # . - # To construct, see NOTES section for HOMEREALMDISCOVERYPOLICY properties and create a hash table. ${HomeRealmDiscoveryPolicy}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -886,21 +881,20 @@ param( # Supports $filter (eq, ne, ge, le, startsWith). ${IdentifierUri}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphInformationalUrl] # informationalUrl - # To construct, see NOTES section for INFO properties and create a hash table. ${Info}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Specifies whether this application supports device authentication without a user. # The default is false. ${IsDeviceOnlyAuthSupported}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Specifies the fallback application type as public client, such as an installed application running on a mobile device. @@ -910,66 +904,61 @@ param( # In those cases Azure AD interprets the application type based on the value of this property. ${IsFallbackPublicClient}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential[]] # The collection of key credentials associated with the application. # Not nullable. # Supports $filter (eq, NOT, ge, le). - # To construct, see NOTES section for KEYCREDENTIALS properties and create a hash table. ${KeyCredentials}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Input File for Logo (The main logo for the application. # Not nullable.) ${LogoInputFile}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Notes relevant for the management of the application. ${Note}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # . ${Oauth2RequirePostResponse}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOptionalClaims] # optionalClaims - # To construct, see NOTES section for OPTIONALCLAIM properties and create a hash table. ${OptionalClaim}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphParentalControlSettings] # parentalControlSettings - # To construct, see NOTES section for PARENTALCONTROLSETTING properties and create a hash table. ${ParentalControlSetting}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential[]] # The collection of password credentials associated with the application. # Not nullable. - # To construct, see NOTES section for PASSWORDCREDENTIALS properties and create a hash table. ${PasswordCredentials}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPublicClientApplication] # publicClientApplication - # To construct, see NOTES section for PUBLICCLIENT properties and create a hash table. ${PublicClient}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphRequiredResourceAccess[]] @@ -978,17 +967,16 @@ param( # This configuration of access to the required resources drives the consent experience. # Not nullable. # Supports $filter (eq, NOT, ge, le). - # To construct, see NOTES section for REQUIREDRESOURCEACCESS properties and create a hash table. ${RequiredResourceAccess}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # References application or service contact information from a Service or Asset Management database. # Nullable. ${ServiceManagementReference}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the Microsoft accounts that are supported for the current application. @@ -997,14 +985,13 @@ param( # Supports $filter (eq, ne, NOT). ${SignInAudience}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphSpaApplication] # spaApplication - # To construct, see NOTES section for SPA properties and create a hash table. ${Spa}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -1012,7 +999,7 @@ param( # Not nullable.Supports $filter (eq, NOT, ge, le, startsWith). ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the keyId of a public key from the keyCredentials collection. @@ -1020,36 +1007,46 @@ param( # The application code that receives the encrypted token must use the matching private key to decrypt the token before it can be used for the signed-in user. ${TokenEncryptionKeyId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy[]] # . - # To construct, see NOTES section for TOKENISSUANCEPOLICY properties and create a hash table. ${TokenIssuancePolicy}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy[]] # The tokenLifetimePolicies assigned to this application. # Supports $expand. - # To construct, see NOTES section for TOKENLIFETIMEPOLICY properties and create a hash table. ${TokenLifetimePolicy}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphWebApplication] # webApplication - # To construct, see NOTES section for WEB properties and create a hash table. ${Web}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1102,6 +1099,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.MSGraph.private\New-AzADApplication_CreateExpanded'; + CreateViaJsonFilePath = 'Az.MSGraph.private\New-AzADApplication_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.MSGraph.private\New-AzADApplication_CreateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/generated/Resources/MSGraph.Autorest/internal/New-AzADGroup.ps1 b/generated/Resources/MSGraph.Autorest/internal/New-AzADGroup.ps1 index 352cd2b783e4..7b549f4d88fd 100644 --- a/generated/Resources/MSGraph.Autorest/internal/New-AzADGroup.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/New-AzADGroup.ps1 @@ -59,22 +59,21 @@ function New-AzADGroup { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Collections.Hashtable] # Additional Parameters ${AdditionalProperties}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentAutoGenerated[]] # Represents the app roles a group has been granted for an application. # Supports $expand. - # To construct, see NOTES section for APPROLEASSIGNMENT properties and create a hash table. ${AppRoleAssignment}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Describes a classification for the group (such as low, medium or high business impact). @@ -82,21 +81,20 @@ param( # Supports $filter (eq, ne, NOT, ge, le, startsWith). ${Classification}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject] # Represents an Azure Active Directory object. # The directoryObject type is the base type for many other directory entity types. - # To construct, see NOTES section for CREATEDONBEHALFOF properties and create a hash table. ${CreatedOnBehalfOf}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # . ${DeletedDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # An optional description for the group. @@ -104,13 +102,13 @@ param( # Supports $filter (eq, ne, NOT, ge, le, startsWith) and $search. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name displayed in directory ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -121,7 +119,7 @@ param( # Supports $filter (eq, NOT). ${GroupType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether there are members in this group that have license errors from its group-based license assignment. @@ -130,13 +128,13 @@ param( # Supports $filter (eq). ${HasMembersWithLicenseError}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # . ${IsArchived}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether this group can be assigned to an Azure Active Directory role.This property can only be set while creating the group and is immutable. @@ -147,7 +145,7 @@ param( # Supports $filter (eq, ne, NOT). ${IsAssignableToRole}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Specifies whether the group is mail-enabled. @@ -155,7 +153,7 @@ param( # Supports $filter (eq, ne, NOT). ${MailEnabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The mail alias for the group, unique in the organization. @@ -165,7 +163,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${MailNickname}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The rule that determines members for this group if the group is a dynamic group (groupTypes contains DynamicMembership). @@ -174,7 +172,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, startsWith). ${MembershipRule}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Indicates whether the dynamic membership processing is on or paused. @@ -183,16 +181,15 @@ param( # Supports $filter (eq, ne, NOT, in). ${MembershipRuleProcessingState}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphResourceSpecificPermissionGrant[]] # The permissions that have been granted for a group to a specific application. # Supports $expand. - # To construct, see NOTES section for PERMISSIONGRANT properties and create a hash table. ${PermissionGrant}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The preferred data location for the group. @@ -200,7 +197,7 @@ param( # Returned by default. ${PreferredDataLocation}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The preferred language for a Microsoft 365 group. @@ -209,7 +206,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${PreferredLanguage}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Specifies whether the group is a security group. @@ -217,14 +214,14 @@ param( # Supports $filter (eq, ne, NOT, in). ${SecurityEnabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Security identifier of the group, used in Windows scenarios. # Returned by default. ${SecurityIdentifier}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies a Microsoft 365 group's color theme. @@ -232,7 +229,7 @@ param( # Returned by default. ${Theme}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the group join policy and group content visibility for groups. @@ -245,12 +242,25 @@ param( # Returned by default. ${Visibility}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -303,6 +313,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.MSGraph.private\New-AzADGroup_CreateExpanded'; + CreateViaJsonFilePath = 'Az.MSGraph.private\New-AzADGroup_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.MSGraph.private\New-AzADGroup_CreateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/generated/Resources/MSGraph.Autorest/internal/New-AzADGroupGraphRefMember.ps1 b/generated/Resources/MSGraph.Autorest/internal/New-AzADGroupGraphRefMember.ps1 index afead71f879c..3c2f02be1b8b 100644 --- a/generated/Resources/MSGraph.Autorest/internal/New-AzADGroupGraphRefMember.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/New-AzADGroupGraphRefMember.ps1 @@ -62,12 +62,25 @@ param( # Additional Parameters ${AdditionalProperties}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -127,6 +140,8 @@ begin { $mapping = @{ Create = 'Az.MSGraph.private\New-AzADGroupGraphRefMember_Create'; CreateExpanded = 'Az.MSGraph.private\New-AzADGroupGraphRefMember_CreateExpanded'; + CreateViaJsonFilePath = 'Az.MSGraph.private\New-AzADGroupGraphRefMember_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.MSGraph.private\New-AzADGroupGraphRefMember_CreateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/generated/Resources/MSGraph.Autorest/internal/New-AzADGroupOwnerGraphBPreRef.ps1 b/generated/Resources/MSGraph.Autorest/internal/New-AzADGroupOwnerGraphBPreRef.ps1 index 5043339d4c26..d0fb09b40db6 100644 --- a/generated/Resources/MSGraph.Autorest/internal/New-AzADGroupOwnerGraphBPreRef.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/New-AzADGroupOwnerGraphBPreRef.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Create new navigation property ref to owners for groups +create new navigation property ref to owners for groups .Description -Create new navigation property ref to owners for groups +create new navigation property ref to owners for groups .Example {{ Add code here }} .Example @@ -56,7 +56,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] diff --git a/generated/Resources/MSGraph.Autorest/internal/New-AzADOrganization.ps1 b/generated/Resources/MSGraph.Autorest/internal/New-AzADOrganization.ps1 index cb858557c181..2b6e0f17cc5b 100644 --- a/generated/Resources/MSGraph.Autorest/internal/New-AzADOrganization.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/New-AzADOrganization.ps1 @@ -90,7 +90,7 @@ BODY : organization [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -182,7 +182,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganization] # organization - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='CreateExpanded')] @@ -197,14 +196,12 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAssignedPlan[]] # The collection of service plans associated with the tenant. # Not nullable. - # To construct, see NOTES section for ASSIGNEDPLAN properties and create a hash table. ${AssignedPlan}, [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganizationalBranding] # organizationalBranding - # To construct, see NOTES section for BRANDING properties and create a hash table. ${Branding}, [Parameter(ParameterSetName='CreateExpanded')] @@ -221,7 +218,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphCertificateBasedAuthConfiguration[]] # Navigation property to manage certificate-based authentication configuration. # Only a single instance of certificateBasedAuthConfiguration can be created in the collection. - # To construct, see NOTES section for CERTIFICATEBASEDAUTHCONFIGURATION properties and create a hash table. ${CertificateBasedAuthConfiguration}, [Parameter(ParameterSetName='CreateExpanded')] @@ -271,7 +267,6 @@ param( # The collection of open extensions defined for the organization. # Read-only. # Nullable. - # To construct, see NOTES section for EXTENSION properties and create a hash table. ${Extension}, [Parameter(ParameterSetName='CreateExpanded')] @@ -282,9 +277,9 @@ param( ${MarketingNotificationEmail}, [Parameter(ParameterSetName='CreateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority])] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PSArgumentCompleterAttribute("unknown", "intune", "sccm", "office365")] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority] + [System.String] # Mobile device management authority. ${MobileDeviceManagementAuthority}, @@ -322,7 +317,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPrivacyProfile] # privacyProfile - # To construct, see NOTES section for PRIVACYPROFILE properties and create a hash table. ${PrivacyProfile}, [Parameter(ParameterSetName='CreateExpanded')] @@ -330,7 +324,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphProvisionedPlan[]] # Not nullable. - # To construct, see NOTES section for PROVISIONEDPLAN properties and create a hash table. ${ProvisionedPlan}, [Parameter(ParameterSetName='CreateExpanded')] @@ -378,15 +371,27 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphVerifiedDomain[]] # The collection of domains associated with this tenant. # Not nullable. - # To construct, see NOTES section for VERIFIEDDOMAIN properties and create a hash table. ${VerifiedDomain}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -440,6 +445,8 @@ begin { $mapping = @{ Create = 'Az.MSGraph.private\New-AzADOrganization_Create'; CreateExpanded = 'Az.MSGraph.private\New-AzADOrganization_CreateExpanded'; + CreateViaJsonFilePath = 'Az.MSGraph.private\New-AzADOrganization_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.MSGraph.private\New-AzADOrganization_CreateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/generated/Resources/MSGraph.Autorest/internal/New-AzADServicePrincipal.ps1 b/generated/Resources/MSGraph.Autorest/internal/New-AzADServicePrincipal.ps1 index 6c79217f7bbd..64e9d8650322 100644 --- a/generated/Resources/MSGraph.Autorest/internal/New-AzADServicePrincipal.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/New-AzADServicePrincipal.ps1 @@ -115,7 +115,7 @@ CLAIMSMAPPINGPOLICY : The claimsMappingPol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -348,7 +348,7 @@ HOMEREALMDISCOVERYPOLICY : The homeRe [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -598,7 +598,7 @@ TOKENISSUANCEPOLICY : The tokenIssuancePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -809,7 +809,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -979,30 +979,29 @@ function New-AzADServicePrincipal { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # true if the service principal account is enabled; otherwise, false. # Supports $filter (eq, ne, NOT, in). ${AccountEnabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn[]] # Defines custom behavior that a consuming service can use to call an app in specific contexts. # For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. # This will let services like Microsoft 365 call the application in the context of a document the user is working on. - # To construct, see NOTES section for ADDIN properties and create a hash table. ${AddIn}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Collections.Hashtable] # Additional Parameters ${AdditionalProperties}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -1010,59 +1009,56 @@ param( # Supports $filter (eq, NOT, ge, le, startsWith). ${AlternativeName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The description exposed by the associated application. ${AppDescription}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The display name exposed by the associated application. ${AppDisplayName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The unique identifier for the associated application (its appId property). ${AppId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Contains the tenant id where the application is registered. # This is applicable only to service principals backed by applications.Supports $filter (eq, ne, NOT, ge, le). ${AppOwnerOrganizationId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole[]] # The roles exposed by the application which this service principal represents. # For more information see the appRoles property definition on the application entity. # Not nullable. - # To construct, see NOTES section for APPROLE properties and create a hash table. ${AppRole}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment[]] # App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. - # To construct, see NOTES section for APPROLEASSIGNEDTO properties and create a hash table. ${AppRoleAssignedTo}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment[]] # App role assignment for another app or service, granted to this service principal. # Supports $expand. - # To construct, see NOTES section for APPROLEASSIGNMENT properties and create a hash table. ${AppRoleAssignment}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Specifies whether users or other service principals need to be granted an app role assignment for this service principal before users can sign in or apps can get tokens. @@ -1071,31 +1067,29 @@ param( # Supports $filter (eq, ne, NOT). ${AppRoleAssignmentRequired}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphClaimsMappingPolicy[]] # The claimsMappingPolicies assigned to this service principal. # Supports $expand. - # To construct, see NOTES section for CLAIMSMAPPINGPOLICY properties and create a hash table. ${ClaimsMappingPolicy}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDelegatedPermissionClassification[]] # The permission classifications for delegated permissions exposed by the app that this service principal represents. # Supports $expand. - # To construct, see NOTES section for DELEGATEDPERMISSIONCLASSIFICATION properties and create a hash table. ${DelegatedPermissionClassification}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # . ${DeletedDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Free text field to provide an internal end-user facing description of the service principal. @@ -1104,7 +1098,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, startsWith) and $search. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies whether Microsoft has disabled the registered application. @@ -1112,62 +1106,57 @@ param( # Supports $filter (eq, ne, NOT). ${DisabledByMicrosoftStatus}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name displayed in directory ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEndpoint[]] # Endpoints available for discovery. # Services like Sharepoint populate this property with a tenant specific SharePoint endpoints that other applications can discover and use in their experiences. - # To construct, see NOTES section for ENDPOINT properties and create a hash table. ${Endpoint}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential[]] # . - # To construct, see NOTES section for FEDERATEDIDENTITYCREDENTIALS properties and create a hash table. ${FederatedIdentityCredentials}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy[]] # The homeRealmDiscoveryPolicies assigned to this service principal. # Supports $expand. - # To construct, see NOTES section for HOMEREALMDISCOVERYPOLICY properties and create a hash table. ${HomeRealmDiscoveryPolicy}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Home page or landing page of the application. ${Homepage}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphInformationalUrl] # informationalUrl - # To construct, see NOTES section for INFO properties and create a hash table. ${Info}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential[]] # The collection of key credentials associated with the service principal. # Not nullable. # Supports $filter (eq, NOT, ge, le). - # To construct, see NOTES section for KEYCREDENTIALS properties and create a hash table. ${KeyCredentials}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the URL where the service provider redirects the user to Azure AD to authenticate. @@ -1176,20 +1165,20 @@ param( # The user launches the application from Microsoft 365, the Azure AD My Apps, or the Azure AD SSO URL. ${LoginUrl}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the URL that will be used by Microsoft's authorization service to logout an user using OpenId Connect front-channel, back-channel or SAML logout protocols. ${LogoutUrl}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Free text field to capture information about the service principal, typically used for operational purposes. # Maximum allowed size is 1024 characters. ${Note}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -1197,26 +1186,24 @@ param( # This is only for the certificates used to sign the SAML token issued for Azure AD Gallery applications. ${NotificationEmailAddress}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPermissionScope[]] # The delegated permissions exposed by the application. # For more information see the oauth2PermissionScopes property on the application entity's api property. # Not nullable. - # To construct, see NOTES section for OAUTH2PERMISSIONSCOPE properties and create a hash table. ${Oauth2PermissionScope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential[]] # The collection of password credentials associated with the service principal. # Not nullable. - # To construct, see NOTES section for PASSWORDCREDENTIALS properties and create a hash table. ${PasswordCredentials}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the single sign-on mode configured for this application. @@ -1224,7 +1211,7 @@ param( # The supported values are password, saml, notSupported, and oidc. ${PreferredSingleSignOnMode}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Reserved for internal use only. @@ -1232,7 +1219,7 @@ param( # May be removed in future versions. ${PreferredTokenSigningKeyThumbprint}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -1240,14 +1227,13 @@ param( # Not nullable. ${ReplyUrl}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphSamlSingleSignOnSettings] # samlSingleSignOnSettings - # To construct, see NOTES section for SAMLSINGLESIGNONSETTING properties and create a hash table. ${SamlSingleSignOnSetting}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -1259,7 +1245,7 @@ param( # Supports $filter (eq, NOT, ge, le, startsWith). ${ServicePrincipalName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Identifies if the service principal represents an application or a managed identity. @@ -1268,7 +1254,7 @@ param( # For a service principal that represent a managed identity this is set as ManagedIdentity. ${ServicePrincipalType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -1277,7 +1263,7 @@ param( # Supports $filter (eq, NOT, ge, le, startsWith). ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the keyId of a public key from the keyCredentials collection. @@ -1285,38 +1271,48 @@ param( # The application code that receives the encrypted token must use the matching private key to decrypt the token before it can be used for the signed-in user. ${TokenEncryptionKeyId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy[]] # The tokenIssuancePolicies assigned to this service principal. # Supports $expand. - # To construct, see NOTES section for TOKENISSUANCEPOLICY properties and create a hash table. ${TokenIssuancePolicy}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy[]] # The tokenLifetimePolicies assigned to this service principal. # Supports $expand. - # To construct, see NOTES section for TOKENLIFETIMEPOLICY properties and create a hash table. ${TokenLifetimePolicy}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject[]] # . - # To construct, see NOTES section for TRANSITIVEMEMBEROF properties and create a hash table. ${TransitiveMemberOf}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1369,6 +1365,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.MSGraph.private\New-AzADServicePrincipal_CreateExpanded'; + CreateViaJsonFilePath = 'Az.MSGraph.private\New-AzADServicePrincipal_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.MSGraph.private\New-AzADServicePrincipal_CreateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/generated/Resources/MSGraph.Autorest/internal/New-AzADServicePrincipalAppRoleAssignment.ps1 b/generated/Resources/MSGraph.Autorest/internal/New-AzADServicePrincipalAppRoleAssignment.ps1 index cd12a19c0398..63fca65bdba4 100644 --- a/generated/Resources/MSGraph.Autorest/internal/New-AzADServicePrincipalAppRoleAssignment.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/New-AzADServicePrincipalAppRoleAssignment.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Create new navigation property to appRoleAssignments for servicePrincipals +create new navigation property to appRoleAssignments for servicePrincipals .Description -Create new navigation property to appRoleAssignments for servicePrincipals +create new navigation property to appRoleAssignments for servicePrincipals .Example New-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 -ResourceId 351fa797-c81a-4998-9720-4c2ecb6c7abc -AppRoleId 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 .Example @@ -59,7 +59,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment] # Represents an Azure Active Directory object. # The directoryObject type is the base type for many other directory entity types. - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='CreateExpanded')] @@ -104,12 +103,25 @@ param( # Supports $filter (eq only). ${ResourceId}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -163,6 +175,8 @@ begin { $mapping = @{ Create = 'Az.MSGraph.private\New-AzADServicePrincipalAppRoleAssignment_Create'; CreateExpanded = 'Az.MSGraph.private\New-AzADServicePrincipalAppRoleAssignment_CreateExpanded'; + CreateViaJsonFilePath = 'Az.MSGraph.private\New-AzADServicePrincipalAppRoleAssignment_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.MSGraph.private\New-AzADServicePrincipalAppRoleAssignment_CreateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/generated/Resources/MSGraph.Autorest/internal/New-AzADUser.ps1 b/generated/Resources/MSGraph.Autorest/internal/New-AzADUser.ps1 index 5f8ea2f56cb8..91ab14f64d4b 100644 --- a/generated/Resources/MSGraph.Autorest/internal/New-AzADUser.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/New-AzADUser.ps1 @@ -60,7 +60,7 @@ function New-AzADUser { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # true if the account is enabled; otherwise, false. @@ -68,13 +68,13 @@ param( # Supports $filter (eq, ne, NOT, and in). ${AccountEnabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Collections.Hashtable] # Additional Parameters ${AdditionalProperties}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Sets the age group of the user. @@ -83,7 +83,7 @@ param( # Supports $filter (eq, ne, NOT, and in). ${AgeGroup}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # The timestamp type represents date and time information using ISO 8601 format and is always in UTC time. @@ -92,7 +92,7 @@ param( # Supports $filter (eq, ne, not, ge, le, and eq on null values) and $orderBy. ${ApproximateLastSignInDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The city in which the user is located. @@ -100,7 +100,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${City}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The company name which the user is associated. @@ -108,7 +108,7 @@ param( # The maximum length of the company name is 64 characters.Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${CompanyName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # The timestamp when the device is no longer deemed compliant. @@ -117,7 +117,7 @@ param( # Read-only. ${ComplianceExpirationDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Sets whether consent has been obtained for minors. @@ -126,7 +126,7 @@ param( # Supports $filter (eq, ne, NOT, and in). ${ConsentProvidedForMinor}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The country/region in which the user is located; for example, US or UK. @@ -134,53 +134,52 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${Country}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # . ${DeletedDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name for the department in which the user works. # Maximum length is 64 characters.Supports $filter (eq, ne, NOT , ge, le, and in operators). ${Department}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Int32] # For internal use only. ${DeviceVersion}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name displayed in directory ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # The date and time when the user was hired or will start work in case of a future hire. # Supports $filter (eq, ne, NOT , ge, le, in). ${EmployeeHireDate}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The employee identifier assigned to the user by the organization. # Supports $filter (eq, ne, NOT , ge, le, in, startsWith). ${EmployeeId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEmployeeOrgData] # employeeOrgData - # To construct, see NOTES section for EMPLOYEEORGDATA properties and create a hash table. ${EmployeeOrgData}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Captures enterprise worker type. @@ -188,7 +187,7 @@ param( # Supports $filter (eq, ne, NOT , ge, le, in, startsWith). ${EmployeeType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # For an external user invited to the tenant using the invitation API, this property represents the invited user's invitation status. @@ -196,21 +195,21 @@ param( # Supports $filter (eq, ne, NOT , in). ${ExternalUserState}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # Shows the timestamp for the latest change to the externalUserState property. # Supports $filter (eq, ne, NOT , in). ${ExternalUserStateChangeDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The fax number of the user. # Supports $filter (eq, ne, NOT , ge, le, in, startsWith). ${FaxNumber}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The given name (first name) of the user. @@ -218,7 +217,7 @@ param( # Supports $filter (eq, ne, NOT , ge, le, in, startsWith). ${GivenName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphObjectIdentity[]] @@ -226,16 +225,15 @@ param( # An identity can be provided by Microsoft (also known as a local account), by organizations, or by social identity providers such as Facebook, Google, and Microsoft, and tied to a user account. # May contain multiple items with the same signInType value. # Supports $filter (eq) only where the signInType is not userPrincipalName. - # To construct, see NOTES section for IDENTITY properties and create a hash table. ${Identity}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Do not use - reserved for future use. ${IsResourceAccount}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The user's job title. @@ -243,7 +241,7 @@ param( # Supports $filter (eq, ne, NOT , ge, le, in, startsWith). ${JobTitle}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The SMTP address for the user, for example, admin@contoso.com. @@ -252,7 +250,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith, endsWith). ${Mail}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The mail alias for the user. @@ -261,15 +259,14 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${MailNickname}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject] # Represents an Azure Active Directory object. # The directoryObject type is the base type for many other directory entity types. - # To construct, see NOTES section for MANAGER properties and create a hash table. ${Manager}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The office location in the user's place of business. @@ -277,7 +274,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${OfficeLocation}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # This property is used to associate an on-premises Active Directory user account to their Azure AD user object. @@ -287,7 +284,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in).. ${OnPremisesImmutableId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # The last time at which the object was synced with the on-premises directory. @@ -296,7 +293,7 @@ param( # Supports $filter (eq, ne, not, ge, le, in). ${OnPremisesLastSyncDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced; null if this object has never been synced from an on-premises directory (default). @@ -304,7 +301,7 @@ param( # Supports $filter (eq, ne, not, in, and eq on null values). ${OnPremisesSyncEnabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Operating system of the device. @@ -312,7 +309,7 @@ param( # This property is read-only. ${OperatingSystem}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Operating system version of the device. @@ -320,14 +317,14 @@ param( # Supports $filter (eq, ne, not, ge, le, startsWith, and eq on null values). ${OperatingSystemVersion}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] # A list of additional email addresses for the user; for example: ['bob@contoso.com', 'Robert@fabrikam.com'].NOTE: While this property can contain accent characters, they can cause access issues to first-party applications for the user.Supports $filter (eq, NOT, ge, le, in, startsWith). ${OtherMail}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies password policies for the user. @@ -336,14 +333,13 @@ param( # The two may be specified together; for example: DisablePasswordExpiration, DisableStrongPassword.Supports $filter (ne, NOT). ${PasswordPolicy}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordProfile] # passwordProfile - # To construct, see NOTES section for PASSWORDPROFILE properties and create a hash table. ${PasswordProfile}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -352,7 +348,7 @@ param( # Supports $filter (eq, not, ge, le, startsWith). ${PhysicalId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The postal code for the user's postal address. @@ -362,7 +358,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${PostalCode}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The preferred language for the user. @@ -370,7 +366,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${PreferredLanguage}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # true if the Outlook global address list should contain this user, otherwise false. @@ -379,7 +375,7 @@ param( # Supports $filter (eq, ne, NOT, in). ${ShowInAddressList}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The state or province in the user's address. @@ -387,7 +383,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${State}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The street address of the user's place of business. @@ -395,7 +391,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${StreetAddress}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The user's surname (family name or last name). @@ -403,7 +399,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${Surname}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Type of trust for the joined device. @@ -412,7 +408,7 @@ param( # For more details, see Introduction to device management in Azure Active Directory ${TrustType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # A two letter country code (ISO standard 3166). @@ -422,7 +418,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${UsageLocation}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The user principal name (UPN) of the user. @@ -434,19 +430,32 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith, endsWith) and $orderBy. ${UserPrincipalName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # A string value that can be used to classify user types in your directory, such as Member and Guest. # Supports $filter (eq, ne, NOT, in,). ${UserType}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -499,6 +508,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.MSGraph.private\New-AzADUser_CreateExpanded'; + CreateViaJsonFilePath = 'Az.MSGraph.private\New-AzADUser_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.MSGraph.private\New-AzADUser_CreateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/generated/Resources/MSGraph.Autorest/internal/ProxyCmdletDefinitions.ps1 b/generated/Resources/MSGraph.Autorest/internal/ProxyCmdletDefinitions.ps1 index 0065b2c86d16..772e101404bc 100644 --- a/generated/Resources/MSGraph.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -89,7 +89,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPaths17CrvdcApplicationsApplicationIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema] # . - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='AddExpanded')] @@ -102,14 +101,12 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential] # keyCredential - # To construct, see NOTES section for KEYCREDENTIAL properties and create a hash table. ${KeyCredential}, [Parameter(ParameterSetName='AddExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential] # passwordCredential - # To construct, see NOTES section for PASSWORDCREDENTIAL properties and create a hash table. ${PasswordCredential}, [Parameter(ParameterSetName='AddExpanded')] @@ -118,12 +115,25 @@ param( # . ${Proof}, + [Parameter(ParameterSetName='AddViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Add operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='AddViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Add operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -177,6 +187,8 @@ begin { $mapping = @{ Add = 'Az.MSGraph.private\Add-AzADApplicationKey_Add'; AddExpanded = 'Az.MSGraph.private\Add-AzADApplicationKey_AddExpanded'; + AddViaJsonFilePath = 'Az.MSGraph.private\Add-AzADApplicationKey_AddViaJsonFilePath'; + AddViaJsonString = 'Az.MSGraph.private\Add-AzADApplicationKey_AddViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -262,7 +274,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPaths141Ryo0ApplicationsApplicationIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema] # . - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='AddExpanded')] @@ -275,15 +286,27 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential] # passwordCredential - # To construct, see NOTES section for PASSWORDCREDENTIAL properties and create a hash table. ${PasswordCredential}, + [Parameter(ParameterSetName='AddViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Add operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='AddViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Add operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -337,6 +360,8 @@ begin { $mapping = @{ Add = 'Az.MSGraph.private\Add-AzADApplicationPassword_Add'; AddExpanded = 'Az.MSGraph.private\Add-AzADApplicationPassword_AddExpanded'; + AddViaJsonFilePath = 'Az.MSGraph.private\Add-AzADApplicationPassword_AddViaJsonFilePath'; + AddViaJsonString = 'Az.MSGraph.private\Add-AzADApplicationPassword_AddViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -444,7 +469,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsN3Fx9GServiceprincipalsServiceprincipalIdMicrosoftGraphAddkeyPostRequestbodyContentApplicationJsonSchema] # . - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='AddExpanded')] @@ -457,14 +481,12 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential] # keyCredential - # To construct, see NOTES section for KEYCREDENTIAL properties and create a hash table. ${KeyCredential}, [Parameter(ParameterSetName='AddExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential] # passwordCredential - # To construct, see NOTES section for PASSWORDCREDENTIAL properties and create a hash table. ${PasswordCredential}, [Parameter(ParameterSetName='AddExpanded')] @@ -473,12 +495,25 @@ param( # . ${Proof}, + [Parameter(ParameterSetName='AddViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Add operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='AddViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Add operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -532,6 +567,8 @@ begin { $mapping = @{ Add = 'Az.MSGraph.private\Add-AzADServicePrincipalKey_Add'; AddExpanded = 'Az.MSGraph.private\Add-AzADServicePrincipalKey_AddExpanded'; + AddViaJsonFilePath = 'Az.MSGraph.private\Add-AzADServicePrincipalKey_AddViaJsonFilePath'; + AddViaJsonString = 'Az.MSGraph.private\Add-AzADServicePrincipalKey_AddViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -617,7 +654,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsIeboplServiceprincipalsServiceprincipalIdMicrosoftGraphAddpasswordPostRequestbodyContentApplicationJsonSchema] # . - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='AddExpanded')] @@ -630,15 +666,27 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential] # passwordCredential - # To construct, see NOTES section for PASSWORDCREDENTIAL properties and create a hash table. ${PasswordCredential}, + [Parameter(ParameterSetName='AddViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Add operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='AddViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Add operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -692,6 +740,8 @@ begin { $mapping = @{ Add = 'Az.MSGraph.private\Add-AzADServicePrincipalPassword_Add'; AddExpanded = 'Az.MSGraph.private\Add-AzADServicePrincipalPassword_AddExpanded'; + AddViaJsonFilePath = 'Az.MSGraph.private\Add-AzADServicePrincipalPassword_AddViaJsonFilePath'; + AddViaJsonString = 'Az.MSGraph.private\Add-AzADServicePrincipalPassword_AddViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -811,7 +861,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -930,11 +981,10 @@ function Get-AzADApplication { [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] - [Alias('ApplicationId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] # key: id of application - ${Id}, + ${ApplicationId}, [Parameter()] [AllowEmptyCollection()] @@ -999,7 +1049,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1181,7 +1232,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1295,11 +1347,10 @@ function Get-AzADGroup { [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] - [Alias('GroupId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] # key: id of group - ${Id}, + ${GroupId}, [Parameter()] [AllowEmptyCollection()] @@ -1364,7 +1415,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1490,11 +1542,10 @@ function Get-AzADServicePrincipal { [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] - [Alias('ServicePrincipalId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] # key: id of servicePrincipal - ${Id}, + ${ServicePrincipalId}, [Parameter()] [AllowEmptyCollection()] @@ -1559,7 +1610,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1715,7 +1767,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1863,7 +1916,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1986,7 +2040,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -2098,11 +2153,10 @@ function Get-AzADUser { [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] - [Alias('UserId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] # key: id of user - ${Id}, + ${UserId}, [Parameter()] [AllowEmptyCollection()] @@ -2167,7 +2221,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -2262,9 +2317,9 @@ end { <# .Synopsis -Create new navigation property to federatedIdentityCredentials for applications +create new navigation property to federatedIdentityCredentials for applications .Description -Create new navigation property to federatedIdentityCredentials for applications +create new navigation property to federatedIdentityCredentials for applications .Example New-AzADAppFederatedCredential -ApplicationObjectId $appObjectId -Audience api://AzureADTokenExchange -Issuer https://login.microsoftonline.com/3d1e2be9-a10a-4a0c-8380-7ce190f98ed9/v2.0 -name 'test-cred' -Subject 'subject' @@ -2283,13 +2338,13 @@ param( # key: id of application ${ApplicationObjectId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Collections.Hashtable] # Additional Parameters ${AdditionalProperties}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -2300,14 +2355,14 @@ param( # Required. ${Audience}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The un-validated, user-provided description of the federated identity credential. # Optional. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The URL of the external identity provider and must match the issuer claim of the external token being exchanged. @@ -2315,7 +2370,7 @@ param( # Required. ${Issuer}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # is the unique identifier for the federated identity credential, which has a character limit of 120 characters and must be URL friendly. @@ -2325,7 +2380,7 @@ param( # Supports $filter (eq). ${Name}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Required. @@ -2336,12 +2391,25 @@ param( # Supports $filter (eq). ${Subject}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -2394,6 +2462,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.MSGraph.private\New-AzADAppFederatedCredential_CreateExpanded'; + CreateViaJsonFilePath = 'Az.MSGraph.private\New-AzADAppFederatedCredential_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.MSGraph.private\New-AzADAppFederatedCredential_CreateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -2533,7 +2603,7 @@ HOMEREALMDISCOVERYPOLICY : . [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -2797,7 +2867,7 @@ TOKENISSUANCEPOLICY : . [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -3008,7 +3078,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -3184,64 +3254,61 @@ function New-AzADApplication { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApplication])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn[]] # Defines custom behavior that a consuming service can use to call an app in specific contexts. # For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. # This will let services like Office 365 call the application in the context of a document the user is working on. - # To construct, see NOTES section for ADDIN properties and create a hash table. ${AddIn}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Collections.Hashtable] # Additional Parameters ${AdditionalProperties}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApiApplication] # apiApplication - # To construct, see NOTES section for API properties and create a hash table. ${Api}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole[]] # The collection of roles assigned to the application. # With app role assignments, these roles can be assigned to users, groups, or service principals associated with other applications. # Not nullable. - # To construct, see NOTES section for APPROLE properties and create a hash table. ${AppRole}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Unique identifier of the applicationTemplate. ${ApplicationTemplateId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # . ${CreatedOnBehalfOfDeletedDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name displayed in directory ${CreatedOnBehalfOfDisplayName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # . ${DeletedDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # An optional description of the application. @@ -3249,7 +3316,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, startsWith) and $search. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies whether Microsoft has disabled the registered application. @@ -3257,37 +3324,35 @@ param( # Supports $filter (eq, ne, NOT). ${DisabledByMicrosoftStatus}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name displayed in directory ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential[]] # Federated identities for applications. # Supports $expand and $filter (eq when counting empty collections). - # To construct, see NOTES section for FEDERATEDIDENTITYCREDENTIALS properties and create a hash table. ${FederatedIdentityCredentials}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Configures the groups claim issued in a user or OAuth 2.0 access token that the application expects. # To set this attribute, use one of the following string values: None, SecurityGroup (for security groups and Azure AD roles), All (this gets all security groups, distribution groups, and Azure AD directory roles that the signed-in user is a member of). ${GroupMembershipClaim}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy[]] # . - # To construct, see NOTES section for HOMEREALMDISCOVERYPOLICY properties and create a hash table. ${HomeRealmDiscoveryPolicy}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -3298,21 +3363,20 @@ param( # Supports $filter (eq, ne, ge, le, startsWith). ${IdentifierUri}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphInformationalUrl] # informationalUrl - # To construct, see NOTES section for INFO properties and create a hash table. ${Info}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Specifies whether this application supports device authentication without a user. # The default is false. ${IsDeviceOnlyAuthSupported}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Specifies the fallback application type as public client, such as an installed application running on a mobile device. @@ -3322,66 +3386,61 @@ param( # In those cases Azure AD interprets the application type based on the value of this property. ${IsFallbackPublicClient}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential[]] # The collection of key credentials associated with the application. # Not nullable. # Supports $filter (eq, NOT, ge, le). - # To construct, see NOTES section for KEYCREDENTIALS properties and create a hash table. ${KeyCredentials}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Input File for Logo (The main logo for the application. # Not nullable.) ${LogoInputFile}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Notes relevant for the management of the application. ${Note}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # . ${Oauth2RequirePostResponse}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOptionalClaims] # optionalClaims - # To construct, see NOTES section for OPTIONALCLAIM properties and create a hash table. ${OptionalClaim}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphParentalControlSettings] # parentalControlSettings - # To construct, see NOTES section for PARENTALCONTROLSETTING properties and create a hash table. ${ParentalControlSetting}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential[]] # The collection of password credentials associated with the application. # Not nullable. - # To construct, see NOTES section for PASSWORDCREDENTIALS properties and create a hash table. ${PasswordCredentials}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPublicClientApplication] # publicClientApplication - # To construct, see NOTES section for PUBLICCLIENT properties and create a hash table. ${PublicClient}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphRequiredResourceAccess[]] @@ -3390,17 +3449,16 @@ param( # This configuration of access to the required resources drives the consent experience. # Not nullable. # Supports $filter (eq, NOT, ge, le). - # To construct, see NOTES section for REQUIREDRESOURCEACCESS properties and create a hash table. ${RequiredResourceAccess}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # References application or service contact information from a Service or Asset Management database. # Nullable. ${ServiceManagementReference}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the Microsoft accounts that are supported for the current application. @@ -3409,14 +3467,13 @@ param( # Supports $filter (eq, ne, NOT). ${SignInAudience}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphSpaApplication] # spaApplication - # To construct, see NOTES section for SPA properties and create a hash table. ${Spa}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -3424,7 +3481,7 @@ param( # Not nullable.Supports $filter (eq, NOT, ge, le, startsWith). ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the keyId of a public key from the keyCredentials collection. @@ -3432,36 +3489,46 @@ param( # The application code that receives the encrypted token must use the matching private key to decrypt the token before it can be used for the signed-in user. ${TokenEncryptionKeyId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy[]] # . - # To construct, see NOTES section for TOKENISSUANCEPOLICY properties and create a hash table. ${TokenIssuancePolicy}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy[]] # The tokenLifetimePolicies assigned to this application. # Supports $expand. - # To construct, see NOTES section for TOKENLIFETIMEPOLICY properties and create a hash table. ${TokenLifetimePolicy}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphWebApplication] # webApplication - # To construct, see NOTES section for WEB properties and create a hash table. ${Web}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -3514,6 +3581,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.MSGraph.private\New-AzADApplication_CreateExpanded'; + CreateViaJsonFilePath = 'Az.MSGraph.private\New-AzADApplication_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.MSGraph.private\New-AzADApplication_CreateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -3594,12 +3663,25 @@ param( # Additional Parameters ${AdditionalProperties}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -3659,6 +3741,8 @@ begin { $mapping = @{ Create = 'Az.MSGraph.private\New-AzADGroupGraphRefMember_Create'; CreateExpanded = 'Az.MSGraph.private\New-AzADGroupGraphRefMember_CreateExpanded'; + CreateViaJsonFilePath = 'Az.MSGraph.private\New-AzADGroupGraphRefMember_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.MSGraph.private\New-AzADGroupGraphRefMember_CreateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -3693,9 +3777,9 @@ end { <# .Synopsis -Create new navigation property ref to owners for groups +create new navigation property ref to owners for groups .Description -Create new navigation property ref to owners for groups +create new navigation property ref to owners for groups .Example {{ Add code here }} .Example @@ -3733,7 +3817,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -3869,22 +3954,21 @@ function New-AzADGroup { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphGroup])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Collections.Hashtable] # Additional Parameters ${AdditionalProperties}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignmentAutoGenerated[]] # Represents the app roles a group has been granted for an application. # Supports $expand. - # To construct, see NOTES section for APPROLEASSIGNMENT properties and create a hash table. ${AppRoleAssignment}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Describes a classification for the group (such as low, medium or high business impact). @@ -3892,21 +3976,20 @@ param( # Supports $filter (eq, ne, NOT, ge, le, startsWith). ${Classification}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject] # Represents an Azure Active Directory object. # The directoryObject type is the base type for many other directory entity types. - # To construct, see NOTES section for CREATEDONBEHALFOF properties and create a hash table. ${CreatedOnBehalfOf}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # . ${DeletedDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # An optional description for the group. @@ -3914,13 +3997,13 @@ param( # Supports $filter (eq, ne, NOT, ge, le, startsWith) and $search. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name displayed in directory ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -3931,7 +4014,7 @@ param( # Supports $filter (eq, NOT). ${GroupType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether there are members in this group that have license errors from its group-based license assignment. @@ -3940,13 +4023,13 @@ param( # Supports $filter (eq). ${HasMembersWithLicenseError}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # . ${IsArchived}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether this group can be assigned to an Azure Active Directory role.This property can only be set while creating the group and is immutable. @@ -3957,7 +4040,7 @@ param( # Supports $filter (eq, ne, NOT). ${IsAssignableToRole}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Specifies whether the group is mail-enabled. @@ -3965,7 +4048,7 @@ param( # Supports $filter (eq, ne, NOT). ${MailEnabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The mail alias for the group, unique in the organization. @@ -3975,7 +4058,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${MailNickname}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The rule that determines members for this group if the group is a dynamic group (groupTypes contains DynamicMembership). @@ -3984,7 +4067,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, startsWith). ${MembershipRule}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Indicates whether the dynamic membership processing is on or paused. @@ -3993,16 +4076,15 @@ param( # Supports $filter (eq, ne, NOT, in). ${MembershipRuleProcessingState}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphResourceSpecificPermissionGrant[]] # The permissions that have been granted for a group to a specific application. # Supports $expand. - # To construct, see NOTES section for PERMISSIONGRANT properties and create a hash table. ${PermissionGrant}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The preferred data location for the group. @@ -4010,7 +4092,7 @@ param( # Returned by default. ${PreferredDataLocation}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The preferred language for a Microsoft 365 group. @@ -4019,7 +4101,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${PreferredLanguage}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Specifies whether the group is a security group. @@ -4027,14 +4109,14 @@ param( # Supports $filter (eq, ne, NOT, in). ${SecurityEnabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Security identifier of the group, used in Windows scenarios. # Returned by default. ${SecurityIdentifier}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies a Microsoft 365 group's color theme. @@ -4042,7 +4124,7 @@ param( # Returned by default. ${Theme}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the group join policy and group content visibility for groups. @@ -4055,12 +4137,25 @@ param( # Returned by default. ${Visibility}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -4113,6 +4208,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.MSGraph.private\New-AzADGroup_CreateExpanded'; + CreateViaJsonFilePath = 'Az.MSGraph.private\New-AzADGroup_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.MSGraph.private\New-AzADGroup_CreateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -4221,7 +4318,7 @@ BODY : organization [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -4313,7 +4410,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganization] # organization - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='CreateExpanded')] @@ -4328,14 +4424,12 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAssignedPlan[]] # The collection of service plans associated with the tenant. # Not nullable. - # To construct, see NOTES section for ASSIGNEDPLAN properties and create a hash table. ${AssignedPlan}, [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOrganizationalBranding] # organizationalBranding - # To construct, see NOTES section for BRANDING properties and create a hash table. ${Branding}, [Parameter(ParameterSetName='CreateExpanded')] @@ -4352,7 +4446,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphCertificateBasedAuthConfiguration[]] # Navigation property to manage certificate-based authentication configuration. # Only a single instance of certificateBasedAuthConfiguration can be created in the collection. - # To construct, see NOTES section for CERTIFICATEBASEDAUTHCONFIGURATION properties and create a hash table. ${CertificateBasedAuthConfiguration}, [Parameter(ParameterSetName='CreateExpanded')] @@ -4402,7 +4495,6 @@ param( # The collection of open extensions defined for the organization. # Read-only. # Nullable. - # To construct, see NOTES section for EXTENSION properties and create a hash table. ${Extension}, [Parameter(ParameterSetName='CreateExpanded')] @@ -4413,9 +4505,9 @@ param( ${MarketingNotificationEmail}, [Parameter(ParameterSetName='CreateExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority])] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.PSArgumentCompleterAttribute("unknown", "intune", "sccm", "office365")] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Support.MdmAuthority] + [System.String] # Mobile device management authority. ${MobileDeviceManagementAuthority}, @@ -4453,7 +4545,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPrivacyProfile] # privacyProfile - # To construct, see NOTES section for PRIVACYPROFILE properties and create a hash table. ${PrivacyProfile}, [Parameter(ParameterSetName='CreateExpanded')] @@ -4461,7 +4552,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphProvisionedPlan[]] # Not nullable. - # To construct, see NOTES section for PROVISIONEDPLAN properties and create a hash table. ${ProvisionedPlan}, [Parameter(ParameterSetName='CreateExpanded')] @@ -4509,15 +4599,27 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphVerifiedDomain[]] # The collection of domains associated with this tenant. # Not nullable. - # To construct, see NOTES section for VERIFIEDDOMAIN properties and create a hash table. ${VerifiedDomain}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -4571,6 +4673,8 @@ begin { $mapping = @{ Create = 'Az.MSGraph.private\New-AzADOrganization_Create'; CreateExpanded = 'Az.MSGraph.private\New-AzADOrganization_CreateExpanded'; + CreateViaJsonFilePath = 'Az.MSGraph.private\New-AzADOrganization_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.MSGraph.private\New-AzADOrganization_CreateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -4605,9 +4709,9 @@ end { <# .Synopsis -Create new navigation property to appRoleAssignments for servicePrincipals +create new navigation property to appRoleAssignments for servicePrincipals .Description -Create new navigation property to appRoleAssignments for servicePrincipals +create new navigation property to appRoleAssignments for servicePrincipals .Example New-AzADServicePrincipalAppRoleAssignment -ServicePrincipalId 71beb965-8347-495d-a589-c21cdde7a722 -ResourceId 351fa797-c81a-4998-9720-4c2ecb6c7abc -AppRoleId 649ae968-bdf9-4f22-bb2c-2aa1b4af0a83 .Example @@ -4648,7 +4752,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment] # Represents an Azure Active Directory object. # The directoryObject type is the base type for many other directory entity types. - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='CreateExpanded')] @@ -4693,12 +4796,25 @@ param( # Supports $filter (eq only). ${ResourceId}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -4752,6 +4868,8 @@ begin { $mapping = @{ Create = 'Az.MSGraph.private\New-AzADServicePrincipalAppRoleAssignment_Create'; CreateExpanded = 'Az.MSGraph.private\New-AzADServicePrincipalAppRoleAssignment_CreateExpanded'; + CreateViaJsonFilePath = 'Az.MSGraph.private\New-AzADServicePrincipalAppRoleAssignment_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.MSGraph.private\New-AzADServicePrincipalAppRoleAssignment_CreateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -4885,7 +5003,7 @@ CLAIMSMAPPINGPOLICY : The claimsMappingPol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -5118,7 +5236,7 @@ HOMEREALMDISCOVERYPOLICY : The homeRe [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -5368,7 +5486,7 @@ TOKENISSUANCEPOLICY : The tokenIssuancePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -5579,7 +5697,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -5749,30 +5867,29 @@ function New-AzADServicePrincipal { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphServicePrincipal])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # true if the service principal account is enabled; otherwise, false. # Supports $filter (eq, ne, NOT, in). ${AccountEnabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn[]] # Defines custom behavior that a consuming service can use to call an app in specific contexts. # For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. # This will let services like Microsoft 365 call the application in the context of a document the user is working on. - # To construct, see NOTES section for ADDIN properties and create a hash table. ${AddIn}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Collections.Hashtable] # Additional Parameters ${AdditionalProperties}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -5780,59 +5897,56 @@ param( # Supports $filter (eq, NOT, ge, le, startsWith). ${AlternativeName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The description exposed by the associated application. ${AppDescription}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The display name exposed by the associated application. ${AppDisplayName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The unique identifier for the associated application (its appId property). ${AppId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Contains the tenant id where the application is registered. # This is applicable only to service principals backed by applications.Supports $filter (eq, ne, NOT, ge, le). ${AppOwnerOrganizationId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole[]] # The roles exposed by the application which this service principal represents. # For more information see the appRoles property definition on the application entity. # Not nullable. - # To construct, see NOTES section for APPROLE properties and create a hash table. ${AppRole}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment[]] # App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. - # To construct, see NOTES section for APPROLEASSIGNEDTO properties and create a hash table. ${AppRoleAssignedTo}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment[]] # App role assignment for another app or service, granted to this service principal. # Supports $expand. - # To construct, see NOTES section for APPROLEASSIGNMENT properties and create a hash table. ${AppRoleAssignment}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Specifies whether users or other service principals need to be granted an app role assignment for this service principal before users can sign in or apps can get tokens. @@ -5841,31 +5955,29 @@ param( # Supports $filter (eq, ne, NOT). ${AppRoleAssignmentRequired}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphClaimsMappingPolicy[]] # The claimsMappingPolicies assigned to this service principal. # Supports $expand. - # To construct, see NOTES section for CLAIMSMAPPINGPOLICY properties and create a hash table. ${ClaimsMappingPolicy}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDelegatedPermissionClassification[]] # The permission classifications for delegated permissions exposed by the app that this service principal represents. # Supports $expand. - # To construct, see NOTES section for DELEGATEDPERMISSIONCLASSIFICATION properties and create a hash table. ${DelegatedPermissionClassification}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # . ${DeletedDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Free text field to provide an internal end-user facing description of the service principal. @@ -5874,7 +5986,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, startsWith) and $search. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies whether Microsoft has disabled the registered application. @@ -5882,62 +5994,57 @@ param( # Supports $filter (eq, ne, NOT). ${DisabledByMicrosoftStatus}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name displayed in directory ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEndpoint[]] # Endpoints available for discovery. # Services like Sharepoint populate this property with a tenant specific SharePoint endpoints that other applications can discover and use in their experiences. - # To construct, see NOTES section for ENDPOINT properties and create a hash table. ${Endpoint}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential[]] # . - # To construct, see NOTES section for FEDERATEDIDENTITYCREDENTIALS properties and create a hash table. ${FederatedIdentityCredentials}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy[]] # The homeRealmDiscoveryPolicies assigned to this service principal. # Supports $expand. - # To construct, see NOTES section for HOMEREALMDISCOVERYPOLICY properties and create a hash table. ${HomeRealmDiscoveryPolicy}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Home page or landing page of the application. ${Homepage}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphInformationalUrl] # informationalUrl - # To construct, see NOTES section for INFO properties and create a hash table. ${Info}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential[]] # The collection of key credentials associated with the service principal. # Not nullable. # Supports $filter (eq, NOT, ge, le). - # To construct, see NOTES section for KEYCREDENTIALS properties and create a hash table. ${KeyCredentials}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the URL where the service provider redirects the user to Azure AD to authenticate. @@ -5946,20 +6053,20 @@ param( # The user launches the application from Microsoft 365, the Azure AD My Apps, or the Azure AD SSO URL. ${LoginUrl}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the URL that will be used by Microsoft's authorization service to logout an user using OpenId Connect front-channel, back-channel or SAML logout protocols. ${LogoutUrl}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Free text field to capture information about the service principal, typically used for operational purposes. # Maximum allowed size is 1024 characters. ${Note}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -5967,26 +6074,24 @@ param( # This is only for the certificates used to sign the SAML token issued for Azure AD Gallery applications. ${NotificationEmailAddress}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPermissionScope[]] # The delegated permissions exposed by the application. # For more information see the oauth2PermissionScopes property on the application entity's api property. # Not nullable. - # To construct, see NOTES section for OAUTH2PERMISSIONSCOPE properties and create a hash table. ${Oauth2PermissionScope}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential[]] # The collection of password credentials associated with the service principal. # Not nullable. - # To construct, see NOTES section for PASSWORDCREDENTIALS properties and create a hash table. ${PasswordCredentials}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the single sign-on mode configured for this application. @@ -5994,7 +6099,7 @@ param( # The supported values are password, saml, notSupported, and oidc. ${PreferredSingleSignOnMode}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Reserved for internal use only. @@ -6002,7 +6107,7 @@ param( # May be removed in future versions. ${PreferredTokenSigningKeyThumbprint}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -6010,14 +6115,13 @@ param( # Not nullable. ${ReplyUrl}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphSamlSingleSignOnSettings] # samlSingleSignOnSettings - # To construct, see NOTES section for SAMLSINGLESIGNONSETTING properties and create a hash table. ${SamlSingleSignOnSetting}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -6029,7 +6133,7 @@ param( # Supports $filter (eq, NOT, ge, le, startsWith). ${ServicePrincipalName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Identifies if the service principal represents an application or a managed identity. @@ -6038,7 +6142,7 @@ param( # For a service principal that represent a managed identity this is set as ManagedIdentity. ${ServicePrincipalType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -6047,7 +6151,7 @@ param( # Supports $filter (eq, NOT, ge, le, startsWith). ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the keyId of a public key from the keyCredentials collection. @@ -6055,38 +6159,48 @@ param( # The application code that receives the encrypted token must use the matching private key to decrypt the token before it can be used for the signed-in user. ${TokenEncryptionKeyId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy[]] # The tokenIssuancePolicies assigned to this service principal. # Supports $expand. - # To construct, see NOTES section for TOKENISSUANCEPOLICY properties and create a hash table. ${TokenIssuancePolicy}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy[]] # The tokenLifetimePolicies assigned to this service principal. # Supports $expand. - # To construct, see NOTES section for TOKENLIFETIMEPOLICY properties and create a hash table. ${TokenLifetimePolicy}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject[]] # . - # To construct, see NOTES section for TRANSITIVEMEMBEROF properties and create a hash table. ${TransitiveMemberOf}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -6139,6 +6253,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.MSGraph.private\New-AzADServicePrincipal_CreateExpanded'; + CreateViaJsonFilePath = 'Az.MSGraph.private\New-AzADServicePrincipal_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.MSGraph.private\New-AzADServicePrincipal_CreateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -6217,7 +6333,7 @@ function New-AzADUser { [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphUser])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # true if the account is enabled; otherwise, false. @@ -6225,13 +6341,13 @@ param( # Supports $filter (eq, ne, NOT, and in). ${AccountEnabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Collections.Hashtable] # Additional Parameters ${AdditionalProperties}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Sets the age group of the user. @@ -6240,7 +6356,7 @@ param( # Supports $filter (eq, ne, NOT, and in). ${AgeGroup}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # The timestamp type represents date and time information using ISO 8601 format and is always in UTC time. @@ -6249,7 +6365,7 @@ param( # Supports $filter (eq, ne, not, ge, le, and eq on null values) and $orderBy. ${ApproximateLastSignInDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The city in which the user is located. @@ -6257,7 +6373,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${City}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The company name which the user is associated. @@ -6265,7 +6381,7 @@ param( # The maximum length of the company name is 64 characters.Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${CompanyName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # The timestamp when the device is no longer deemed compliant. @@ -6274,7 +6390,7 @@ param( # Read-only. ${ComplianceExpirationDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Sets whether consent has been obtained for minors. @@ -6283,7 +6399,7 @@ param( # Supports $filter (eq, ne, NOT, and in). ${ConsentProvidedForMinor}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The country/region in which the user is located; for example, US or UK. @@ -6291,53 +6407,52 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${Country}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # . ${DeletedDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name for the department in which the user works. # Maximum length is 64 characters.Supports $filter (eq, ne, NOT , ge, le, and in operators). ${Department}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Int32] # For internal use only. ${DeviceVersion}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name displayed in directory ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # The date and time when the user was hired or will start work in case of a future hire. # Supports $filter (eq, ne, NOT , ge, le, in). ${EmployeeHireDate}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The employee identifier assigned to the user by the organization. # Supports $filter (eq, ne, NOT , ge, le, in, startsWith). ${EmployeeId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEmployeeOrgData] # employeeOrgData - # To construct, see NOTES section for EMPLOYEEORGDATA properties and create a hash table. ${EmployeeOrgData}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Captures enterprise worker type. @@ -6345,7 +6460,7 @@ param( # Supports $filter (eq, ne, NOT , ge, le, in, startsWith). ${EmployeeType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # For an external user invited to the tenant using the invitation API, this property represents the invited user's invitation status. @@ -6353,21 +6468,21 @@ param( # Supports $filter (eq, ne, NOT , in). ${ExternalUserState}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # Shows the timestamp for the latest change to the externalUserState property. # Supports $filter (eq, ne, NOT , in). ${ExternalUserStateChangeDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The fax number of the user. # Supports $filter (eq, ne, NOT , ge, le, in, startsWith). ${FaxNumber}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The given name (first name) of the user. @@ -6375,7 +6490,7 @@ param( # Supports $filter (eq, ne, NOT , ge, le, in, startsWith). ${GivenName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphObjectIdentity[]] @@ -6383,16 +6498,15 @@ param( # An identity can be provided by Microsoft (also known as a local account), by organizations, or by social identity providers such as Facebook, Google, and Microsoft, and tied to a user account. # May contain multiple items with the same signInType value. # Supports $filter (eq) only where the signInType is not userPrincipalName. - # To construct, see NOTES section for IDENTITY properties and create a hash table. ${Identity}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Do not use - reserved for future use. ${IsResourceAccount}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The user's job title. @@ -6400,7 +6514,7 @@ param( # Supports $filter (eq, ne, NOT , ge, le, in, startsWith). ${JobTitle}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The SMTP address for the user, for example, admin@contoso.com. @@ -6409,7 +6523,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith, endsWith). ${Mail}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The mail alias for the user. @@ -6418,15 +6532,14 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${MailNickname}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject] # Represents an Azure Active Directory object. # The directoryObject type is the base type for many other directory entity types. - # To construct, see NOTES section for MANAGER properties and create a hash table. ${Manager}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The office location in the user's place of business. @@ -6434,7 +6547,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${OfficeLocation}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # This property is used to associate an on-premises Active Directory user account to their Azure AD user object. @@ -6444,7 +6557,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in).. ${OnPremisesImmutableId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # The last time at which the object was synced with the on-premises directory. @@ -6453,7 +6566,7 @@ param( # Supports $filter (eq, ne, not, ge, le, in). ${OnPremisesLastSyncDateTime}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced; null if this object has never been synced from an on-premises directory (default). @@ -6461,7 +6574,7 @@ param( # Supports $filter (eq, ne, not, in, and eq on null values). ${OnPremisesSyncEnabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Operating system of the device. @@ -6469,7 +6582,7 @@ param( # This property is read-only. ${OperatingSystem}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Operating system version of the device. @@ -6477,14 +6590,14 @@ param( # Supports $filter (eq, ne, not, ge, le, startsWith, and eq on null values). ${OperatingSystemVersion}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] # A list of additional email addresses for the user; for example: ['bob@contoso.com', 'Robert@fabrikam.com'].NOTE: While this property can contain accent characters, they can cause access issues to first-party applications for the user.Supports $filter (eq, NOT, ge, le, in, startsWith). ${OtherMail}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies password policies for the user. @@ -6493,14 +6606,13 @@ param( # The two may be specified together; for example: DisablePasswordExpiration, DisableStrongPassword.Supports $filter (ne, NOT). ${PasswordPolicy}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordProfile] # passwordProfile - # To construct, see NOTES section for PASSWORDPROFILE properties and create a hash table. ${PasswordProfile}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -6509,7 +6621,7 @@ param( # Supports $filter (eq, not, ge, le, startsWith). ${PhysicalId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The postal code for the user's postal address. @@ -6519,7 +6631,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${PostalCode}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The preferred language for the user. @@ -6527,7 +6639,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${PreferredLanguage}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # true if the Outlook global address list should contain this user, otherwise false. @@ -6536,7 +6648,7 @@ param( # Supports $filter (eq, ne, NOT, in). ${ShowInAddressList}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The state or province in the user's address. @@ -6544,7 +6656,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${State}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The street address of the user's place of business. @@ -6552,7 +6664,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${StreetAddress}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The user's surname (family name or last name). @@ -6560,7 +6672,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${Surname}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Type of trust for the joined device. @@ -6569,7 +6681,7 @@ param( # For more details, see Introduction to device management in Azure Active Directory ${TrustType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # A two letter country code (ISO standard 3166). @@ -6579,7 +6691,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${UsageLocation}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The user principal name (UPN) of the user. @@ -6591,19 +6703,32 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith, endsWith) and $orderBy. ${UserPrincipalName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # A string value that can be used to classify user types in your directory, such as Member and Guest. # Supports $filter (eq, ne, NOT, in,). ${UserType}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -6656,6 +6781,8 @@ begin { $mapping = @{ CreateExpanded = 'Az.MSGraph.private\New-AzADUser_CreateExpanded'; + CreateViaJsonFilePath = 'Az.MSGraph.private\New-AzADUser_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.MSGraph.private\New-AzADUser_CreateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -6728,7 +6855,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsHxlydaApplicationsApplicationIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema] # . - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='RemoveExpanded')] @@ -6749,12 +6875,25 @@ param( # . ${Proof}, + [Parameter(ParameterSetName='RemoveViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Remove operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='RemoveViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Remove operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -6814,6 +6953,8 @@ begin { $mapping = @{ Remove = 'Az.MSGraph.private\Remove-AzADApplicationKey_Remove'; RemoveExpanded = 'Az.MSGraph.private\Remove-AzADApplicationKey_RemoveExpanded'; + RemoveViaJsonFilePath = 'Az.MSGraph.private\Remove-AzADApplicationKey_RemoveViaJsonFilePath'; + RemoveViaJsonString = 'Az.MSGraph.private\Remove-AzADApplicationKey_RemoveViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -6885,7 +7026,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsHv033BApplicationsApplicationIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema] # . - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='RemoveExpanded')] @@ -6900,12 +7040,25 @@ param( # . ${KeyId}, + [Parameter(ParameterSetName='RemoveViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Remove operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='RemoveViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Remove operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -6965,6 +7118,8 @@ begin { $mapping = @{ Remove = 'Az.MSGraph.private\Remove-AzADApplicationPassword_Remove'; RemoveExpanded = 'Az.MSGraph.private\Remove-AzADApplicationPassword_RemoveExpanded'; + RemoveViaJsonFilePath = 'Az.MSGraph.private\Remove-AzADApplicationPassword_RemoveViaJsonFilePath'; + RemoveViaJsonString = 'Az.MSGraph.private\Remove-AzADApplicationPassword_RemoveViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -7019,11 +7174,10 @@ function Remove-AzADApplication { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] - [Alias('ApplicationId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] # key: id of application - ${Id}, + ${ApplicationId}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Header')] @@ -7036,7 +7190,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -7169,7 +7324,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -7282,11 +7438,10 @@ function Remove-AzADGroup { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] - [Alias('GroupId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] # key: id of group - ${Id}, + ${GroupId}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Header')] @@ -7299,7 +7454,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -7430,7 +7586,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPaths1UhuhlbServiceprincipalsServiceprincipalIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema] # . - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='RemoveExpanded')] @@ -7451,12 +7606,25 @@ param( # . ${Proof}, + [Parameter(ParameterSetName='RemoveViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Remove operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='RemoveViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Remove operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -7516,6 +7684,8 @@ begin { $mapping = @{ Remove = 'Az.MSGraph.private\Remove-AzADServicePrincipalKey_Remove'; RemoveExpanded = 'Az.MSGraph.private\Remove-AzADServicePrincipalKey_RemoveExpanded'; + RemoveViaJsonFilePath = 'Az.MSGraph.private\Remove-AzADServicePrincipalKey_RemoveViaJsonFilePath'; + RemoveViaJsonString = 'Az.MSGraph.private\Remove-AzADServicePrincipalKey_RemoveViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -7587,7 +7757,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPaths1Idoj4GServiceprincipalsServiceprincipalIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema] # . - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='RemoveExpanded')] @@ -7602,12 +7771,25 @@ param( # . ${KeyId}, + [Parameter(ParameterSetName='RemoveViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Remove operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='RemoveViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Remove operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -7667,6 +7849,8 @@ begin { $mapping = @{ Remove = 'Az.MSGraph.private\Remove-AzADServicePrincipalPassword_Remove'; RemoveExpanded = 'Az.MSGraph.private\Remove-AzADServicePrincipalPassword_RemoveExpanded'; + RemoveViaJsonFilePath = 'Az.MSGraph.private\Remove-AzADServicePrincipalPassword_RemoveViaJsonFilePath'; + RemoveViaJsonString = 'Az.MSGraph.private\Remove-AzADServicePrincipalPassword_RemoveViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -7721,11 +7905,10 @@ function Remove-AzADServicePrincipal { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] - [Alias('ServicePrincipalId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] # key: id of servicePrincipal - ${Id}, + ${ServicePrincipalId}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Header')] @@ -7738,7 +7921,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -7849,11 +8033,10 @@ function Remove-AzADUser { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] - [Alias('UserId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] # key: id of user - ${Id}, + ${UserId}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Header')] @@ -7866,7 +8049,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -8068,7 +8252,7 @@ HOMEREALMDISCOVERYPOLICY : . [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -8332,7 +8516,7 @@ TOKENISSUANCEPOLICY : . [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -8543,7 +8727,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -8720,70 +8904,66 @@ function Update-AzADApplication { [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] - [Alias('ApplicationId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] # key: id of application - ${Id}, + ${ApplicationId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn[]] # Defines custom behavior that a consuming service can use to call an app in specific contexts. # For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. # This will let services like Office 365 call the application in the context of a document the user is working on. - # To construct, see NOTES section for ADDIN properties and create a hash table. ${AddIn}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Collections.Hashtable] # Additional Parameters ${AdditionalProperties}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApiApplication] # apiApplication - # To construct, see NOTES section for API properties and create a hash table. ${Api}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole[]] # The collection of roles assigned to the application. # With app role assignments, these roles can be assigned to users, groups, or service principals associated with other applications. # Not nullable. - # To construct, see NOTES section for APPROLE properties and create a hash table. ${AppRole}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Unique identifier of the applicationTemplate. ${ApplicationTemplateId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # . ${CreatedOnBehalfOfDeletedDateTime}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name displayed in directory ${CreatedOnBehalfOfDisplayName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # . ${DeletedDateTime}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # An optional description of the application. @@ -8791,7 +8971,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, startsWith) and $search. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies whether Microsoft has disabled the registered application. @@ -8799,37 +8979,35 @@ param( # Supports $filter (eq, ne, NOT). ${DisabledByMicrosoftStatus}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name displayed in directory ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential[]] # Federated identities for applications. # Supports $expand and $filter (eq when counting empty collections). - # To construct, see NOTES section for FEDERATEDIDENTITYCREDENTIALS properties and create a hash table. ${FederatedIdentityCredentials}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Configures the groups claim issued in a user or OAuth 2.0 access token that the application expects. # To set this attribute, use one of the following string values: None, SecurityGroup (for security groups and Azure AD roles), All (this gets all security groups, distribution groups, and Azure AD directory roles that the signed-in user is a member of). ${GroupMembershipClaim}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy[]] # . - # To construct, see NOTES section for HOMEREALMDISCOVERYPOLICY properties and create a hash table. ${HomeRealmDiscoveryPolicy}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -8840,21 +9018,20 @@ param( # Supports $filter (eq, ne, ge, le, startsWith). ${IdentifierUri}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphInformationalUrl] # informationalUrl - # To construct, see NOTES section for INFO properties and create a hash table. ${Info}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Specifies whether this application supports device authentication without a user. # The default is false. ${IsDeviceOnlyAuthSupported}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Specifies the fallback application type as public client, such as an installed application running on a mobile device. @@ -8864,66 +9041,61 @@ param( # In those cases Azure AD interprets the application type based on the value of this property. ${IsFallbackPublicClient}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential[]] # The collection of key credentials associated with the application. # Not nullable. # Supports $filter (eq, NOT, ge, le). - # To construct, see NOTES section for KEYCREDENTIALS properties and create a hash table. ${KeyCredentials}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Input File for Logo (The main logo for the application. # Not nullable.) ${LogoInputFile}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Notes relevant for the management of the application. ${Note}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # . ${Oauth2RequirePostResponse}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOptionalClaims] # optionalClaims - # To construct, see NOTES section for OPTIONALCLAIM properties and create a hash table. ${OptionalClaim}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphParentalControlSettings] # parentalControlSettings - # To construct, see NOTES section for PARENTALCONTROLSETTING properties and create a hash table. ${ParentalControlSetting}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential[]] # The collection of password credentials associated with the application. # Not nullable. - # To construct, see NOTES section for PASSWORDCREDENTIALS properties and create a hash table. ${PasswordCredentials}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPublicClientApplication] # publicClientApplication - # To construct, see NOTES section for PUBLICCLIENT properties and create a hash table. ${PublicClient}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphRequiredResourceAccess[]] @@ -8932,17 +9104,16 @@ param( # This configuration of access to the required resources drives the consent experience. # Not nullable. # Supports $filter (eq, NOT, ge, le). - # To construct, see NOTES section for REQUIREDRESOURCEACCESS properties and create a hash table. ${RequiredResourceAccess}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # References application or service contact information from a Service or Asset Management database. # Nullable. ${ServiceManagementReference}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the Microsoft accounts that are supported for the current application. @@ -8951,14 +9122,13 @@ param( # Supports $filter (eq, ne, NOT). ${SignInAudience}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphSpaApplication] # spaApplication - # To construct, see NOTES section for SPA properties and create a hash table. ${Spa}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -8966,7 +9136,7 @@ param( # Not nullable.Supports $filter (eq, NOT, ge, le, startsWith). ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the keyId of a public key from the keyCredentials collection. @@ -8974,36 +9144,46 @@ param( # The application code that receives the encrypted token must use the matching private key to decrypt the token before it can be used for the signed-in user. ${TokenEncryptionKeyId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy[]] # . - # To construct, see NOTES section for TOKENISSUANCEPOLICY properties and create a hash table. ${TokenIssuancePolicy}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy[]] # The tokenLifetimePolicies assigned to this application. # Supports $expand. - # To construct, see NOTES section for TOKENLIFETIMEPOLICY properties and create a hash table. ${TokenLifetimePolicy}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphWebApplication] # webApplication - # To construct, see NOTES section for WEB properties and create a hash table. ${Web}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -9062,6 +9242,8 @@ begin { $mapping = @{ UpdateExpanded = 'Az.MSGraph.private\Update-AzADApplication_UpdateExpanded'; + UpdateViaJsonFilePath = 'Az.MSGraph.private\Update-AzADApplication_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.MSGraph.private\Update-AzADApplication_UpdateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -9195,7 +9377,7 @@ CLAIMSMAPPINGPOLICY : The claimsMappingPol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -9428,7 +9610,7 @@ HOMEREALMDISCOVERYPOLICY : The homeRe [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -9678,7 +9860,7 @@ TOKENISSUANCEPOLICY : The tokenIssuancePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -9889,7 +10071,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -10060,36 +10242,34 @@ function Update-AzADServicePrincipal { [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] - [Alias('ServicePrincipalId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] # key: id of servicePrincipal - ${Id}, + ${ServicePrincipalId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # true if the service principal account is enabled; otherwise, false. # Supports $filter (eq, ne, NOT, in). ${AccountEnabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn[]] # Defines custom behavior that a consuming service can use to call an app in specific contexts. # For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. # This will let services like Microsoft 365 call the application in the context of a document the user is working on. - # To construct, see NOTES section for ADDIN properties and create a hash table. ${AddIn}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Collections.Hashtable] # Additional Parameters ${AdditionalProperties}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -10097,59 +10277,56 @@ param( # Supports $filter (eq, NOT, ge, le, startsWith). ${AlternativeName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The description exposed by the associated application. ${AppDescription}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The display name exposed by the associated application. ${AppDisplayName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The unique identifier for the associated application (its appId property). ${AppId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Contains the tenant id where the application is registered. # This is applicable only to service principals backed by applications.Supports $filter (eq, ne, NOT, ge, le). ${AppOwnerOrganizationId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole[]] # The roles exposed by the application which this service principal represents. # For more information see the appRoles property definition on the application entity. # Not nullable. - # To construct, see NOTES section for APPROLE properties and create a hash table. ${AppRole}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment[]] # App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. - # To construct, see NOTES section for APPROLEASSIGNEDTO properties and create a hash table. ${AppRoleAssignedTo}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment[]] # App role assignment for another app or service, granted to this service principal. # Supports $expand. - # To construct, see NOTES section for APPROLEASSIGNMENT properties and create a hash table. ${AppRoleAssignment}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Specifies whether users or other service principals need to be granted an app role assignment for this service principal before users can sign in or apps can get tokens. @@ -10158,31 +10335,29 @@ param( # Supports $filter (eq, ne, NOT). ${AppRoleAssignmentRequired}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphClaimsMappingPolicy[]] # The claimsMappingPolicies assigned to this service principal. # Supports $expand. - # To construct, see NOTES section for CLAIMSMAPPINGPOLICY properties and create a hash table. ${ClaimsMappingPolicy}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDelegatedPermissionClassification[]] # The permission classifications for delegated permissions exposed by the app that this service principal represents. # Supports $expand. - # To construct, see NOTES section for DELEGATEDPERMISSIONCLASSIFICATION properties and create a hash table. ${DelegatedPermissionClassification}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # . ${DeletedDateTime}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Free text field to provide an internal end-user facing description of the service principal. @@ -10191,7 +10366,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, startsWith) and $search. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies whether Microsoft has disabled the registered application. @@ -10199,62 +10374,57 @@ param( # Supports $filter (eq, ne, NOT). ${DisabledByMicrosoftStatus}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name displayed in directory ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEndpoint[]] # Endpoints available for discovery. # Services like Sharepoint populate this property with a tenant specific SharePoint endpoints that other applications can discover and use in their experiences. - # To construct, see NOTES section for ENDPOINT properties and create a hash table. ${Endpoint}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential[]] # . - # To construct, see NOTES section for FEDERATEDIDENTITYCREDENTIALS properties and create a hash table. ${FederatedIdentityCredentials}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy[]] # The homeRealmDiscoveryPolicies assigned to this service principal. # Supports $expand. - # To construct, see NOTES section for HOMEREALMDISCOVERYPOLICY properties and create a hash table. ${HomeRealmDiscoveryPolicy}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Home page or landing page of the application. ${Homepage}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphInformationalUrl] # informationalUrl - # To construct, see NOTES section for INFO properties and create a hash table. ${Info}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential[]] # The collection of key credentials associated with the service principal. # Not nullable. # Supports $filter (eq, NOT, ge, le). - # To construct, see NOTES section for KEYCREDENTIALS properties and create a hash table. ${KeyCredentials}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the URL where the service provider redirects the user to Azure AD to authenticate. @@ -10263,20 +10433,20 @@ param( # The user launches the application from Microsoft 365, the Azure AD My Apps, or the Azure AD SSO URL. ${LoginUrl}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the URL that will be used by Microsoft's authorization service to logout an user using OpenId Connect front-channel, back-channel or SAML logout protocols. ${LogoutUrl}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Free text field to capture information about the service principal, typically used for operational purposes. # Maximum allowed size is 1024 characters. ${Note}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -10284,26 +10454,24 @@ param( # This is only for the certificates used to sign the SAML token issued for Azure AD Gallery applications. ${NotificationEmailAddress}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPermissionScope[]] # The delegated permissions exposed by the application. # For more information see the oauth2PermissionScopes property on the application entity's api property. # Not nullable. - # To construct, see NOTES section for OAUTH2PERMISSIONSCOPE properties and create a hash table. ${Oauth2PermissionScope}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential[]] # The collection of password credentials associated with the service principal. # Not nullable. - # To construct, see NOTES section for PASSWORDCREDENTIALS properties and create a hash table. ${PasswordCredentials}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the single sign-on mode configured for this application. @@ -10311,7 +10479,7 @@ param( # The supported values are password, saml, notSupported, and oidc. ${PreferredSingleSignOnMode}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Reserved for internal use only. @@ -10319,7 +10487,7 @@ param( # May be removed in future versions. ${PreferredTokenSigningKeyThumbprint}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -10327,14 +10495,13 @@ param( # Not nullable. ${ReplyUrl}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphSamlSingleSignOnSettings] # samlSingleSignOnSettings - # To construct, see NOTES section for SAMLSINGLESIGNONSETTING properties and create a hash table. ${SamlSingleSignOnSetting}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -10346,7 +10513,7 @@ param( # Supports $filter (eq, NOT, ge, le, startsWith). ${ServicePrincipalName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Identifies if the service principal represents an application or a managed identity. @@ -10355,7 +10522,7 @@ param( # For a service principal that represent a managed identity this is set as ManagedIdentity. ${ServicePrincipalType}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -10364,7 +10531,7 @@ param( # Supports $filter (eq, NOT, ge, le, startsWith). ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the keyId of a public key from the keyCredentials collection. @@ -10372,38 +10539,48 @@ param( # The application code that receives the encrypted token must use the matching private key to decrypt the token before it can be used for the signed-in user. ${TokenEncryptionKeyId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy[]] # The tokenIssuancePolicies assigned to this service principal. # Supports $expand. - # To construct, see NOTES section for TOKENISSUANCEPOLICY properties and create a hash table. ${TokenIssuancePolicy}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy[]] # The tokenLifetimePolicies assigned to this service principal. # Supports $expand. - # To construct, see NOTES section for TOKENLIFETIMEPOLICY properties and create a hash table. ${TokenLifetimePolicy}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject[]] # . - # To construct, see NOTES section for TRANSITIVEMEMBEROF properties and create a hash table. ${TransitiveMemberOf}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -10462,6 +10639,8 @@ begin { $mapping = @{ UpdateExpanded = 'Az.MSGraph.private\Update-AzADServicePrincipal_UpdateExpanded'; + UpdateViaJsonFilePath = 'Az.MSGraph.private\Update-AzADServicePrincipal_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.MSGraph.private\Update-AzADServicePrincipal_UpdateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) @@ -10536,13 +10715,12 @@ function Update-AzADUser { [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] - [Alias('UserId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] # key: id of user - ${Id}, + ${UserId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # true for enabling the account; otherwise, false. @@ -10550,13 +10728,13 @@ param( # `-AccountEnabled $false` is ignored when changing the account's password. ${AccountEnabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Collections.Hashtable] # Additional Parameters ${AdditionalProperties}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Sets the age group of the user. @@ -10565,7 +10743,7 @@ param( # Supports $filter (eq, ne, NOT, and in). ${AgeGroup}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # The timestamp type represents date and time information using ISO 8601 format and is always in UTC time. @@ -10574,7 +10752,7 @@ param( # Supports $filter (eq, ne, not, ge, le, and eq on null values) and $orderBy. ${ApproximateLastSignInDateTime}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The city in which the user is located. @@ -10582,7 +10760,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${City}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The company name which the user is associated. @@ -10590,7 +10768,7 @@ param( # The maximum length of the company name is 64 characters.Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${CompanyName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # The timestamp when the device is no longer deemed compliant. @@ -10599,7 +10777,7 @@ param( # Read-only. ${ComplianceExpirationDateTime}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Sets whether consent has been obtained for minors. @@ -10608,7 +10786,7 @@ param( # Supports $filter (eq, ne, NOT, and in). ${ConsentProvidedForMinor}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The country/region in which the user is located; for example, US or UK. @@ -10616,53 +10794,52 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${Country}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # . ${DeletedDateTime}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name for the department in which the user works. # Maximum length is 64 characters.Supports $filter (eq, ne, NOT , ge, le, and in operators). ${Department}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Int32] # For internal use only. ${DeviceVersion}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name displayed in directory ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # The date and time when the user was hired or will start work in case of a future hire. # Supports $filter (eq, ne, NOT , ge, le, in). ${EmployeeHireDate}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The employee identifier assigned to the user by the organization. # Supports $filter (eq, ne, NOT , ge, le, in, startsWith). ${EmployeeId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEmployeeOrgData] # employeeOrgData - # To construct, see NOTES section for EMPLOYEEORGDATA properties and create a hash table. ${EmployeeOrgData}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Captures enterprise worker type. @@ -10670,7 +10847,7 @@ param( # Supports $filter (eq, ne, NOT , ge, le, in, startsWith). ${EmployeeType}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # For an external user invited to the tenant using the invitation API, this property represents the invited user's invitation status. @@ -10678,21 +10855,21 @@ param( # Supports $filter (eq, ne, NOT , in). ${ExternalUserState}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # Shows the timestamp for the latest change to the externalUserState property. # Supports $filter (eq, ne, NOT , in). ${ExternalUserStateChangeDateTime}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The fax number of the user. # Supports $filter (eq, ne, NOT , ge, le, in, startsWith). ${FaxNumber}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The given name (first name) of the user. @@ -10700,7 +10877,7 @@ param( # Supports $filter (eq, ne, NOT , ge, le, in, startsWith). ${GivenName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphObjectIdentity[]] @@ -10708,16 +10885,15 @@ param( # An identity can be provided by Microsoft (also known as a local account), by organizations, or by social identity providers such as Facebook, Google, and Microsoft, and tied to a user account. # May contain multiple items with the same signInType value. # Supports $filter (eq) only where the signInType is not userPrincipalName. - # To construct, see NOTES section for IDENTITY properties and create a hash table. ${Identity}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Do not use - reserved for future use. ${IsResourceAccount}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The user's job title. @@ -10725,7 +10901,7 @@ param( # Supports $filter (eq, ne, NOT , ge, le, in, startsWith). ${JobTitle}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The SMTP address for the user, for example, admin@contoso.com. @@ -10734,7 +10910,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith, endsWith). ${Mail}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The mail alias for the user. @@ -10743,15 +10919,14 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${MailNickname}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject] # Represents an Azure Active Directory object. # The directoryObject type is the base type for many other directory entity types. - # To construct, see NOTES section for MANAGER properties and create a hash table. ${Manager}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The office location in the user's place of business. @@ -10759,7 +10934,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${OfficeLocation}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # This property is used to associate an on-premises Active Directory user account to their Azure AD user object. @@ -10769,7 +10944,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in).. ${OnPremisesImmutableId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # The last time at which the object was synced with the on-premises directory. @@ -10778,7 +10953,7 @@ param( # Supports $filter (eq, ne, not, ge, le, in). ${OnPremisesLastSyncDateTime}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced; null if this object has never been synced from an on-premises directory (default). @@ -10786,7 +10961,7 @@ param( # Supports $filter (eq, ne, not, in, and eq on null values). ${OnPremisesSyncEnabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Operating system of the device. @@ -10794,7 +10969,7 @@ param( # This property is read-only. ${OperatingSystem}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Operating system version of the device. @@ -10802,14 +10977,14 @@ param( # Supports $filter (eq, ne, not, ge, le, startsWith, and eq on null values). ${OperatingSystemVersion}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] # A list of additional email addresses for the user; for example: ['bob@contoso.com', 'Robert@fabrikam.com'].NOTE: While this property can contain accent characters, they can cause access issues to first-party applications for the user.Supports $filter (eq, NOT, ge, le, in, startsWith). ${OtherMail}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies password policies for the user. @@ -10818,14 +10993,13 @@ param( # The two may be specified together; for example: DisablePasswordExpiration, DisableStrongPassword.Supports $filter (ne, NOT). ${PasswordPolicy}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordProfile] # passwordProfile - # To construct, see NOTES section for PASSWORDPROFILE properties and create a hash table. ${PasswordProfile}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -10834,7 +11008,7 @@ param( # Supports $filter (eq, not, ge, le, startsWith). ${PhysicalId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The postal code for the user's postal address. @@ -10844,7 +11018,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${PostalCode}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The preferred language for the user. @@ -10852,7 +11026,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${PreferredLanguage}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # true if the Outlook global address list should contain this user, otherwise false. @@ -10861,7 +11035,7 @@ param( # Supports $filter (eq, ne, NOT, in). ${ShowInAddressList}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The state or province in the user's address. @@ -10869,7 +11043,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${State}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The street address of the user's place of business. @@ -10877,7 +11051,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${StreetAddress}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The user's surname (family name or last name). @@ -10885,7 +11059,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${Surname}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Type of trust for the joined device. @@ -10894,7 +11068,7 @@ param( # For more details, see Introduction to device management in Azure Active Directory ${TrustType}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # A two letter country code (ISO standard 3166). @@ -10904,7 +11078,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${UsageLocation}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The user principal name (UPN) of the user. @@ -10916,19 +11090,32 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith, endsWith) and $orderBy. ${UserPrincipalName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # A string value that can be used to classify user types in your directory, such as Member and Guest. # Supports $filter (eq, ne, NOT, in,). ${UserType}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -10987,6 +11174,8 @@ begin { $mapping = @{ UpdateExpanded = 'Az.MSGraph.private\Update-AzADUser_UpdateExpanded'; + UpdateViaJsonFilePath = 'Az.MSGraph.private\Update-AzADUser_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.MSGraph.private\Update-AzADUser_UpdateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/generated/Resources/MSGraph.Autorest/internal/Remove-AzADApplication.ps1 b/generated/Resources/MSGraph.Autorest/internal/Remove-AzADApplication.ps1 index bce8025468dc..67a5ef6004e4 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Remove-AzADApplication.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Remove-AzADApplication.ps1 @@ -36,11 +36,10 @@ function Remove-AzADApplication { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] - [Alias('ApplicationId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] # key: id of application - ${Id}, + ${ApplicationId}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Header')] @@ -53,7 +52,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] diff --git a/generated/Resources/MSGraph.Autorest/internal/Remove-AzADApplicationKey.ps1 b/generated/Resources/MSGraph.Autorest/internal/Remove-AzADApplicationKey.ps1 index 749b0b3709a0..3ecf16f4281d 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Remove-AzADApplicationKey.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Remove-AzADApplicationKey.ps1 @@ -54,7 +54,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsHxlydaApplicationsApplicationIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema] # . - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='RemoveExpanded')] @@ -75,12 +74,25 @@ param( # . ${Proof}, + [Parameter(ParameterSetName='RemoveViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Remove operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='RemoveViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Remove operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -140,6 +152,8 @@ begin { $mapping = @{ Remove = 'Az.MSGraph.private\Remove-AzADApplicationKey_Remove'; RemoveExpanded = 'Az.MSGraph.private\Remove-AzADApplicationKey_RemoveExpanded'; + RemoveViaJsonFilePath = 'Az.MSGraph.private\Remove-AzADApplicationKey_RemoveViaJsonFilePath'; + RemoveViaJsonString = 'Az.MSGraph.private\Remove-AzADApplicationKey_RemoveViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/generated/Resources/MSGraph.Autorest/internal/Remove-AzADApplicationPassword.ps1 b/generated/Resources/MSGraph.Autorest/internal/Remove-AzADApplicationPassword.ps1 index 575bde858fed..866cf65f4232 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Remove-AzADApplicationPassword.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Remove-AzADApplicationPassword.ps1 @@ -53,7 +53,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPathsHv033BApplicationsApplicationIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema] # . - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='RemoveExpanded')] @@ -68,12 +67,25 @@ param( # . ${KeyId}, + [Parameter(ParameterSetName='RemoveViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Remove operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='RemoveViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Remove operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -133,6 +145,8 @@ begin { $mapping = @{ Remove = 'Az.MSGraph.private\Remove-AzADApplicationPassword_Remove'; RemoveExpanded = 'Az.MSGraph.private\Remove-AzADApplicationPassword_RemoveExpanded'; + RemoveViaJsonFilePath = 'Az.MSGraph.private\Remove-AzADApplicationPassword_RemoveViaJsonFilePath'; + RemoveViaJsonString = 'Az.MSGraph.private\Remove-AzADApplicationPassword_RemoveViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/generated/Resources/MSGraph.Autorest/internal/Remove-AzADGroup.ps1 b/generated/Resources/MSGraph.Autorest/internal/Remove-AzADGroup.ps1 index 33f7db24483f..5ac5edff9cb0 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Remove-AzADGroup.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Remove-AzADGroup.ps1 @@ -36,11 +36,10 @@ function Remove-AzADGroup { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] - [Alias('GroupId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] # key: id of group - ${Id}, + ${GroupId}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Header')] @@ -53,7 +52,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] diff --git a/generated/Resources/MSGraph.Autorest/internal/Remove-AzADGroupRefMember.ps1 b/generated/Resources/MSGraph.Autorest/internal/Remove-AzADGroupRefMember.ps1 index 1e182a410d97..11d304c768ea 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Remove-AzADGroupRefMember.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Remove-AzADGroupRefMember.ps1 @@ -56,7 +56,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] diff --git a/generated/Resources/MSGraph.Autorest/internal/Remove-AzADServicePrincipal.ps1 b/generated/Resources/MSGraph.Autorest/internal/Remove-AzADServicePrincipal.ps1 index 531fa8b07d7c..9e0a2d4cabba 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Remove-AzADServicePrincipal.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Remove-AzADServicePrincipal.ps1 @@ -36,11 +36,10 @@ function Remove-AzADServicePrincipal { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] - [Alias('ServicePrincipalId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] # key: id of servicePrincipal - ${Id}, + ${ServicePrincipalId}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Header')] @@ -53,7 +52,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] diff --git a/generated/Resources/MSGraph.Autorest/internal/Remove-AzADServicePrincipalKey.ps1 b/generated/Resources/MSGraph.Autorest/internal/Remove-AzADServicePrincipalKey.ps1 index 2aa87463bfd7..e1d1ae871732 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Remove-AzADServicePrincipalKey.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Remove-AzADServicePrincipalKey.ps1 @@ -54,7 +54,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPaths1UhuhlbServiceprincipalsServiceprincipalIdMicrosoftGraphRemovekeyPostRequestbodyContentApplicationJsonSchema] # . - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='RemoveExpanded')] @@ -75,12 +74,25 @@ param( # . ${Proof}, + [Parameter(ParameterSetName='RemoveViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Remove operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='RemoveViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Remove operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -140,6 +152,8 @@ begin { $mapping = @{ Remove = 'Az.MSGraph.private\Remove-AzADServicePrincipalKey_Remove'; RemoveExpanded = 'Az.MSGraph.private\Remove-AzADServicePrincipalKey_RemoveExpanded'; + RemoveViaJsonFilePath = 'Az.MSGraph.private\Remove-AzADServicePrincipalKey_RemoveViaJsonFilePath'; + RemoveViaJsonString = 'Az.MSGraph.private\Remove-AzADServicePrincipalKey_RemoveViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/generated/Resources/MSGraph.Autorest/internal/Remove-AzADServicePrincipalPassword.ps1 b/generated/Resources/MSGraph.Autorest/internal/Remove-AzADServicePrincipalPassword.ps1 index 7b0f2ddc889d..52055a02938c 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Remove-AzADServicePrincipalPassword.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Remove-AzADServicePrincipalPassword.ps1 @@ -53,7 +53,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IPaths1Idoj4GServiceprincipalsServiceprincipalIdMicrosoftGraphRemovepasswordPostRequestbodyContentApplicationJsonSchema] # . - # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='RemoveExpanded')] @@ -68,12 +67,25 @@ param( # . ${KeyId}, + [Parameter(ParameterSetName='RemoveViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Remove operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='RemoveViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Remove operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -133,6 +145,8 @@ begin { $mapping = @{ Remove = 'Az.MSGraph.private\Remove-AzADServicePrincipalPassword_Remove'; RemoveExpanded = 'Az.MSGraph.private\Remove-AzADServicePrincipalPassword_RemoveExpanded'; + RemoveViaJsonFilePath = 'Az.MSGraph.private\Remove-AzADServicePrincipalPassword_RemoveViaJsonFilePath'; + RemoveViaJsonString = 'Az.MSGraph.private\Remove-AzADServicePrincipalPassword_RemoveViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/generated/Resources/MSGraph.Autorest/internal/Remove-AzADUser.ps1 b/generated/Resources/MSGraph.Autorest/internal/Remove-AzADUser.ps1 index 767ba1aea5a8..85d8a161cc2f 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Remove-AzADUser.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Remove-AzADUser.ps1 @@ -34,11 +34,10 @@ function Remove-AzADUser { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] - [Alias('UserId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] # key: id of user - ${Id}, + ${UserId}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Header')] @@ -51,7 +50,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] diff --git a/generated/Resources/MSGraph.Autorest/internal/Update-AzADApplication.ps1 b/generated/Resources/MSGraph.Autorest/internal/Update-AzADApplication.ps1 index 5e38b3bb412a..fb91d976e5ac 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Update-AzADApplication.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Update-AzADApplication.ps1 @@ -125,7 +125,7 @@ HOMEREALMDISCOVERYPOLICY : . [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -389,7 +389,7 @@ TOKENISSUANCEPOLICY : . [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -600,7 +600,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -777,70 +777,66 @@ function Update-AzADApplication { [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] - [Alias('ApplicationId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] # key: id of application - ${Id}, + ${ApplicationId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn[]] # Defines custom behavior that a consuming service can use to call an app in specific contexts. # For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. # This will let services like Office 365 call the application in the context of a document the user is working on. - # To construct, see NOTES section for ADDIN properties and create a hash table. ${AddIn}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Collections.Hashtable] # Additional Parameters ${AdditionalProperties}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphApiApplication] # apiApplication - # To construct, see NOTES section for API properties and create a hash table. ${Api}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole[]] # The collection of roles assigned to the application. # With app role assignments, these roles can be assigned to users, groups, or service principals associated with other applications. # Not nullable. - # To construct, see NOTES section for APPROLE properties and create a hash table. ${AppRole}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Unique identifier of the applicationTemplate. ${ApplicationTemplateId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # . ${CreatedOnBehalfOfDeletedDateTime}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name displayed in directory ${CreatedOnBehalfOfDisplayName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # . ${DeletedDateTime}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # An optional description of the application. @@ -848,7 +844,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, startsWith) and $search. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies whether Microsoft has disabled the registered application. @@ -856,37 +852,35 @@ param( # Supports $filter (eq, ne, NOT). ${DisabledByMicrosoftStatus}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name displayed in directory ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential[]] # Federated identities for applications. # Supports $expand and $filter (eq when counting empty collections). - # To construct, see NOTES section for FEDERATEDIDENTITYCREDENTIALS properties and create a hash table. ${FederatedIdentityCredentials}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Configures the groups claim issued in a user or OAuth 2.0 access token that the application expects. # To set this attribute, use one of the following string values: None, SecurityGroup (for security groups and Azure AD roles), All (this gets all security groups, distribution groups, and Azure AD directory roles that the signed-in user is a member of). ${GroupMembershipClaim}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy[]] # . - # To construct, see NOTES section for HOMEREALMDISCOVERYPOLICY properties and create a hash table. ${HomeRealmDiscoveryPolicy}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -897,21 +891,20 @@ param( # Supports $filter (eq, ne, ge, le, startsWith). ${IdentifierUri}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphInformationalUrl] # informationalUrl - # To construct, see NOTES section for INFO properties and create a hash table. ${Info}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Specifies whether this application supports device authentication without a user. # The default is false. ${IsDeviceOnlyAuthSupported}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Specifies the fallback application type as public client, such as an installed application running on a mobile device. @@ -921,66 +914,61 @@ param( # In those cases Azure AD interprets the application type based on the value of this property. ${IsFallbackPublicClient}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential[]] # The collection of key credentials associated with the application. # Not nullable. # Supports $filter (eq, NOT, ge, le). - # To construct, see NOTES section for KEYCREDENTIALS properties and create a hash table. ${KeyCredentials}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Input File for Logo (The main logo for the application. # Not nullable.) ${LogoInputFile}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Notes relevant for the management of the application. ${Note}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # . ${Oauth2RequirePostResponse}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphOptionalClaims] # optionalClaims - # To construct, see NOTES section for OPTIONALCLAIM properties and create a hash table. ${OptionalClaim}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphParentalControlSettings] # parentalControlSettings - # To construct, see NOTES section for PARENTALCONTROLSETTING properties and create a hash table. ${ParentalControlSetting}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential[]] # The collection of password credentials associated with the application. # Not nullable. - # To construct, see NOTES section for PASSWORDCREDENTIALS properties and create a hash table. ${PasswordCredentials}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPublicClientApplication] # publicClientApplication - # To construct, see NOTES section for PUBLICCLIENT properties and create a hash table. ${PublicClient}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphRequiredResourceAccess[]] @@ -989,17 +977,16 @@ param( # This configuration of access to the required resources drives the consent experience. # Not nullable. # Supports $filter (eq, NOT, ge, le). - # To construct, see NOTES section for REQUIREDRESOURCEACCESS properties and create a hash table. ${RequiredResourceAccess}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # References application or service contact information from a Service or Asset Management database. # Nullable. ${ServiceManagementReference}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the Microsoft accounts that are supported for the current application. @@ -1008,14 +995,13 @@ param( # Supports $filter (eq, ne, NOT). ${SignInAudience}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphSpaApplication] # spaApplication - # To construct, see NOTES section for SPA properties and create a hash table. ${Spa}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -1023,7 +1009,7 @@ param( # Not nullable.Supports $filter (eq, NOT, ge, le, startsWith). ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the keyId of a public key from the keyCredentials collection. @@ -1031,36 +1017,46 @@ param( # The application code that receives the encrypted token must use the matching private key to decrypt the token before it can be used for the signed-in user. ${TokenEncryptionKeyId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy[]] # . - # To construct, see NOTES section for TOKENISSUANCEPOLICY properties and create a hash table. ${TokenIssuancePolicy}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy[]] # The tokenLifetimePolicies assigned to this application. # Supports $expand. - # To construct, see NOTES section for TOKENLIFETIMEPOLICY properties and create a hash table. ${TokenLifetimePolicy}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphWebApplication] # webApplication - # To construct, see NOTES section for WEB properties and create a hash table. ${Web}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1119,6 +1115,8 @@ begin { $mapping = @{ UpdateExpanded = 'Az.MSGraph.private\Update-AzADApplication_UpdateExpanded'; + UpdateViaJsonFilePath = 'Az.MSGraph.private\Update-AzADApplication_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.MSGraph.private\Update-AzADApplication_UpdateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/generated/Resources/MSGraph.Autorest/internal/Update-AzADServicePrincipal.ps1 b/generated/Resources/MSGraph.Autorest/internal/Update-AzADServicePrincipal.ps1 index 77ac4a78bd0c..50ec2c134e3f 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Update-AzADServicePrincipal.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Update-AzADServicePrincipal.ps1 @@ -115,7 +115,7 @@ CLAIMSMAPPINGPOLICY : The claimsMappingPol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -348,7 +348,7 @@ HOMEREALMDISCOVERYPOLICY : The homeRe [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -598,7 +598,7 @@ TOKENISSUANCEPOLICY : The tokenIssuancePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -809,7 +809,7 @@ TOKENLIFETIMEPOLICY : The tokenLifetimePol [Extension ]: The collection of open extensions defined for the organization. Read-only. Nullable. [Id ]: The unique idenfier for an entity. Read-only. [MarketingNotificationEmail ]: Not nullable. - [MobileDeviceManagementAuthority ]: Mobile device management authority. + [MobileDeviceManagementAuthority ]: Mobile device management authority. [OnPremisesLastSyncDateTime ]: The time and date at which the tenant was last synced with the on-premises directory. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only. [OnPremisesSyncEnabled ]: true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced. Nullable. null if this object has never been synced from an on-premises directory (default). [PostalCode ]: Postal code of the address for the organization. @@ -980,36 +980,34 @@ function Update-AzADServicePrincipal { [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] - [Alias('ServicePrincipalId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] # key: id of servicePrincipal - ${Id}, + ${ServicePrincipalId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # true if the service principal account is enabled; otherwise, false. # Supports $filter (eq, ne, NOT, in). ${AccountEnabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAddIn[]] # Defines custom behavior that a consuming service can use to call an app in specific contexts. # For example, applications that can render file streams may set the addIns property for its 'FileHandler' functionality. # This will let services like Microsoft 365 call the application in the context of a document the user is working on. - # To construct, see NOTES section for ADDIN properties and create a hash table. ${AddIn}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Collections.Hashtable] # Additional Parameters ${AdditionalProperties}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -1017,59 +1015,56 @@ param( # Supports $filter (eq, NOT, ge, le, startsWith). ${AlternativeName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The description exposed by the associated application. ${AppDescription}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The display name exposed by the associated application. ${AppDisplayName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The unique identifier for the associated application (its appId property). ${AppId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Contains the tenant id where the application is registered. # This is applicable only to service principals backed by applications.Supports $filter (eq, ne, NOT, ge, le). ${AppOwnerOrganizationId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRole[]] # The roles exposed by the application which this service principal represents. # For more information see the appRoles property definition on the application entity. # Not nullable. - # To construct, see NOTES section for APPROLE properties and create a hash table. ${AppRole}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment[]] # App role assignments for this app or service, granted to users, groups, and other service principals.Supports $expand. - # To construct, see NOTES section for APPROLEASSIGNEDTO properties and create a hash table. ${AppRoleAssignedTo}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphAppRoleAssignment[]] # App role assignment for another app or service, granted to this service principal. # Supports $expand. - # To construct, see NOTES section for APPROLEASSIGNMENT properties and create a hash table. ${AppRoleAssignment}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Specifies whether users or other service principals need to be granted an app role assignment for this service principal before users can sign in or apps can get tokens. @@ -1078,31 +1073,29 @@ param( # Supports $filter (eq, ne, NOT). ${AppRoleAssignmentRequired}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphClaimsMappingPolicy[]] # The claimsMappingPolicies assigned to this service principal. # Supports $expand. - # To construct, see NOTES section for CLAIMSMAPPINGPOLICY properties and create a hash table. ${ClaimsMappingPolicy}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDelegatedPermissionClassification[]] # The permission classifications for delegated permissions exposed by the app that this service principal represents. # Supports $expand. - # To construct, see NOTES section for DELEGATEDPERMISSIONCLASSIFICATION properties and create a hash table. ${DelegatedPermissionClassification}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # . ${DeletedDateTime}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Free text field to provide an internal end-user facing description of the service principal. @@ -1111,7 +1104,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, startsWith) and $search. ${Description}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies whether Microsoft has disabled the registered application. @@ -1119,62 +1112,57 @@ param( # Supports $filter (eq, ne, NOT). ${DisabledByMicrosoftStatus}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name displayed in directory ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEndpoint[]] # Endpoints available for discovery. # Services like Sharepoint populate this property with a tenant specific SharePoint endpoints that other applications can discover and use in their experiences. - # To construct, see NOTES section for ENDPOINT properties and create a hash table. ${Endpoint}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphFederatedIdentityCredential[]] # . - # To construct, see NOTES section for FEDERATEDIDENTITYCREDENTIALS properties and create a hash table. ${FederatedIdentityCredentials}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphHomeRealmDiscoveryPolicy[]] # The homeRealmDiscoveryPolicies assigned to this service principal. # Supports $expand. - # To construct, see NOTES section for HOMEREALMDISCOVERYPOLICY properties and create a hash table. ${HomeRealmDiscoveryPolicy}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Home page or landing page of the application. ${Homepage}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphInformationalUrl] # informationalUrl - # To construct, see NOTES section for INFO properties and create a hash table. ${Info}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphKeyCredential[]] # The collection of key credentials associated with the service principal. # Not nullable. # Supports $filter (eq, NOT, ge, le). - # To construct, see NOTES section for KEYCREDENTIALS properties and create a hash table. ${KeyCredentials}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the URL where the service provider redirects the user to Azure AD to authenticate. @@ -1183,20 +1171,20 @@ param( # The user launches the application from Microsoft 365, the Azure AD My Apps, or the Azure AD SSO URL. ${LoginUrl}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the URL that will be used by Microsoft's authorization service to logout an user using OpenId Connect front-channel, back-channel or SAML logout protocols. ${LogoutUrl}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Free text field to capture information about the service principal, typically used for operational purposes. # Maximum allowed size is 1024 characters. ${Note}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -1204,26 +1192,24 @@ param( # This is only for the certificates used to sign the SAML token issued for Azure AD Gallery applications. ${NotificationEmailAddress}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPermissionScope[]] # The delegated permissions exposed by the application. # For more information see the oauth2PermissionScopes property on the application entity's api property. # Not nullable. - # To construct, see NOTES section for OAUTH2PERMISSIONSCOPE properties and create a hash table. ${Oauth2PermissionScope}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordCredential[]] # The collection of password credentials associated with the service principal. # Not nullable. - # To construct, see NOTES section for PASSWORDCREDENTIALS properties and create a hash table. ${PasswordCredentials}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the single sign-on mode configured for this application. @@ -1231,7 +1217,7 @@ param( # The supported values are password, saml, notSupported, and oidc. ${PreferredSingleSignOnMode}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Reserved for internal use only. @@ -1239,7 +1225,7 @@ param( # May be removed in future versions. ${PreferredTokenSigningKeyThumbprint}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -1247,14 +1233,13 @@ param( # Not nullable. ${ReplyUrl}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphSamlSingleSignOnSettings] # samlSingleSignOnSettings - # To construct, see NOTES section for SAMLSINGLESIGNONSETTING properties and create a hash table. ${SamlSingleSignOnSetting}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -1266,7 +1251,7 @@ param( # Supports $filter (eq, NOT, ge, le, startsWith). ${ServicePrincipalName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Identifies if the service principal represents an application or a managed identity. @@ -1275,7 +1260,7 @@ param( # For a service principal that represent a managed identity this is set as ManagedIdentity. ${ServicePrincipalType}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -1284,7 +1269,7 @@ param( # Supports $filter (eq, NOT, ge, le, startsWith). ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies the keyId of a public key from the keyCredentials collection. @@ -1292,38 +1277,48 @@ param( # The application code that receives the encrypted token must use the matching private key to decrypt the token before it can be used for the signed-in user. ${TokenEncryptionKeyId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenIssuancePolicy[]] # The tokenIssuancePolicies assigned to this service principal. # Supports $expand. - # To construct, see NOTES section for TOKENISSUANCEPOLICY properties and create a hash table. ${TokenIssuancePolicy}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphTokenLifetimePolicy[]] # The tokenLifetimePolicies assigned to this service principal. # Supports $expand. - # To construct, see NOTES section for TOKENLIFETIMEPOLICY properties and create a hash table. ${TokenLifetimePolicy}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject[]] # . - # To construct, see NOTES section for TRANSITIVEMEMBEROF properties and create a hash table. ${TransitiveMemberOf}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1382,6 +1377,8 @@ begin { $mapping = @{ UpdateExpanded = 'Az.MSGraph.private\Update-AzADServicePrincipal_UpdateExpanded'; + UpdateViaJsonFilePath = 'Az.MSGraph.private\Update-AzADServicePrincipal_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.MSGraph.private\Update-AzADServicePrincipal_UpdateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/generated/Resources/MSGraph.Autorest/internal/Update-AzADUser.ps1 b/generated/Resources/MSGraph.Autorest/internal/Update-AzADUser.ps1 index 00b31d142d81..f15260da09c1 100644 --- a/generated/Resources/MSGraph.Autorest/internal/Update-AzADUser.ps1 +++ b/generated/Resources/MSGraph.Autorest/internal/Update-AzADUser.ps1 @@ -56,13 +56,12 @@ function Update-AzADUser { [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] - [Alias('UserId')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Path')] [System.String] # key: id of user - ${Id}, + ${UserId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # true for enabling the account; otherwise, false. @@ -70,13 +69,13 @@ param( # `-AccountEnabled $false` is ignored when changing the account's password. ${AccountEnabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Collections.Hashtable] # Additional Parameters ${AdditionalProperties}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Sets the age group of the user. @@ -85,7 +84,7 @@ param( # Supports $filter (eq, ne, NOT, and in). ${AgeGroup}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # The timestamp type represents date and time information using ISO 8601 format and is always in UTC time. @@ -94,7 +93,7 @@ param( # Supports $filter (eq, ne, not, ge, le, and eq on null values) and $orderBy. ${ApproximateLastSignInDateTime}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The city in which the user is located. @@ -102,7 +101,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${City}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The company name which the user is associated. @@ -110,7 +109,7 @@ param( # The maximum length of the company name is 64 characters.Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${CompanyName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # The timestamp when the device is no longer deemed compliant. @@ -119,7 +118,7 @@ param( # Read-only. ${ComplianceExpirationDateTime}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Sets whether consent has been obtained for minors. @@ -128,7 +127,7 @@ param( # Supports $filter (eq, ne, NOT, and in). ${ConsentProvidedForMinor}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The country/region in which the user is located; for example, US or UK. @@ -136,53 +135,52 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${Country}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # . ${DeletedDateTime}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name for the department in which the user works. # Maximum length is 64 characters.Supports $filter (eq, ne, NOT , ge, le, and in operators). ${Department}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Int32] # For internal use only. ${DeviceVersion}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The name displayed in directory ${DisplayName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # The date and time when the user was hired or will start work in case of a future hire. # Supports $filter (eq, ne, NOT , ge, le, in). ${EmployeeHireDate}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The employee identifier assigned to the user by the organization. # Supports $filter (eq, ne, NOT , ge, le, in, startsWith). ${EmployeeId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphEmployeeOrgData] # employeeOrgData - # To construct, see NOTES section for EMPLOYEEORGDATA properties and create a hash table. ${EmployeeOrgData}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Captures enterprise worker type. @@ -190,7 +188,7 @@ param( # Supports $filter (eq, ne, NOT , ge, le, in, startsWith). ${EmployeeType}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # For an external user invited to the tenant using the invitation API, this property represents the invited user's invitation status. @@ -198,21 +196,21 @@ param( # Supports $filter (eq, ne, NOT , in). ${ExternalUserState}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # Shows the timestamp for the latest change to the externalUserState property. # Supports $filter (eq, ne, NOT , in). ${ExternalUserStateChangeDateTime}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The fax number of the user. # Supports $filter (eq, ne, NOT , ge, le, in, startsWith). ${FaxNumber}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The given name (first name) of the user. @@ -220,7 +218,7 @@ param( # Supports $filter (eq, ne, NOT , ge, le, in, startsWith). ${GivenName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphObjectIdentity[]] @@ -228,16 +226,15 @@ param( # An identity can be provided by Microsoft (also known as a local account), by organizations, or by social identity providers such as Facebook, Google, and Microsoft, and tied to a user account. # May contain multiple items with the same signInType value. # Supports $filter (eq) only where the signInType is not userPrincipalName. - # To construct, see NOTES section for IDENTITY properties and create a hash table. ${Identity}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # Do not use - reserved for future use. ${IsResourceAccount}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The user's job title. @@ -245,7 +242,7 @@ param( # Supports $filter (eq, ne, NOT , ge, le, in, startsWith). ${JobTitle}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The SMTP address for the user, for example, admin@contoso.com. @@ -254,7 +251,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith, endsWith). ${Mail}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The mail alias for the user. @@ -263,15 +260,14 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${MailNickname}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphDirectoryObject] # Represents an Azure Active Directory object. # The directoryObject type is the base type for many other directory entity types. - # To construct, see NOTES section for MANAGER properties and create a hash table. ${Manager}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The office location in the user's place of business. @@ -279,7 +275,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${OfficeLocation}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # This property is used to associate an on-premises Active Directory user account to their Azure AD user object. @@ -289,7 +285,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in).. ${OnPremisesImmutableId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.DateTime] # The last time at which the object was synced with the on-premises directory. @@ -298,7 +294,7 @@ param( # Supports $filter (eq, ne, not, ge, le, in). ${OnPremisesLastSyncDateTime}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced; null if this object has never been synced from an on-premises directory (default). @@ -306,7 +302,7 @@ param( # Supports $filter (eq, ne, not, in, and eq on null values). ${OnPremisesSyncEnabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Operating system of the device. @@ -314,7 +310,7 @@ param( # This property is read-only. ${OperatingSystem}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Operating system version of the device. @@ -322,14 +318,14 @@ param( # Supports $filter (eq, ne, not, ge, le, startsWith, and eq on null values). ${OperatingSystemVersion}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] # A list of additional email addresses for the user; for example: ['bob@contoso.com', 'Robert@fabrikam.com'].NOTE: While this property can contain accent characters, they can cause access issues to first-party applications for the user.Supports $filter (eq, NOT, ge, le, in, startsWith). ${OtherMail}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Specifies password policies for the user. @@ -338,14 +334,13 @@ param( # The two may be specified together; for example: DisablePasswordExpiration, DisableStrongPassword.Supports $filter (ne, NOT). ${PasswordPolicy}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.IMicrosoftGraphPasswordProfile] # passwordProfile - # To construct, see NOTES section for PASSWORDPROFILE properties and create a hash table. ${PasswordProfile}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String[]] @@ -354,7 +349,7 @@ param( # Supports $filter (eq, not, ge, le, startsWith). ${PhysicalId}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The postal code for the user's postal address. @@ -364,7 +359,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${PostalCode}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The preferred language for the user. @@ -372,7 +367,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${PreferredLanguage}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.Management.Automation.SwitchParameter] # true if the Outlook global address list should contain this user, otherwise false. @@ -381,7 +376,7 @@ param( # Supports $filter (eq, ne, NOT, in). ${ShowInAddressList}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The state or province in the user's address. @@ -389,7 +384,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${State}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The street address of the user's place of business. @@ -397,7 +392,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${StreetAddress}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The user's surname (family name or last name). @@ -405,7 +400,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${Surname}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # Type of trust for the joined device. @@ -414,7 +409,7 @@ param( # For more details, see Introduction to device management in Azure Active Directory ${TrustType}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # A two letter country code (ISO standard 3166). @@ -424,7 +419,7 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith). ${UsageLocation}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # The user principal name (UPN) of the user. @@ -436,19 +431,32 @@ param( # Supports $filter (eq, ne, NOT, ge, le, in, startsWith, endsWith) and $orderBy. ${UserPrincipalName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] [System.String] # A string value that can be used to classify user types in your directory, such as Member and Guest. # Supports $filter (eq, ne, NOT, in,). ${UserType}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -507,6 +515,8 @@ begin { $mapping = @{ UpdateExpanded = 'Az.MSGraph.private\Update-AzADUser_UpdateExpanded'; + UpdateViaJsonFilePath = 'Az.MSGraph.private\Update-AzADUser_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.MSGraph.private\Update-AzADUser_UpdateViaJsonString'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) diff --git a/generated/Resources/MSGraph.Autorest/test-module.ps1 b/generated/Resources/MSGraph.Autorest/test-module.ps1 index ce19f1ec006c..a26dd14e14a2 100644 --- a/generated/Resources/MSGraph.Autorest/test-module.ps1 +++ b/generated/Resources/MSGraph.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) @@ -74,13 +74,14 @@ try if ($TestMode -ne 'playback') { setupEnv + } else { + $env:AzPSAutorestTestPlaybackMode = $true } $testFolder = Join-Path $PSScriptRoot 'test' if ($null -ne $TestName) { Invoke-Pester -Script @{ Path = $testFolder } -TestName $TestName -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml") - } else - { + } else { Invoke-Pester -Script @{ Path = $testFolder } -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml") } } Finally @@ -89,6 +90,9 @@ try { cleanupEnv } + else { + $env:AzPSAutorestTestPlaybackMode = '' + } } -Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file +Write-Host -ForegroundColor Green '-------------Done-------------'