Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<PropertyGroup>
<PsModuleName>Reservations</PsModuleName>
<PsRootModuleName>Reservations</PsRootModuleName>
<PsModuleFolder>Reservations.Autorest</PsModuleFolder>
</PropertyGroup>

<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., build.proj))\src\Az.autorest.props" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., build.proj))\src\Az.Post.props" />

</Project>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
DotNetFrameworkVersion = '4.7.2'
RequiredAssemblies = './bin/Az.Reservations.private.dll'
FormatsToProcess = './Az.Reservations.format.ps1xml'
FunctionsToExport = 'Get-AzReservation', 'Get-AzReservationAvailableScope', 'Get-AzReservationCatalog', 'Get-AzReservationHistory', 'Get-AzReservationOrder', 'Get-AzReservationOrderId', 'Get-AzReservationQuote', 'Invoke-AzReservationArchiveReservation', 'Invoke-AzReservationCalculateExchange', 'Invoke-AzReservationCalculateRefund', 'Invoke-AzReservationExchange', 'Invoke-AzReservationReturn', 'Invoke-AzReservationUnarchiveReservation', 'Merge-AzReservation', 'Move-AzReservationDirectory', 'New-AzReservation', 'Split-AzReservation', 'Update-AzReservation', '*'
AliasesToExport = '*'
FunctionsToExport = 'Get-AzReservation', 'Get-AzReservationAvailableScope', 'Get-AzReservationCatalog', 'Get-AzReservationHistory', 'Get-AzReservationOrder', 'Get-AzReservationOrderId', 'Get-AzReservationQuote', 'Invoke-AzReservationArchiveReservation', 'Invoke-AzReservationCalculateExchange', 'Invoke-AzReservationCalculateRefund', 'Invoke-AzReservationExchange', 'Invoke-AzReservationReturn', 'Invoke-AzReservationUnarchiveReservation', 'Merge-AzReservation', 'Move-AzReservationDirectory', 'New-AzReservation', 'Split-AzReservation', 'Update-AzReservation'
PrivateData = @{
PSData = @{
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Reservations'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the ""License"");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// distributed under the License is distributed on an ""AS IS"" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------
// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
// is regenerated.

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

[assembly: AssemblyTitle("Microsoft Azure Powershell - Reservations")]
[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)]
[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)]
[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)]
[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Reservations")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.13.1")]
[assembly: System.Reflection.AssemblyVersionAttribute("0.13.1")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]




[assembly: ComVisible(false)]
[assembly: CLSCompliant(false)]
[assembly: Guid("6035c2bd-2183-4107-8f37-8395d134babd")]
[assembly: AssemblyVersion("0.13.1")]
[assembly: AssemblyFileVersion("0.13.1")]
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
# is regenerated.
# ----------------------------------------------------------------------------------
param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources)
param([switch]$NotIsolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources)
$ErrorActionPreference = 'Stop'

if(-not $Isolated) {
if(-not $NotIsolated) {
Write-Host -ForegroundColor Green 'Creating isolated process...'
$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
& "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated
& "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Get-AzReservation -ReservationOrderId a87c1742-0080-5b4d-b953-8531ad46fdc8 -Rese
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse
Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse
.Notes
COMPLEX PARAMETER PROPERTIES

Expand All @@ -38,14 +38,21 @@ INPUTOBJECT <IReservationsIdentity>: Identity Parameter
[ReservationId <String>]: Id of the reservation item
[ReservationOrderId <String>]: Order Id of the reservation
[SubscriptionId <String>]: Id of the subscription

RESERVATIONORDERINPUTOBJECT <IReservationsIdentity>: Identity Parameter
[Id <String>]: Resource identity path
[ReservationId <String>]: Id of the reservation item
[ReservationOrderId <String>]: Order Id of the reservation
[SubscriptionId <String>]: Id of the subscription
.Link
https://learn.microsoft.com/powershell/module/az.reservations/get-azreservation
#>
function Get-AzReservation {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationResponse])]
[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='Get', Mandatory)]
[Parameter(ParameterSetName='GetViaIdentityReservationOrder', Mandatory)]
[Alias('ReservationId')]
[Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')]
[System.String]
Expand All @@ -64,11 +71,17 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity]
# Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},

