Skip to content

[Az.Attestation] Update generation tool version: autorest.powershell v3… #28180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/Attestation/Attestation.Autorest/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// 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.

using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Attestation")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.1.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.1.0")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]

12 changes: 4 additions & 8 deletions src/Attestation/Attestation.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,20 @@ module-version: 0.1.0
# Normally, title is the service name
title: Attestation
subject-prefix: $(service-name)
identity-correction-for-post: true
nested-object-to-string: true
resourcegroup-append: true

# If there are post APIs for some kinds of actions in the RP, you may need to
# uncomment following line to support viaIdentity for these post APIs
# identity-correctiEXon-for-post: true

# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
use-extension:
"@autorest/powershell": "3.x"

directive:
# Following is two common directive which are normally required in all the RPs
# 1. Remove the unexpanded parameter set
# 2. For New-* cmdlets, ViaIdentity is not required, so CreateViaIdentityExpanded is removed as well
- where:
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$|^Install$|^InstallViaIdentity$
variant: ^(Create|Update|Install)(?!.*?(Expanded|JsonFilePath|JsonString))
remove: true
- where:
variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$
remove: true
# Remove the set-* cmdlet
- where:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography.X509Certificates;
using Microsoft.Azure.PowerShell.Cmdlets.Attestation.Models.Api10;
using Microsoft.Azure.PowerShell.Cmdlets.Attestation.Models;

namespace Microsoft.Azure.PowerShell.Cmdlets.Attestation.Models.Api10
namespace Microsoft.Azure.PowerShell.Cmdlets.Attestation.Models
{
public class JsonWebKeyHelper
{
Expand Down Expand Up @@ -82,7 +82,7 @@ private static JsonWebKey[] GetJsonWebKeysFromX509Certificate(X509Certificate2Co
foreach (var certificate in certificateCollection)
{
var jwk = new JsonWebKey() { Kty = "RSA" };
jwk.X5C = new List<string>() { System.Convert.ToBase64String(certificate.Export(X509ContentType.Cert)) }.ToArray();
jwk.X5C = new List<string> { System.Convert.ToBase64String(certificate.Export(X509ContentType.Cert)) };
jsonWebKeys.Add(jwk);
}
return jsonWebKeys.ToArray();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ POLICYSIGNINGCERTIFICATEKEY <IJsonWebKey[]>: The value of the "keys" parameter i
https://learn.microsoft.com/powershell/module/az.attestation/new-azattestationprovider
#>
function New-AzAttestationProvider {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Attestation.Models.Api20201001.IAttestationProvider])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Attestation.Models.IAttestationProvider])]
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
Expand All @@ -77,13 +77,13 @@ param(
# The ID of the target subscription.
${SubscriptionId},

[Parameter(Mandatory)]
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Attestation.Category('Body')]
[System.String]
# The supported Azure location where the attestation provider should be created.
${Location},

[Parameter()]
[Parameter(ParameterSetName='CreateExpanded')]
[AllowEmptyCollection()]
[Microsoft.Azure.PowerShell.Cmdlets.Attestation.Category('Body')]
[System.String]
Expand All @@ -93,19 +93,32 @@ param(
# To construct, see NOTES section for POLICYSIGNINGCERTIFICATEKEY properties and create a hash table.
${PolicySigningCertificateKeyPath},

[Parameter()]
[Parameter(ParameterSetName='CreateExpanded')]
[Microsoft.Azure.PowerShell.Cmdlets.Attestation.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Attestation.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Attestation.Models.Api20201001.IAttestationServiceCreationParamsTags]))]
[Microsoft.Azure.PowerShell.Cmdlets.Attestation.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Attestation.Models.IAttestationServiceCreationParamsTags]))]
[System.Collections.Hashtable]
# The tags that will be assigned to the attestation provider.
${Tag},

[Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Attestation.Category('Body')]
[System.String]
# Path of Json file supplied to the Create operation
${JsonFilePath},

