|
| 1 | + |
| 2 | +# ---------------------------------------------------------------------------------- |
| 3 | +# Copyright (c) Microsoft Corporation. All rights reserved. |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# Unless required by applicable law or agreed to in writing, software |
| 9 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | +# See the License for the specific language governing permissions and |
| 12 | +# limitations under the License. |
| 13 | +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code |
| 14 | +# is regenerated. |
| 15 | +# ---------------------------------------------------------------------------------- |
| 16 | + |
| 17 | +<# |
| 18 | +.Synopsis |
| 19 | +Create an in-memory object for ItemDetailsQueryFilter. |
| 20 | +.Description |
| 21 | +Create an in-memory object for ItemDetailsQueryFilter. |
| 22 | +
|
| 23 | +.Outputs |
| 24 | +Microsoft.Azure.PowerShell.Cmdlets.Carbon.Models.ItemDetailsQueryFilter |
| 25 | +.Link |
| 26 | +https://learn.microsoft.com/powershell/module/Az.Carbon/new-azcarbonitemdetailsqueryfilterobject |
| 27 | +#> |
| 28 | +function New-AzCarbonItemDetailsQueryFilterObject { |
| 29 | + [Microsoft.Azure.PowerShell.Cmdlets.Carbon.ModelCmdletAttribute()] |
| 30 | + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Carbon.Models.ItemDetailsQueryFilter')] |
| 31 | + [CmdletBinding(PositionalBinding=$false)] |
| 32 | + Param( |
| 33 | + |
| 34 | + [Parameter(Mandatory, HelpMessage="Specifies the category type for detailed emissions data, such as Resource, ResourceGroup, ResourceType, Location, or Subscription. See supported types in CategoryTypeEnum.")] |
| 35 | + [Microsoft.Azure.PowerShell.Cmdlets.Carbon.PSArgumentCompleterAttribute("Subscription", "ResourceGroup", "Location", "Resource", "ResourceType")] |
| 36 | + [string] |
| 37 | + $CategoryType, |
| 38 | + [Parameter(Mandatory, HelpMessage="The column name to order the results by. See supported values in OrderByColumnEnum.")] |
| 39 | + [Microsoft.Azure.PowerShell.Cmdlets.Carbon.PSArgumentCompleterAttribute("ItemName", "LatestMonthEmissions", "PreviousMonthEmissions", "MonthOverMonthEmissionsChangeRatio", "MonthlyEmissionsChangeValue", "ResourceGroup")] |
| 40 | + [string] |
| 41 | + $OrderBy, |
| 42 | + [Parameter(Mandatory, HelpMessage="Number of items to return in one request, max value is 5000.")] |
| 43 | + [int] |
| 44 | + $PageSize, |
| 45 | + [Parameter(HelpMessage="Pagination token for fetching the next page of data. This token is nullable and will be returned in the previous response if additional data pages are available.")] |
| 46 | + [string] |
| 47 | + $SkipToken, |
| 48 | + [Parameter(Mandatory, HelpMessage="Direction for sorting results. See supported values in SortDirectionEnum.")] |
| 49 | + [Microsoft.Azure.PowerShell.Cmdlets.Carbon.PSArgumentCompleterAttribute("Desc", "Asc")] |
| 50 | + [string] |
| 51 | + $SortDirection, |
| 52 | + [Parameter(Mandatory, HelpMessage="List of carbon emission scopes. Required. Accepts one or more values from EmissionScopeEnum (e.g., Scope1, Scope2, Scope3) in list form. The output will include the total emissions for the specified scopes.")] |
| 53 | + [Microsoft.Azure.PowerShell.Cmdlets.Carbon.PSArgumentCompleterAttribute("Scope1", "Scope2", "Scope3")] |
| 54 | + [string[]] |
| 55 | + $CarbonScopeList, |
| 56 | + [Parameter(Mandatory, HelpMessage="End date parameter in yyyy-MM-01 format. Only the first day of each month is accepted.")] |
| 57 | + [System.DateTime] |
| 58 | + $DateRangeEnd, |
| 59 | + [Parameter(Mandatory, HelpMessage="Start date parameter in yyyy-MM-01 format. Only the first day of each month is accepted.")] |
| 60 | + [System.DateTime] |
| 61 | + $DateRangeStart, |
| 62 | + [Parameter(HelpMessage="List of locations(Azure Region Display Name) for carbon emissions data, with each location specified in lowercase (e.g., 'east us'). Optional. You can use the command 'az account list-locations -o table' to find Azure Region Display Names.")] |
| 63 | + [string[]] |
| 64 | + $LocationList, |
| 65 | + [Parameter(HelpMessage="List of resource group URLs for carbon emissions data. Optional. Each URL must follow the format '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}', and should be in all lowercase.")] |
| 66 | + [string[]] |
| 67 | + $ResourceGroupUrlList, |
| 68 | + [Parameter(HelpMessage="List of resource types for carbon emissions data. Optional. Each resource type should be specified in lowercase, following the format 'microsoft.{service}/{resourceType}', e.g., 'microsoft.storage/storageaccounts'.")] |
| 69 | + [string[]] |
| 70 | + $ResourceTypeList, |
| 71 | + [Parameter(Mandatory, HelpMessage="List of subscription IDs for which carbon emissions data is requested. Required. Each subscription ID should be in lowercase format. The max length of list is 100.")] |
| 72 | + [string[]] |
| 73 | + $SubscriptionList |
| 74 | + ) |
| 75 | + |
| 76 | + process { |
| 77 | + $Object = [Microsoft.Azure.PowerShell.Cmdlets.Carbon.Models.ItemDetailsQueryFilter]::New() |
| 78 | + |
| 79 | + if ($PSBoundParameters.ContainsKey('CategoryType')) { |
| 80 | + $Object.CategoryType = $CategoryType |
| 81 | + } |
| 82 | + if ($PSBoundParameters.ContainsKey('OrderBy')) { |
| 83 | + $Object.OrderBy = $OrderBy |
| 84 | + } |
| 85 | + if ($PSBoundParameters.ContainsKey('PageSize')) { |
| 86 | + $Object.PageSize = $PageSize |
| 87 | + } |
| 88 | + if ($PSBoundParameters.ContainsKey('SkipToken')) { |
| 89 | + $Object.SkipToken = $SkipToken |
| 90 | + } |
| 91 | + if ($PSBoundParameters.ContainsKey('SortDirection')) { |
| 92 | + $Object.SortDirection = $SortDirection |
| 93 | + } |
| 94 | + if ($PSBoundParameters.ContainsKey('CarbonScopeList')) { |
| 95 | + $Object.CarbonScopeList = $CarbonScopeList |
| 96 | + } |
| 97 | + if ($PSBoundParameters.ContainsKey('DateRangeEnd')) { |
| 98 | + $Object.DateRangeEnd = $DateRangeEnd |
| 99 | + } |
| 100 | + if ($PSBoundParameters.ContainsKey('DateRangeStart')) { |
| 101 | + $Object.DateRangeStart = $DateRangeStart |
| 102 | + } |
| 103 | + if ($PSBoundParameters.ContainsKey('LocationList')) { |
| 104 | + $Object.LocationList = $LocationList |
| 105 | + } |
| 106 | + if ($PSBoundParameters.ContainsKey('ResourceGroupUrlList')) { |
| 107 | + $Object.ResourceGroupUrlList = $ResourceGroupUrlList |
| 108 | + } |
| 109 | + if ($PSBoundParameters.ContainsKey('ResourceTypeList')) { |
| 110 | + $Object.ResourceTypeList = $ResourceTypeList |
| 111 | + } |
| 112 | + if ($PSBoundParameters.ContainsKey('SubscriptionList')) { |
| 113 | + $Object.SubscriptionList = $SubscriptionList |
| 114 | + } |
| 115 | + return $Object |
| 116 | + } |
| 117 | +} |
| 118 | + |
0 commit comments