[Parameter(ParameterSetName='GetViaIdentityReservationOrder', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity]
# Identity Parameter
${ReservationOrderInputObject},

[Parameter(ParameterSetName='Get')]
[Parameter(ParameterSetName='GetViaIdentity')]
[Parameter(ParameterSetName='GetViaIdentityReservationOrder')]
[Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Query')]
[System.String]
# Supported value of this query is renewProperties
Expand Down Expand Up @@ -163,6 +176,15 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName

$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }

$context = Get-AzContext
if (-not $context -and -not $testPlayback) {
Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
exit
}

if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
Expand All @@ -184,6 +206,7 @@ begin {
$mapping = @{
Get = 'Az.Reservations.private\Get-AzReservation_Get';
GetViaIdentity = 'Az.Reservations.private\Get-AzReservation_GetViaIdentity';
GetViaIdentityReservationOrder = 'Az.Reservations.private\Get-AzReservation_GetViaIdentityReservationOrder';
List = 'Az.Reservations.private\Get-AzReservation_List';
List1 = 'Az.Reservations.private\Get-AzReservation_List1';
}
Expand All @@ -194,6 +217,9 @@ begin {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
if ($wrappedCmd -eq $null) {
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
}
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,70 +22,83 @@ Check whether the scopes from request is valid for `Reservation`.\n
.Example
Get-AzReservationAvailableScope -ReservationId 2ef560a7-f469-4b62-87b7-5312d588ce2a -ReservationOrderId 2b9b9372-24e1-4a07-a354-2078fe347cf9 -Scope "/subscriptions/3f0487ff-27ca-4b9c-2a23-000770724b1b"

.Inputs
Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties
Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties
.Notes
COMPLEX PARAMETER PROPERTIES

To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.

BODY <IAvailableScopeRequest>: Available scope
[Scope <String[]>]:

INPUTOBJECT <IReservationsIdentity>: Identity Parameter
[Id <String>]: Resource identity path
[ReservationId <String>]: Id of the reservation item
[ReservationOrderId <String>]: Order Id of the reservation
[SubscriptionId <String>]: Id of the subscription

RESERVATIONORDERINPUTOBJECT <IReservationsIdentity>: Identity Parameter
[Id <String>]: Resource identity path
[ReservationId <String>]: Id of the reservation item
[ReservationOrderId <String>]: Order Id of the reservation
[SubscriptionId <String>]: Id of the subscription
.Link
https://learn.microsoft.com/powershell/module/az.reservations/get-azreservationavailablescope
#>
function Get-AzReservationAvailableScope {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.ISubscriptionScopeProperties])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IAvailableScopeProperties])]
[CmdletBinding(DefaultParameterSetName='AvailableExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(ParameterSetName='Available', Mandatory)]
[Parameter(ParameterSetName='AvailableExpanded', Mandatory)]
[Parameter(ParameterSetName='AvailableViaIdentityReservationOrderExpanded', Mandatory)]
[Parameter(ParameterSetName='AvailableViaJsonFilePath', Mandatory)]
[Parameter(ParameterSetName='AvailableViaJsonString', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')]
[System.String]
# Id of the reservation item
${ReservationId},

[Parameter(ParameterSetName='Available', Mandatory)]
[Parameter(ParameterSetName='AvailableExpanded', Mandatory)]
[Parameter(ParameterSetName='AvailableViaJsonFilePath', Mandatory)]
[Parameter(ParameterSetName='AvailableViaJsonString', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')]
[System.String]
# Order Id of the reservation
${ReservationOrderId},

[Parameter(ParameterSetName='AvailableViaIdentity', Mandatory, ValueFromPipeline)]
[Parameter(ParameterSetName='AvailableViaIdentityExpanded', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity]
# Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},

[Parameter(ParameterSetName='Available', Mandatory, ValueFromPipeline)]
[Parameter(ParameterSetName='AvailableViaIdentity', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IAvailableScopeRequest]
# Available scope
# To construct, see NOTES section for BODY properties and create a hash table.
${Body},
[Parameter(ParameterSetName='AvailableViaIdentityReservationOrderExpanded', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.IReservationsIdentity]
# Identity Parameter
${ReservationOrderInputObject},

[Parameter(ParameterSetName='AvailableExpanded')]
[Parameter(ParameterSetName='AvailableViaIdentityExpanded')]
[Parameter(ParameterSetName='AvailableViaIdentityReservationOrderExpanded')]
[AllowEmptyCollection()]
[Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')]
[System.String[]]
# .
${Scope},

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

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

[Parameter()]
[Alias('AzureRMContext', 'AzureCredential')]
[ValidateNotNull()]
Expand Down Expand Up @@ -154,6 +167,15 @@ begin {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName

$testPlayback = $false
$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } }

$context = Get-AzContext
if (-not $context -and -not $testPlayback) {
Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in."
exit
}

if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
Expand All @@ -173,10 +195,11 @@ begin {
}

$mapping = @{
Available = 'Az.Reservations.private\Get-AzReservationAvailableScope_Available';
AvailableExpanded = 'Az.Reservations.private\Get-AzReservationAvailableScope_AvailableExpanded';
AvailableViaIdentity = 'Az.Reservations.private\Get-AzReservationAvailableScope_AvailableViaIdentity';
AvailableViaIdentityExpanded = 'Az.Reservations.private\Get-AzReservationAvailableScope_AvailableViaIdentityExpanded';
AvailableViaIdentityReservationOrderExpanded = 'Az.Reservations.private\Get-AzReservationAvailableScope_AvailableViaIdentityReservationOrderExpanded';
AvailableViaJsonFilePath = 'Az.Reservations.private\Get-AzReservationAvailableScope_AvailableViaJsonFilePath';
AvailableViaJsonString = 'Az.Reservations.private\Get-AzReservationAvailableScope_AvailableViaJsonString';
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.Reservations.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
Expand All @@ -185,6 +208,9 @@ begin {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
if ($wrappedCmd -eq $null) {
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function)
}
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
Expand Down
Loading
Loading