QueryFilter Class

  • java.lang.Object
    • com.azure.resourcemanager.carbonoptimization.models.QueryFilter

Implements

public class QueryFilter
implements JsonSerializable<QueryFilter>

Shared query filter parameter to configure carbon emissions data queries for all different report type defined in ReportTypeEnum.

Constructor Summary

Constructor Description
QueryFilter()

Creates an instance of QueryFilter class.

Method Summary

Modifier and Type Method and Description
List<EmissionScopeEnum> carbonScopeList()

Get the carbonScopeList property: List of carbon emission scopes.

DateRange dateRange()

Get the dateRange property: The start and end dates for carbon emissions data.

static QueryFilter fromJson(JsonReader jsonReader)

Reads an instance of QueryFilter from the JsonReader.

List<String> locationList()

Get the locationList property: List of locations(Azure Region Display Name) for carbon emissions data, with each location specified in lowercase (e.g., 'east us').

ReportTypeEnum reportType()

Get the reportType property: The ReportType requested for carbon emissions data.

List<String> resourceGroupUrlList()

Get the resourceGroupUrlList property: List of resource group URLs for carbon emissions data.

List<String> resourceTypeList()

Get the resourceTypeList property: List of resource types for carbon emissions data.

List<String> subscriptionList()

Get the subscriptionList property: List of subscription IDs for which carbon emissions data is requested.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

QueryFilter withCarbonScopeList(List<EmissionScopeEnum> carbonScopeList)

Set the carbonScopeList property: List of carbon emission scopes.

QueryFilter withDateRange(DateRange dateRange)

Set the dateRange property: The start and end dates for carbon emissions data.

QueryFilter withLocationList(List<String> locationList)

Set the locationList property: List of locations(Azure Region Display Name) for carbon emissions data, with each location specified in lowercase (e.g., 'east us').

QueryFilter withResourceGroupUrlList(List<String> resourceGroupUrlList)

Set the resourceGroupUrlList property: List of resource group URLs for carbon emissions data.

QueryFilter withResourceTypeList(List<String> resourceTypeList)

Set the resourceTypeList property: List of resource types for carbon emissions data.

QueryFilter withSubscriptionList(List<String> subscriptionList)

Set the subscriptionList property: List of subscription IDs for which carbon emissions data is requested.

Methods inherited from java.lang.Object

Constructor Details

QueryFilter

public QueryFilter()

Creates an instance of QueryFilter class.

Method Details

carbonScopeList

public List<EmissionScopeEnum> carbonScopeList()

Get the carbonScopeList property: 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.

Returns:

the carbonScopeList value.

dateRange

public DateRange dateRange()

Get the dateRange property: The start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01).

Returns:

the dateRange value.

fromJson

public static QueryFilter fromJson(JsonReader jsonReader)

Reads an instance of QueryFilter from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of QueryFilter if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

locationList

public List<String> locationList()

Get the locationList property: 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.

Returns:

the locationList value.

reportType

public ReportTypeEnum reportType()

Get the reportType property: The ReportType requested for carbon emissions data. Required. Specifies how data is aggregated and displayed in the output, as explained in the ReportTypeEnum.

Returns:

the reportType value.

resourceGroupUrlList

public List<String> resourceGroupUrlList()

Get the resourceGroupUrlList property: 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.

Returns:

the resourceGroupUrlList value.

resourceTypeList

public List<String> resourceTypeList()

Get the resourceTypeList property: 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'.

Returns:

the resourceTypeList value.

subscriptionList

public List<String> subscriptionList()

Get the subscriptionList property: 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.

Returns:

the subscriptionList value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withCarbonScopeList

public QueryFilter withCarbonScopeList(List<EmissionScopeEnum> carbonScopeList)

Set the carbonScopeList property: 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.

Parameters:

carbonScopeList - the carbonScopeList value to set.

Returns:

the QueryFilter object itself.

withDateRange

public QueryFilter withDateRange(DateRange dateRange)

Set the dateRange property: The start and end dates for carbon emissions data. Required. For ItemDetailsReport and TopItemsSummaryReport, only one month of data is supported at a time, so start and end dates should be equal within DateRange (e.g., start: 2024-06-01 and end: 2024-06-01).

Parameters:

dateRange - the dateRange value to set.

Returns:

the QueryFilter object itself.

withLocationList

public QueryFilter withLocationList(List<String> locationList)

Set the locationList property: 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.

Parameters:

locationList - the locationList value to set.

Returns:

the QueryFilter object itself.

withResourceGroupUrlList

public QueryFilter withResourceGroupUrlList(List<String> resourceGroupUrlList)

Set the resourceGroupUrlList property: 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.

Parameters:

resourceGroupUrlList - the resourceGroupUrlList value to set.

Returns:

the QueryFilter object itself.

withResourceTypeList

public QueryFilter withResourceTypeList(List<String> resourceTypeList)

Set the resourceTypeList property: 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'.

Parameters:

resourceTypeList - the resourceTypeList value to set.

Returns:

the QueryFilter object itself.

withSubscriptionList

public QueryFilter withSubscriptionList(List<String> subscriptionList)

Set the subscriptionList property: 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.

Parameters:

subscriptionList - the subscriptionList value to set.

Returns:

the QueryFilter object itself.

Applies to