[Parameter(ParameterSetName='CreateViaJsonString', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Attestation.Category('Body')]
[System.String]
# Json string supplied to the Create operation
${JsonString},

[Parameter()]
[Alias('AzureRMContext', 'AzureCredential')]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.Attestation.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)]
Expand Down Expand Up @@ -151,7 +164,7 @@ param(
process {
if($PSBoundParameters.ContainsKey("PolicySigningCertificateKeyPath")){
$PolicySigningCertificateKeyPath = (Resolve-Path -Path $PolicySigningCertificateKeyPath).Path
$PolicySigningCertificateKey = [Microsoft.Azure.PowerShell.Cmdlets.Attestation.Models.Api10.JsonWebKeyHelper]::GetJsonWebKeys($PolicySigningCertificateKeyPath)
$PolicySigningCertificateKey = [Microsoft.Azure.PowerShell.Cmdlets.Attestation.Models.JsonWebKeyHelper]::GetJsonWebKeys($PolicySigningCertificateKeyPath)
$null = $PSBoundParameters.Add("PolicySigningCertificateKey", $PolicySigningCertificateKey)
$null = $PSBoundParameters.Remove("PolicySigningCertificateKeyPath")
}
Expand Down
4 changes: 2 additions & 2 deletions src/Attestation/Attestation.Autorest/docs/Az.Attestation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
Module Name: Az.Attestation
Module Guid: 2c3f4dc7-21e2-45f3-87dd-9f3ba30ae484
Module Guid: 1c9a1ce2-e443-4ee1-aeac-5e962f9237d9
Download Help Link: https://learn.microsoft.com/powershell/module/az.attestation
Help Version: 1.0.0.0
Locale: en-US
Expand All @@ -24,5 +24,5 @@ Creates a new Attestation Provider.
Delete Attestation Service.

### [Update-AzAttestationProvider](Update-AzAttestationProvider.md)
Updates the Attestation Provider.
Update the Attestation Provider.

Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ Accept wildcard characters: False

### -InputObject
Identity Parameter
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.Attestation.Models.IAttestationIdentity
Expand Down Expand Up @@ -180,9 +179,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Attestation.Models.Api20201001.IAttestationProvider
### Microsoft.Azure.PowerShell.Cmdlets.Attestation.Models.IAttestationProvider

### Microsoft.Azure.PowerShell.Cmdlets.Attestation.Models.Api20201001.IAttestationProviderListResult
### Microsoft.Azure.PowerShell.Cmdlets.Attestation.Models.IAttestationProviderListResult

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ Accept wildcard characters: False

### -InputObject
Identity Parameter
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.Attestation.Models.IAttestationIdentity
Expand Down Expand Up @@ -267,9 +266,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Attestation.Models.Api20201001.IAttestationProvider
### Microsoft.Azure.PowerShell.Cmdlets.Attestation.Models.IAttestationProvider

### Microsoft.Azure.PowerShell.Cmdlets.Attestation.Models.Api20201001.IAttestationProviderListResult
### Microsoft.Azure.PowerShell.Cmdlets.Attestation.Models.IAttestationProviderListResult

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,25 @@ Creates a new Attestation Provider.

## SYNTAX

### CreateExpanded (Default)
```
New-AzAttestationProvider -Name <String> -ResourceGroupName <String> -Location <String>
[-SubscriptionId <String>] [-PolicySigningCertificateKeyPath <String>] [-Tag <Hashtable>]
[-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

### CreateViaJsonFilePath
```
New-AzAttestationProvider -Name <String> -ResourceGroupName <String> -JsonFilePath <String>
[-SubscriptionId <String>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

### CreateViaJsonString
```
New-AzAttestationProvider -Name <String> -ResourceGroupName <String> -JsonString <String>
[-SubscriptionId <String>] [-DefaultProfile <PSObject>] [-Confirm] [-WhatIf] [<CommonParameters>]
```

## DESCRIPTION
Creates a new Attestation Provider.

Expand Down Expand Up @@ -52,7 +65,8 @@ This command creates a new Attestation Provider named `testprovider2` with trust
## PARAMETERS

### -DefaultProfile
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.

```yaml
Type: System.Management.Automation.PSObject
Expand All @@ -66,12 +80,42 @@ 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 supported Azure location where the attestation provider should be created.

```yaml
Type: System.String
Parameter Sets: (All)
Parameter Sets: CreateExpanded
Aliases:

Required: True
Expand Down Expand Up @@ -104,7 +148,7 @@ To construct, see NOTES section for POLICYSIGNINGCERTIFICATEKEY properties and c

```yaml
Type: System.String
Parameter Sets: (All)
Parameter Sets: CreateExpanded
Aliases:

Required: False
Expand Down Expand Up @@ -150,7 +194,7 @@ The tags that will be assigned to the attestation provider.

```yaml
Type: System.Collections.Hashtable
Parameter Sets: (All)
Parameter Sets: CreateExpanded
Aliases:

Required: False
Expand Down Expand Up @@ -198,7 +242,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Attestation.Models.Api20201001.IAttestationProvider
### Microsoft.Azure.PowerShell.Cmdlets.Attestation.Models.IAttestationProvider

## NOTES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ Accept wildcard characters: False

### -InputObject
Identity Parameter
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.Attestation.Models.IAttestationIdentity
Expand Down
Loading
Loading