From e89a66193b36b6c6802dfeffb32ffbcc686bfa0c Mon Sep 17 00:00:00 2001 From: almasak <162407742+almasak@users.noreply.github.com> Date: Mon, 28 Oct 2024 03:56:09 +0530 Subject: [PATCH] NeonPostgres PS cmdlets 2024-08-01-preview - Initial commit --- .../NeonPostgres.Autorest/.gitattributes | 1 + .../NeonPostgres.Autorest/.gitignore | 16 + .../Az.NeonPostgres.psd1 | 23 + .../NeonPostgres.Autorest/README.md | 73 ++ .../UX/Neon.Postgres/organizations.json | 85 +++ .../NeonPostgres.Autorest/custom/README.md | 41 ++ .../docs/Az.NeonPostgres.md | 25 + .../docs/Get-AzNeonPostgresOrganization.md | 159 +++++ .../docs/New-AzNeonPostgresOrganization.md | 646 ++++++++++++++++++ .../NeonPostgres.Autorest/docs/README.md | 11 + .../docs/Remove-AzNeonPostgresOrganization.md | 224 ++++++ .../docs/Update-AzNeonPostgresOrganization.md | 538 +++++++++++++++ .../Get-AzNeonPostgresOrganization.md | 22 + .../New-AzNeonPostgresOrganization.md | 22 + .../Remove-AzNeonPostgresOrganization.md | 22 + .../Update-AzNeonPostgresOrganization.md | 22 + .../NeonPostgres.Autorest/how-to.md | 58 ++ .../NeonPostgres.Autorest/license.txt | 227 ++++++ .../NeonPostgres.Autorest/resources/README.md | 11 + .../Get-AzNeonPostgresOrganization.Tests.ps1 | 33 + .../New-AzNeonPostgresOrganization.Tests.ps1 | 29 + .../NeonPostgres.Autorest/test/README.md | 17 + ...emove-AzNeonPostgresOrganization.Tests.ps1 | 25 + ...pdate-AzNeonPostgresOrganization.Tests.ps1 | 33 + .../NeonPostgres.Autorest/test/loadEnv.ps1 | 29 + .../NeonPostgres.Autorest/test/utils.ps1 | 56 ++ .../utils/Get-SubscriptionIdTestSafe.ps1 | 7 + .../utils/Unprotect-SecureString.ps1 | 16 + 28 files changed, 2471 insertions(+) create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/.gitattributes create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/.gitignore create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/Az.NeonPostgres.psd1 create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/README.md create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/UX/Neon.Postgres/organizations.json create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/custom/README.md create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/docs/Az.NeonPostgres.md create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/docs/Get-AzNeonPostgresOrganization.md create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/docs/New-AzNeonPostgresOrganization.md create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/docs/README.md create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/docs/Remove-AzNeonPostgresOrganization.md create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/docs/Update-AzNeonPostgresOrganization.md create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/examples/Get-AzNeonPostgresOrganization.md create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/examples/New-AzNeonPostgresOrganization.md create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/examples/Remove-AzNeonPostgresOrganization.md create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/examples/Update-AzNeonPostgresOrganization.md create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/how-to.md create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/license.txt create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/resources/README.md create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/test/Get-AzNeonPostgresOrganization.Tests.ps1 create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/test/New-AzNeonPostgresOrganization.Tests.ps1 create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/test/README.md create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/test/Remove-AzNeonPostgresOrganization.Tests.ps1 create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/test/Update-AzNeonPostgresOrganization.Tests.ps1 create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/test/loadEnv.ps1 create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/test/utils.ps1 create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/utils/Get-SubscriptionIdTestSafe.ps1 create mode 100644 src/NeonPostgres/NeonPostgres.Autorest/utils/Unprotect-SecureString.ps1 diff --git a/src/NeonPostgres/NeonPostgres.Autorest/.gitattributes b/src/NeonPostgres/NeonPostgres.Autorest/.gitattributes new file mode 100644 index 000000000000..2125666142eb --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/src/NeonPostgres/NeonPostgres.Autorest/.gitignore b/src/NeonPostgres/NeonPostgres.Autorest/.gitignore new file mode 100644 index 000000000000..3c3d57339c8b --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/.gitignore @@ -0,0 +1,16 @@ +bin +obj +.vs +generated +internal +exports +tools +custom/*.psm1 +custom/autogen-model-cmdlets +test/*-TestResults.xml +/*.ps1 +/*.ps1xml +/*.psm1 +/*.snk +/*.csproj +/*.nuspec \ No newline at end of file diff --git a/src/NeonPostgres/NeonPostgres.Autorest/Az.NeonPostgres.psd1 b/src/NeonPostgres/NeonPostgres.Autorest/Az.NeonPostgres.psd1 new file mode 100644 index 000000000000..63ceef78f102 --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/Az.NeonPostgres.psd1 @@ -0,0 +1,23 @@ +@{ + GUID = 'b3e01e02-1629-4884-8793-ec1494a14142' + RootModule = './Az.NeonPostgres.psm1' + ModuleVersion = '0.1.0' + CompatiblePSEditions = 'Core', 'Desktop' + Author = 'Microsoft Corporation' + CompanyName = 'Microsoft Corporation' + Copyright = 'Microsoft Corporation. All rights reserved.' + Description = 'Microsoft Azure PowerShell: NeonPostgres cmdlets' + PowerShellVersion = '5.1' + DotNetFrameworkVersion = '4.7.2' + RequiredAssemblies = './bin/Az.NeonPostgres.private.dll' + FormatsToProcess = './Az.NeonPostgres.format.ps1xml' + FunctionsToExport = 'Get-AzNeonPostgresOrganization', 'New-AzNeonPostgresOrganization', 'Remove-AzNeonPostgresOrganization', 'Update-AzNeonPostgresOrganization' + PrivateData = @{ + PSData = @{ + Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'NeonPostgres' + LicenseUri = 'https://aka.ms/azps-license' + ProjectUri = 'https://github.com/Azure/azure-powershell' + ReleaseNotes = '' + } + } +} diff --git a/src/NeonPostgres/NeonPostgres.Autorest/README.md b/src/NeonPostgres/NeonPostgres.Autorest/README.md new file mode 100644 index 000000000000..d9dd3849ba23 --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/README.md @@ -0,0 +1,73 @@ + +# Az.NeonPostgres +This directory contains the PowerShell module for the NeonPostgres service. + +--- +## Info +- Modifiable: yes +- Generated: all +- Committed: yes +- Packaged: yes + +--- +## Detail +This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. + +## Module Requirements +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater + +## Authentication +AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. + +## Development +For information on how to develop for `Az.NeonPostgres`, see [how-to.md](how-to.md). + + +### AutoRest Configuration +> see https://aka.ms/autorest + +```yaml +# pin the swagger version by using the commit id instead of branch name +commit: 75fdb87b5367a3ab306e85fb6daa7501d54f0553 +require: +# readme.azure.noprofile.md is the common configuration file + - $(this-folder)/../../readme.azure.noprofile.md + - $(repo)/specification/liftrneon/resource-manager/readme.md +# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally +# - (this-folder)/relative-path-to-your-local-readme.md + +try-require: + - $(repo)/specification/liftrneon/resource-manager/readme.powershell.md + +# For new RP, the version is 0.1.0 +module-version: 0.1.0 +# Normally, title is the service name +title: NeonPostgres +subject-prefix: $(service-name) + +# The next three configurations are exclusive to v3, and in v4, they are activated by default. If you are still using v3, please uncomment them. +# identity-correction-for-post: true +# resourcegroup-append: true +# nested-object-to-string: true + +directive: + # Following are common directives which are normally required in all the RPs + # 1. Remove the unexpanded parameter set + # 2. For New-* cmdlets, ViaIdentity is not required + # Following two directives are v4 specific + - where: + variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString)) + remove: true + - where: + variant: ^CreateViaIdentity.*$ + remove: true + # Follow directive is v3 specific. If you are using v3, uncomment following directive and comments out two directives above + #- where: + # variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$ + # remove: true + + # Remove the set-* cmdlet + - where: + verb: Set + remove: true +``` diff --git a/src/NeonPostgres/NeonPostgres.Autorest/UX/Neon.Postgres/organizations.json b/src/NeonPostgres/NeonPostgres.Autorest/UX/Neon.Postgres/organizations.json new file mode 100644 index 000000000000..a00f96717c90 --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/UX/Neon.Postgres/organizations.json @@ -0,0 +1,85 @@ +{ + "resourceType": "organizations", + "apiVersion": "2024-08-01-preview", + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.neonpostgres" + }, + "commands": [ + { + "name": "Get-AzNeonPostgresOrganization", + "description": "Get a OrganizationResource", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}", + "help": { + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.neonpostgres/get-azneonpostgresorganization" + }, + "parameterSets": [ + { + "parameters": [ + "-Name ", + "-ResourceGroupName ", + "[-SubscriptionId ]" + ] + } + ] + }, + "examples": [ + { + "description": "Get a OrganizationResource", + "parameters": [ + { + "name": "-Name", + "value": "[Path.organizationName]" + }, + { + "name": "-ResourceGroupName", + "value": "[Path.resourceGroupName]" + }, + { + "name": "-SubscriptionId", + "value": "[Path.subscriptionId]" + } + ] + } + ] + }, + { + "name": "Remove-AzNeonPostgresOrganization", + "description": "Delete a OrganizationResource", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}", + "help": { + "learnMore": { + "url": "https://learn.microsoft.com/powershell/module/az.neonpostgres/remove-azneonpostgresorganization" + }, + "parameterSets": [ + { + "parameters": [ + "-Name ", + "-ResourceGroupName ", + "[-SubscriptionId ]" + ] + } + ] + }, + "examples": [ + { + "description": "Delete a OrganizationResource", + "parameters": [ + { + "name": "-Name", + "value": "[Path.organizationName]" + }, + { + "name": "-ResourceGroupName", + "value": "[Path.resourceGroupName]" + }, + { + "name": "-SubscriptionId", + "value": "[Path.subscriptionId]" + } + ] + } + ] + } + ] +} diff --git a/src/NeonPostgres/NeonPostgres.Autorest/custom/README.md b/src/NeonPostgres/NeonPostgres.Autorest/custom/README.md new file mode 100644 index 000000000000..a2b2d2306ba7 --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/custom/README.md @@ -0,0 +1,41 @@ +# Custom +This directory contains custom implementation for non-generated cmdlets for the `Az.NeonPostgres` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `..\exports` folder. The only generated file into this folder is the `Az.NeonPostgres.custom.psm1`. This file should not be modified. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: yes + +## Details +For `Az.NeonPostgres` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*. + +For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.NeonPostgres.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder. + +For script cmdlets, these are loaded via the `Az.NeonPostgres.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundamental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build. + +## Purpose +This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `..\exports` folder. + +## Usage +The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `..\exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters: +- Break +- DefaultProfile +- HttpPipelineAppend +- HttpPipelinePrepend +- Proxy +- ProxyCredential +- ProxyUseDefaultCredentials + +These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.NeonPostgres`. For C#, follow the usage seen in the `ProcessRecordAsync` method. + +### Attributes +For processing the cmdlets, we've created some additional attributes: +- `Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.DescriptionAttribute` + - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts. +- `Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.DoNotExportAttribute` + - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.NeonPostgres`. +- `Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.InternalExportAttribute` + - Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.NeonPostgres`. For more information, see [README.md](..\internal/README.md) in the `..\internal` folder. +- `Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.ProfileAttribute` + - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules. \ No newline at end of file diff --git a/src/NeonPostgres/NeonPostgres.Autorest/docs/Az.NeonPostgres.md b/src/NeonPostgres/NeonPostgres.Autorest/docs/Az.NeonPostgres.md new file mode 100644 index 000000000000..91301aae79e2 --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/docs/Az.NeonPostgres.md @@ -0,0 +1,25 @@ +--- +Module Name: Az.NeonPostgres +Module Guid: b3e01e02-1629-4884-8793-ec1494a14142 +Download Help Link: https://learn.microsoft.com/powershell/module/az.neonpostgres +Help Version: 1.0.0.0 +Locale: en-US +--- + +# Az.NeonPostgres Module +## Description +Microsoft Azure PowerShell: NeonPostgres cmdlets + +## Az.NeonPostgres Cmdlets +### [Get-AzNeonPostgresOrganization](Get-AzNeonPostgresOrganization.md) +Get a OrganizationResource + +### [New-AzNeonPostgresOrganization](New-AzNeonPostgresOrganization.md) +Create a OrganizationResource + +### [Remove-AzNeonPostgresOrganization](Remove-AzNeonPostgresOrganization.md) +Delete a OrganizationResource + +### [Update-AzNeonPostgresOrganization](Update-AzNeonPostgresOrganization.md) +Update a OrganizationResource + diff --git a/src/NeonPostgres/NeonPostgres.Autorest/docs/Get-AzNeonPostgresOrganization.md b/src/NeonPostgres/NeonPostgres.Autorest/docs/Get-AzNeonPostgresOrganization.md new file mode 100644 index 000000000000..b77cc93473fd --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/docs/Get-AzNeonPostgresOrganization.md @@ -0,0 +1,159 @@ +--- +external help file: +Module Name: Az.NeonPostgres +online version: https://learn.microsoft.com/powershell/module/az.neonpostgres/get-azneonpostgresorganization +schema: 2.0.0 +--- + +# Get-AzNeonPostgresOrganization + +## SYNOPSIS +Get a OrganizationResource + +## SYNTAX + +### List (Default) +``` +Get-AzNeonPostgresOrganization [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzNeonPostgresOrganization -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzNeonPostgresOrganization -InputObject [-DefaultProfile ] + [] +``` + +### List1 +``` +Get-AzNeonPostgresOrganization -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Get a OrganizationResource + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here (remove the output block if the example doesn't have an output) }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here (remove the output block if the example doesn't have an output) }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.INeonPostgresIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the Neon Organizations resource + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: OrganizationName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String[] +Parameter Sets: Get, List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.INeonPostgresIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IOrganizationResource + +## NOTES + +## RELATED LINKS + diff --git a/src/NeonPostgres/NeonPostgres.Autorest/docs/New-AzNeonPostgresOrganization.md b/src/NeonPostgres/NeonPostgres.Autorest/docs/New-AzNeonPostgresOrganization.md new file mode 100644 index 000000000000..61737fb90726 --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/docs/New-AzNeonPostgresOrganization.md @@ -0,0 +1,646 @@ +--- +external help file: +Module Name: Az.NeonPostgres +online version: https://learn.microsoft.com/powershell/module/az.neonpostgres/new-azneonpostgresorganization +schema: 2.0.0 +--- + +# New-AzNeonPostgresOrganization + +## SYNOPSIS +Create a OrganizationResource + +## SYNTAX + +### CreateExpanded (Default) +``` +New-AzNeonPostgresOrganization -Name -ResourceGroupName -Location + [-SubscriptionId ] [-CompanyDetailBusinessPhone ] [-CompanyDetailCompanyName ] + [-CompanyDetailCountry ] [-CompanyDetailDomain ] [-CompanyDetailNumberOfEmployee ] + [-CompanyDetailOfficeAddress ] [-MarketplaceDetailSubscriptionId ] + [-MarketplaceDetailSubscriptionStatus ] [-OfferDetailOfferId ] [-OfferDetailPlanId ] + [-OfferDetailPlanName ] [-OfferDetailPublisherId ] [-OfferDetailTermId ] + [-OfferDetailTermUnit ] [-PartnerOrganizationPropertyOrganizationId ] + [-PartnerOrganizationPropertyOrganizationName ] [-SingleSignOnPropertyAadDomain ] + [-SingleSignOnPropertyEnterpriseAppId ] [-SingleSignOnPropertySingleSignOnState ] + [-SingleSignOnPropertySingleSignOnUrl ] [-Tag ] [-UserDetailEmailAddress ] + [-UserDetailFirstName ] [-UserDetailLastName ] [-UserDetailPhoneNumber ] + [-UserDetailUpn ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +### CreateViaJsonFilePath +``` +New-AzNeonPostgresOrganization -Name -ResourceGroupName -JsonFilePath + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +### CreateViaJsonString +``` +New-AzNeonPostgresOrganization -Name -ResourceGroupName -JsonString + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Create a OrganizationResource + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here (remove the output block if the example doesn't have an output) }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here (remove the output block if the example doesn't have an output) }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CompanyDetailBusinessPhone +Business phone number of the company + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CompanyDetailCompanyName +Company name + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CompanyDetailCountry +Country name of the company + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CompanyDetailDomain +Domain of the user + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CompanyDetailNumberOfEmployee +Number of employees in the company + +```yaml +Type: System.Int64 +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CompanyDetailOfficeAddress +Office address of the company + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -JsonFilePath +Path of Json file supplied to the Create operation + +```yaml +Type: System.String +Parameter Sets: CreateViaJsonFilePath +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -JsonString +Json string supplied to the Create operation + +```yaml +Type: System.String +Parameter Sets: CreateViaJsonString +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +The geo-location where the resource lives + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MarketplaceDetailSubscriptionId +SaaS subscription id for the the marketplace offer + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MarketplaceDetailSubscriptionStatus +Marketplace subscription status + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the Neon Organizations resource + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: OrganizationName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OfferDetailOfferId +Offer Id for the marketplace offer + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OfferDetailPlanId +Plan Id for the marketplace offer + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OfferDetailPlanName +Plan Name for the marketplace offer + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OfferDetailPublisherId +Publisher Id for the marketplace offer + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OfferDetailTermId +Term Id for the marketplace offer + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -OfferDetailTermUnit +Term Name for the marketplace offer + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerOrganizationPropertyOrganizationId +Organization Id in partner's system + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerOrganizationPropertyOrganizationName +Organization name in partner's system + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SingleSignOnPropertyAadDomain +List of AAD domains fetched from Microsoft Graph for user. + +```yaml +Type: System.String[] +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SingleSignOnPropertyEnterpriseAppId +AAD enterprise application Id used to setup SSO + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SingleSignOnPropertySingleSignOnState +State of the Single Sign On for the organization + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SingleSignOnPropertySingleSignOnUrl +URL for SSO to be used by the partner to redirect the user to their system + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -UserDetailEmailAddress +Email address of the user + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -UserDetailFirstName +First name of the user + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -UserDetailLastName +Last name of the user + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -UserDetailPhoneNumber +User's phone number + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -UserDetailUpn +User's principal name + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IOrganizationResource + +## NOTES + +## RELATED LINKS + diff --git a/src/NeonPostgres/NeonPostgres.Autorest/docs/README.md b/src/NeonPostgres/NeonPostgres.Autorest/docs/README.md new file mode 100644 index 000000000000..9b75b830dbd2 --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/docs/README.md @@ -0,0 +1,11 @@ +# Docs +This directory contains the documentation of the cmdlets for the `Az.NeonPostgres` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overridden on regeneration*. To update documentation examples, please use the `..\examples` folder. + +## Info +- Modifiable: no +- Generated: all +- Committed: yes +- Packaged: yes + +## Details +The process of documentation generation loads `Az.NeonPostgres` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder. \ No newline at end of file diff --git a/src/NeonPostgres/NeonPostgres.Autorest/docs/Remove-AzNeonPostgresOrganization.md b/src/NeonPostgres/NeonPostgres.Autorest/docs/Remove-AzNeonPostgresOrganization.md new file mode 100644 index 000000000000..f5eb59548c73 --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/docs/Remove-AzNeonPostgresOrganization.md @@ -0,0 +1,224 @@ +--- +external help file: +Module Name: Az.NeonPostgres +online version: https://learn.microsoft.com/powershell/module/az.neonpostgres/remove-azneonpostgresorganization +schema: 2.0.0 +--- + +# Remove-AzNeonPostgresOrganization + +## SYNOPSIS +Delete a OrganizationResource + +## SYNTAX + +### Delete (Default) +``` +Remove-AzNeonPostgresOrganization -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzNeonPostgresOrganization -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete a OrganizationResource + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here (remove the output block if the example doesn't have an output) }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here (remove the output block if the example doesn't have an output) }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.INeonPostgresIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the Neon Organizations resource + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: OrganizationName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.INeonPostgresIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/src/NeonPostgres/NeonPostgres.Autorest/docs/Update-AzNeonPostgresOrganization.md b/src/NeonPostgres/NeonPostgres.Autorest/docs/Update-AzNeonPostgresOrganization.md new file mode 100644 index 000000000000..8a98a8f97ed9 --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/docs/Update-AzNeonPostgresOrganization.md @@ -0,0 +1,538 @@ +--- +external help file: +Module Name: Az.NeonPostgres +online version: https://learn.microsoft.com/powershell/module/az.neonpostgres/update-azneonpostgresorganization +schema: 2.0.0 +--- + +# Update-AzNeonPostgresOrganization + +## SYNOPSIS +Update a OrganizationResource + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzNeonPostgresOrganization -Name -ResourceGroupName [-SubscriptionId ] + [-CompanyDetailBusinessPhone ] [-CompanyDetailCompanyName ] [-CompanyDetailCountry ] + [-CompanyDetailDomain ] [-CompanyDetailNumberOfEmployee ] + [-CompanyDetailOfficeAddress ] [-PartnerOrganizationPropertyOrganizationId ] + [-PartnerOrganizationPropertyOrganizationName ] [-SingleSignOnPropertyAadDomain ] + [-SingleSignOnPropertyEnterpriseAppId ] [-SingleSignOnPropertySingleSignOnState ] + [-SingleSignOnPropertySingleSignOnUrl ] [-Tag ] [-UserDetailEmailAddress ] + [-UserDetailFirstName ] [-UserDetailLastName ] [-UserDetailPhoneNumber ] + [-UserDetailUpn ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzNeonPostgresOrganization -InputObject [-CompanyDetailBusinessPhone ] + [-CompanyDetailCompanyName ] [-CompanyDetailCountry ] [-CompanyDetailDomain ] + [-CompanyDetailNumberOfEmployee ] [-CompanyDetailOfficeAddress ] + [-PartnerOrganizationPropertyOrganizationId ] [-PartnerOrganizationPropertyOrganizationName ] + [-SingleSignOnPropertyAadDomain ] [-SingleSignOnPropertyEnterpriseAppId ] + [-SingleSignOnPropertySingleSignOnState ] [-SingleSignOnPropertySingleSignOnUrl ] + [-Tag ] [-UserDetailEmailAddress ] [-UserDetailFirstName ] + [-UserDetailLastName ] [-UserDetailPhoneNumber ] [-UserDetailUpn ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaJsonFilePath +``` +Update-AzNeonPostgresOrganization -Name -ResourceGroupName -JsonFilePath + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +### UpdateViaJsonString +``` +Update-AzNeonPostgresOrganization -Name -ResourceGroupName -JsonString + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Update a OrganizationResource + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here (remove the output block if the example doesn't have an output) }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here (remove the output block if the example doesn't have an output) }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CompanyDetailBusinessPhone +Business phone number of the company + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CompanyDetailCompanyName +Company name + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CompanyDetailCountry +Country name of the company + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CompanyDetailDomain +Domain of the user + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CompanyDetailNumberOfEmployee +Number of employees in the company + +```yaml +Type: System.Int64 +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CompanyDetailOfficeAddress +Office address of the company + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.INeonPostgresIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -JsonFilePath +Path of Json file supplied to the Update operation + +```yaml +Type: System.String +Parameter Sets: UpdateViaJsonFilePath +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -JsonString +Json string supplied to the Update operation + +```yaml +Type: System.String +Parameter Sets: UpdateViaJsonString +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the Neon Organizations resource + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaJsonFilePath, UpdateViaJsonString +Aliases: OrganizationName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerOrganizationPropertyOrganizationId +Organization Id in partner's system + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartnerOrganizationPropertyOrganizationName +Organization name in partner's system + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaJsonFilePath, UpdateViaJsonString +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SingleSignOnPropertyAadDomain +List of AAD domains fetched from Microsoft Graph for user. + +```yaml +Type: System.String[] +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SingleSignOnPropertyEnterpriseAppId +AAD enterprise application Id used to setup SSO + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SingleSignOnPropertySingleSignOnState +State of the Single Sign On for the organization + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SingleSignOnPropertySingleSignOnUrl +URL for SSO to be used by the partner to redirect the user to their system + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. +The value must be an UUID. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaJsonFilePath, UpdateViaJsonString +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -UserDetailEmailAddress +Email address of the user + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -UserDetailFirstName +First name of the user + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -UserDetailLastName +Last name of the user + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -UserDetailPhoneNumber +User's phone number + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -UserDetailUpn +User's principal name + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.INeonPostgresIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.NeonPostgres.Models.IOrganizationResource + +## NOTES + +## RELATED LINKS + diff --git a/src/NeonPostgres/NeonPostgres.Autorest/examples/Get-AzNeonPostgresOrganization.md b/src/NeonPostgres/NeonPostgres.Autorest/examples/Get-AzNeonPostgresOrganization.md new file mode 100644 index 000000000000..0371f56c36d2 --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/examples/Get-AzNeonPostgresOrganization.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here (remove the output block if the example doesn't have an output) }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here (remove the output block if the example doesn't have an output) }} +``` + +{{ Add description here }} + diff --git a/src/NeonPostgres/NeonPostgres.Autorest/examples/New-AzNeonPostgresOrganization.md b/src/NeonPostgres/NeonPostgres.Autorest/examples/New-AzNeonPostgresOrganization.md new file mode 100644 index 000000000000..0371f56c36d2 --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/examples/New-AzNeonPostgresOrganization.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here (remove the output block if the example doesn't have an output) }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here (remove the output block if the example doesn't have an output) }} +``` + +{{ Add description here }} + diff --git a/src/NeonPostgres/NeonPostgres.Autorest/examples/Remove-AzNeonPostgresOrganization.md b/src/NeonPostgres/NeonPostgres.Autorest/examples/Remove-AzNeonPostgresOrganization.md new file mode 100644 index 000000000000..0371f56c36d2 --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/examples/Remove-AzNeonPostgresOrganization.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here (remove the output block if the example doesn't have an output) }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here (remove the output block if the example doesn't have an output) }} +``` + +{{ Add description here }} + diff --git a/src/NeonPostgres/NeonPostgres.Autorest/examples/Update-AzNeonPostgresOrganization.md b/src/NeonPostgres/NeonPostgres.Autorest/examples/Update-AzNeonPostgresOrganization.md new file mode 100644 index 000000000000..0371f56c36d2 --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/examples/Update-AzNeonPostgresOrganization.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here (remove the output block if the example doesn't have an output) }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here (remove the output block if the example doesn't have an output) }} +``` + +{{ Add description here }} + diff --git a/src/NeonPostgres/NeonPostgres.Autorest/how-to.md b/src/NeonPostgres/NeonPostgres.Autorest/how-to.md new file mode 100644 index 000000000000..24f3241cdfea --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/how-to.md @@ -0,0 +1,58 @@ +# How-To +This document describes how to develop for `Az.NeonPostgres`. + +## Building `Az.NeonPostgres` +To build, run the `build-module.ps1` at the root of the module directory. This will generate the proxy script cmdlets that are the cmdlets being exported by this module. After the build completes, the proxy script cmdlets will be output to the `exports` folder. To read more about the proxy script cmdlets, look at the [README.md](exports/README.md) in the `exports` folder. + +## Creating custom cmdlets +To add cmdlets that were not generated by the REST specification, use the `custom` folder. This folder allows you to add handwritten `.ps1` and `.cs` files. Currently, we support using `.ps1` scripts as new cmdlets or as additional low-level variants (via `ParameterSet`), and `.cs` files as low-level (variants) cmdlets that the exported script cmdlets call. We do not support exporting any `.cs` (dll) cmdlets directly. To read more about custom cmdlets, look at the [README.md](custom/README.md) in the `custom` folder. + +## Generating documentation +To generate documentation, the process is now integrated into the `build-module.ps1` script. If you don't want to run this process as part of `build-module.ps1`, you can provide the `-NoDocs` switch. If you want to run documentation generation after the build process, you may still run the `generate-help.ps1` script. Overall, the process will look at the documentation comments in the generated and custom cmdlets and types, and create `.md` files into the `docs` folder. Additionally, this pulls in any examples from the `examples` folder and adds them to the generated help markdown documents. To read more about examples, look at the [README.md](examples/README.md) in the `examples` folder. To read more about documentation, look at the [README.md](docs/README.md) in the `docs` folder. + +## Testing `Az.NeonPostgres` +To test the cmdlets, we use [Pester](https://github.com/pester/Pester). Tests scripts (`.ps1`) should be added to the `test` folder. To execute the Pester tests, run the `test-module.ps1` script. This will run all tests in `playback` mode within the `test` folder. To read more about testing cmdlets, look at the [README.md](examples/README.md) in the `examples` folder. + +## Packing `Az.NeonPostgres` +To pack `Az.NeonPostgres` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://learn.microsoft.com/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team. + +## Module Script Details +There are multiple scripts created for performing different actions for developing `Az.NeonPostgres`. +- `build-module.ps1` + - Builds the module DLL (`./bin/Az.NeonPostgres.private.dll`), creates the exported cmdlets and documentation, generates custom cmdlet test stubs and exported cmdlet example stubs, and updates `./Az.NeonPostgres.psd1` with Azure profile information. + - **Parameters**: [`Switch` parameters] + - `-Run`: After building, creates an isolated PowerShell session and loads `Az.NeonPostgres`. + - `-Test`: After building, runs the `Pester` tests defined in the `test` folder. + - `-Docs`: After building, generates the Markdown documents for the modules into the `docs` folder. + - `-Pack`: After building, packages the module into a `.nupkg`. + - `-Code`: After building, opens a VSCode window with the module's directory and runs (see `-Run`) the module. + - `-Release`: Builds the module in `Release` configuration (as opposed to `Debug` configuration). + - `-NoDocs`: Supresses writing the documentation markdown files as part of the cmdlet exporting process. + - `-Debugger`: Used when attaching the debugger in Visual Studio to the PowerShell session, and running the build process without recompiling the DLL. This suppresses running the script as an isolated process. +- `run-module.ps1` + - Creates an isolated PowerShell session and loads `Az.NeonPostgres` into the session. + - Same as `-Run` in `build-module.ps1`. + - **Parameters**: [`Switch` parameters] + - `-Code`: Opens a VSCode window with the module's directory. + - Same as `-Code` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. +- `test-module.ps1` + - Runs the `Pester` tests defined in the `test` folder. + - Same as `-Test` in `build-module.ps1`. +- `pack-module.ps1` + - Packages the module into a `.nupkg` for distribution. + - Same as `-Pack` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. + - This process is now integrated into `build-module.ps1` automatically. To disable, use `-NoDocs` when running `build-module.ps1`. +- `export-surface.ps1` + - Generates Markdown documents for both the cmdlet surface and the model (class) surface of the module. + - These files are placed into the `resources` folder. + - Used for investigating the surface of your module. These are *not* documentation for distribution. +- `check-dependencies.ps1` + - Used in `run-module.ps1` and `test-module.ps1` to verify dependent modules are available to run those tasks. + - It will download local (within the module's directory structure) versions of those modules as needed. + - This script *does not* need to be ran by-hand. \ No newline at end of file diff --git a/src/NeonPostgres/NeonPostgres.Autorest/license.txt b/src/NeonPostgres/NeonPostgres.Autorest/license.txt new file mode 100644 index 000000000000..b9f3180fb9af --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/license.txt @@ -0,0 +1,227 @@ +MICROSOFT SOFTWARE LICENSE TERMS + +MICROSOFT AZURE POWERSHELL + +These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. + +BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE. + + +-----------------START OF LICENSE-------------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +-------------------END OF LICENSE------------------------------------------ + + +----------------START OF THIRD PARTY NOTICE-------------------------------- + + +The software includes the AutoMapper library ("AutoMapper"). The MIT License set out below is provided for informational purposes only. It is not the license that governs any part of the software. + +Provided for Informational Purposes Only + +AutoMapper + +The MIT License (MIT) +Copyright (c) 2010 Jimmy Bogard + + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + + + + +*************** + +The software includes Newtonsoft.Json. The MIT License set out below is provided for informational purposes only. It is not the license that governs any part of the software. + +Newtonsoft.Json + +The MIT License (MIT) +Copyright (c) 2007 James Newton-King +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-------------END OF THIRD PARTY NOTICE---------------------------------------- + diff --git a/src/NeonPostgres/NeonPostgres.Autorest/resources/README.md b/src/NeonPostgres/NeonPostgres.Autorest/resources/README.md new file mode 100644 index 000000000000..937f07f8fec2 --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/resources/README.md @@ -0,0 +1,11 @@ +# Resources +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder. + +## Info +- Modifiable: yes +- Generated: no +- Committed: yes +- Packaged: no + +## Purpose +Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. \ No newline at end of file diff --git a/src/NeonPostgres/NeonPostgres.Autorest/test/Get-AzNeonPostgresOrganization.Tests.ps1 b/src/NeonPostgres/NeonPostgres.Autorest/test/Get-AzNeonPostgresOrganization.Tests.ps1 new file mode 100644 index 000000000000..ea907d86b31e --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/test/Get-AzNeonPostgresOrganization.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzNeonPostgresOrganization')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzNeonPostgresOrganization.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzNeonPostgresOrganization' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/NeonPostgres/NeonPostgres.Autorest/test/New-AzNeonPostgresOrganization.Tests.ps1 b/src/NeonPostgres/NeonPostgres.Autorest/test/New-AzNeonPostgresOrganization.Tests.ps1 new file mode 100644 index 000000000000..984b97b6feb2 --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/test/New-AzNeonPostgresOrganization.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzNeonPostgresOrganization')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzNeonPostgresOrganization.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzNeonPostgresOrganization' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaJsonFilePath' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaJsonString' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/NeonPostgres/NeonPostgres.Autorest/test/README.md b/src/NeonPostgres/NeonPostgres.Autorest/test/README.md new file mode 100644 index 000000000000..7c752b4c8c43 --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/test/README.md @@ -0,0 +1,17 @@ +# Test +This directory contains the [Pester](https://www.powershellgallery.com/packages/Pester) tests to run for the module. We use Pester as it is the unofficial standard for PowerShell unit testing. Test stubs for custom cmdlets (created in `..\custom`) will be generated into this folder when `build-module.ps1` is ran. These test stubs will fail automatically, to indicate that tests should be written for custom cmdlets. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: no + +## Details +We allow three testing modes: *live*, *record*, and *playback*. These can be selected using the `-Live`, `-Record`, and `-Playback` switches respectively on the `test-module.ps1` script. This script will run through any `.Tests.ps1` scripts in the `test` folder. If you choose the *record* mode, it will create a `.Recording.json` file of the REST calls between the client and server. Then, when you choose *playback* mode, it will use the `.Recording.json` file to mock the communication between server and client. The *live* mode runs the same as the *record* mode; however, it doesn't create the `.Recording.json` file. + +## Purpose +Custom cmdlets generally encompass additional functionality not described in the REST specification, or combines functionality generated from the REST spec. To validate this functionality continues to operate as intended, creating tests that can be ran and re-ran against custom cmdlets is part of the framework. + +## Usage +To execute tests, run the `test-module.ps1`. To write tests, [this example](https://github.com/pester/Pester/blob/8b9cf4248315e44f1ac6673be149f7e0d7f10466/Examples/Planets/Get-Planet.Tests.ps1#L1) from the Pester repository is very useful for getting started. \ No newline at end of file diff --git a/src/NeonPostgres/NeonPostgres.Autorest/test/Remove-AzNeonPostgresOrganization.Tests.ps1 b/src/NeonPostgres/NeonPostgres.Autorest/test/Remove-AzNeonPostgresOrganization.Tests.ps1 new file mode 100644 index 000000000000..781cc5181ee6 --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/test/Remove-AzNeonPostgresOrganization.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzNeonPostgresOrganization')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzNeonPostgresOrganization.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzNeonPostgresOrganization' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/NeonPostgres/NeonPostgres.Autorest/test/Update-AzNeonPostgresOrganization.Tests.ps1 b/src/NeonPostgres/NeonPostgres.Autorest/test/Update-AzNeonPostgresOrganization.Tests.ps1 new file mode 100644 index 000000000000..a94fd6590f18 --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/test/Update-AzNeonPostgresOrganization.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzNeonPostgresOrganization')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzNeonPostgresOrganization.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzNeonPostgresOrganization' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaJsonString' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaJsonFilePath' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/NeonPostgres/NeonPostgres.Autorest/test/loadEnv.ps1 b/src/NeonPostgres/NeonPostgres.Autorest/test/loadEnv.ps1 new file mode 100644 index 000000000000..6a7c385c6b7d --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/test/loadEnv.ps1 @@ -0,0 +1,29 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- +$envFile = 'env.json' +if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' +} + +if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) { + $envFilePath = Join-Path $PSScriptRoot $envFile +} else { + $envFilePath = Join-Path $PSScriptRoot '..\$envFile' +} +$env = @{} +if (Test-Path -Path $envFilePath) { + $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json + $PSDefaultParameterValues=@{"*:Tenant"=$env.Tenant} +} \ No newline at end of file diff --git a/src/NeonPostgres/NeonPostgres.Autorest/test/utils.ps1 b/src/NeonPostgres/NeonPostgres.Autorest/test/utils.ps1 new file mode 100644 index 000000000000..f8497fbd7da0 --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/test/utils.ps1 @@ -0,0 +1,56 @@ +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 + $previousEnv.psobject.properties | Foreach-Object { $env[$_.Name] = $_.Value } +} +# Add script method called AddWithCache to $env, when useCache is set true, it will try to get the value from the $env first. +# example: $val = $env.AddWithCache('key', $val, $true) +$env | Add-Member -Type ScriptMethod -Value { param( [string]$key, [object]$val, [bool]$useCache) if ($this.Contains($key) -and $useCache) { return $this[$key] } else { $this[$key] = $val; return $val } } -Name 'AddWithCache' +function setupEnv() { + # Preload subscriptionId and tenant from context, which will be used in test + # as default. You could change them if needed. + $env.SubscriptionId = (Get-AzContext).Subscription.Id + $env.Tenant = (Get-AzContext).Tenant.Id + # For any resources you created for test, you should add it to $env here. + $envFile = 'env.json' + if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' + } + set-content -Path (Join-Path $PSScriptRoot $envFile) -Value (ConvertTo-Json $env) +} +function cleanupEnv() { + # Clean resources you create for testing +} + diff --git a/src/NeonPostgres/NeonPostgres.Autorest/utils/Get-SubscriptionIdTestSafe.ps1 b/src/NeonPostgres/NeonPostgres.Autorest/utils/Get-SubscriptionIdTestSafe.ps1 new file mode 100644 index 000000000000..5319862d3372 --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/utils/Get-SubscriptionIdTestSafe.ps1 @@ -0,0 +1,7 @@ +param() +if ($env:AzPSAutorestTestPlaybackMode) { + $loadEnvPath = Join-Path $PSScriptRoot '..' 'test' 'loadEnv.ps1' + . ($loadEnvPath) + return $env.SubscriptionId +} +return (Get-AzContext).Subscription.Id \ No newline at end of file diff --git a/src/NeonPostgres/NeonPostgres.Autorest/utils/Unprotect-SecureString.ps1 b/src/NeonPostgres/NeonPostgres.Autorest/utils/Unprotect-SecureString.ps1 new file mode 100644 index 000000000000..cb05b51a6220 --- /dev/null +++ b/src/NeonPostgres/NeonPostgres.Autorest/utils/Unprotect-SecureString.ps1 @@ -0,0 +1,16 @@ +#This script converts securestring to plaintext + +param( + [Parameter(Mandatory, ValueFromPipeline)] + [System.Security.SecureString] + ${SecureString} +) + +$ssPtr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString) +try { + $plaintext = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($ssPtr) +} finally { + [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ssPtr) +} + +return $plaintext \ No newline at end of file