com.azure.resourcemanager.costmanagement.models.ExportDefinition Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-costmanagement Show documentation
Show all versions of azure-resourcemanager-costmanagement Show documentation
This package contains Microsoft Azure SDK for CostManagement Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. CostManagement management client provides access to CostManagement resources for Azure Enterprise Subscriptions. Package tag package-2022-10.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.costmanagement.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
/** The definition of a query. */
@Fluent
public final class ExportDefinition {
@JsonIgnore private final ClientLogger logger = new ClientLogger(ExportDefinition.class);
/*
* The type of the query.
*/
@JsonProperty(value = "type", required = true)
private ExportType type;
/*
* The time frame for pulling data for the query. If custom, then a
* specific time period must be provided.
*/
@JsonProperty(value = "timeframe", required = true)
private TimeframeType timeframe;
/*
* Has time period for pulling data for the query.
*/
@JsonProperty(value = "timePeriod")
private QueryTimePeriod timePeriod;
/*
* Has definition for data in this query.
*/
@JsonProperty(value = "dataSet")
private QueryDatasetAutoGenerated dataSet;
/**
* Get the type property: The type of the query.
*
* @return the type value.
*/
public ExportType type() {
return this.type;
}
/**
* Set the type property: The type of the query.
*
* @param type the type value to set.
* @return the ExportDefinition object itself.
*/
public ExportDefinition withType(ExportType type) {
this.type = type;
return this;
}
/**
* Get the timeframe property: The time frame for pulling data for the query. If custom, then a specific time period
* must be provided.
*
* @return the timeframe value.
*/
public TimeframeType timeframe() {
return this.timeframe;
}
/**
* Set the timeframe property: The time frame for pulling data for the query. If custom, then a specific time period
* must be provided.
*
* @param timeframe the timeframe value to set.
* @return the ExportDefinition object itself.
*/
public ExportDefinition withTimeframe(TimeframeType timeframe) {
this.timeframe = timeframe;
return this;
}
/**
* Get the timePeriod property: Has time period for pulling data for the query.
*
* @return the timePeriod value.
*/
public QueryTimePeriod timePeriod() {
return this.timePeriod;
}
/**
* Set the timePeriod property: Has time period for pulling data for the query.
*
* @param timePeriod the timePeriod value to set.
* @return the ExportDefinition object itself.
*/
public ExportDefinition withTimePeriod(QueryTimePeriod timePeriod) {
this.timePeriod = timePeriod;
return this;
}
/**
* Get the dataSet property: Has definition for data in this query.
*
* @return the dataSet value.
*/
public QueryDatasetAutoGenerated dataSet() {
return this.dataSet;
}
/**
* Set the dataSet property: Has definition for data in this query.
*
* @param dataSet the dataSet value to set.
* @return the ExportDefinition object itself.
*/
public ExportDefinition withDataSet(QueryDatasetAutoGenerated dataSet) {
this.dataSet = dataSet;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (type() == null) {
throw logger
.logExceptionAsError(
new IllegalArgumentException("Missing required property type in model ExportDefinition"));
}
if (timeframe() == null) {
throw logger
.logExceptionAsError(
new IllegalArgumentException("Missing required property timeframe in model ExportDefinition"));
}
if (timePeriod() != null) {
timePeriod().validate();
}
if (dataSet() != null) {
dataSet().validate();
}
}
}