diff --git a/commerce/resource-manager/v2015_06_01_preview/pom.xml b/commerce/resource-manager/v2015_06_01_preview/pom.xml
new file mode 100644
index 000000000000..bf160ce391b4
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/pom.xml
@@ -0,0 +1,133 @@
+
+
+ 4.0.0
+ com.microsoft.azure.commerce.v2015_06_01_preview
+
+ com.microsoft.azure
+ azure-arm-parent
+ 0.0.3-beta
+ ../../../pom.xml
+
+ azure-mgmt-commerce
+ 1.0.0-beta
+ jar
+ Microsoft Azure SDK for Commerce Management
+ This package contains Microsoft Commerce Management SDK.
+ https://github.com/Azure/azure-sdk-for-java
+
+
+ The MIT License (MIT)
+ http://opensource.org/licenses/MIT
+ repo
+
+
+
+ scm:git:https://github.com/Azure/azure-sdk-for-java
+ scm:git:git@github.com:Azure/azure-sdk-for-java.git
+ HEAD
+
+
+ UTF-8
+
+
+
+
+ microsoft
+ Microsoft
+
+
+
+
+ com.microsoft.azure
+ azure-client-runtime
+
+
+ com.microsoft.azure
+ azure-arm-client-runtime
+
+
+ junit
+ junit
+ test
+
+
+ com.microsoft.azure
+ azure-client-authentication
+ test
+
+
+ com.microsoft.azure
+ azure-mgmt-resources
+ test
+
+
+ com.microsoft.azure
+ azure-arm-client-runtime
+ test-jar
+ test
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+
+ true
+ true
+
+
+
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.1
+
+ 1.7
+ 1.7
+
+
+ com.microsoft.azure.management.apigeneration.LangDefinitionProcessor
+
+
+ true
+ true
+
+ true
+ true
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 2.8
+
+ *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search
+
+
+ /**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ */
+ ]]>
+
+
+
+
+
+
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/AggregationGranularity.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/AggregationGranularity.java
new file mode 100644
index 000000000000..4a39313f5772
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/AggregationGranularity.java
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ * Defines values for AggregationGranularity.
+ */
+public enum AggregationGranularity {
+ /** Enum value Daily. */
+ DAILY("Daily"),
+
+ /** Enum value Hourly. */
+ HOURLY("Hourly");
+
+ /** The actual serialized value for a AggregationGranularity instance. */
+ private String value;
+
+ AggregationGranularity(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Parses a serialized value to a AggregationGranularity instance.
+ *
+ * @param value the serialized value to parse.
+ * @return the parsed AggregationGranularity object, or null if unable to parse.
+ */
+ @JsonCreator
+ public static AggregationGranularity fromString(String value) {
+ AggregationGranularity[] items = AggregationGranularity.values();
+ for (AggregationGranularity item : items) {
+ if (item.toString().equalsIgnoreCase(value)) {
+ return item;
+ }
+ }
+ return null;
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return this.value;
+ }
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/ErrorResponse.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/ErrorResponse.java
new file mode 100644
index 000000000000..3051e786abbe
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/ErrorResponse.java
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Describes the format of Error response.
+ */
+public class ErrorResponse {
+ /**
+ * Error code.
+ */
+ @JsonProperty(value = "code")
+ private String code;
+
+ /**
+ * Error message indicating why the operation failed.
+ */
+ @JsonProperty(value = "message")
+ private String message;
+
+ /**
+ * Get error code.
+ *
+ * @return the code value
+ */
+ public String code() {
+ return this.code;
+ }
+
+ /**
+ * Set error code.
+ *
+ * @param code the code value to set
+ * @return the ErrorResponse object itself.
+ */
+ public ErrorResponse withCode(String code) {
+ this.code = code;
+ return this;
+ }
+
+ /**
+ * Get error message indicating why the operation failed.
+ *
+ * @return the message value
+ */
+ public String message() {
+ return this.message;
+ }
+
+ /**
+ * Set error message indicating why the operation failed.
+ *
+ * @param message the message value to set
+ * @return the ErrorResponse object itself.
+ */
+ public ErrorResponse withMessage(String message) {
+ this.message = message;
+ return this;
+ }
+
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/ErrorResponseException.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/ErrorResponseException.java
new file mode 100644
index 000000000000..2c604e1ca2bb
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/ErrorResponseException.java
@@ -0,0 +1,44 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview;
+
+import com.microsoft.rest.RestException;
+import okhttp3.ResponseBody;
+import retrofit2.Response;
+
+/**
+ * Exception thrown for an invalid response with ErrorResponse information.
+ */
+public class ErrorResponseException extends RestException {
+ /**
+ * Initializes a new instance of the ErrorResponseException class.
+ *
+ * @param message the exception message or the response content if a message is not available
+ * @param response the HTTP response
+ */
+ public ErrorResponseException(final String message, final Response response) {
+ super(message, response);
+ }
+
+ /**
+ * Initializes a new instance of the ErrorResponseException class.
+ *
+ * @param message the exception message or the response content if a message is not available
+ * @param response the HTTP response
+ * @param body the deserialized response body
+ */
+ public ErrorResponseException(final String message, final Response response, final ErrorResponse body) {
+ super(message, response, body);
+ }
+
+ @Override
+ public ErrorResponse body() {
+ return (ErrorResponse) super.body();
+ }
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/InfoField.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/InfoField.java
new file mode 100644
index 000000000000..7c46a3b86782
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/InfoField.java
@@ -0,0 +1,43 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Key-value pairs of instance details in the legacy format.
+ */
+public class InfoField {
+ /**
+ * Identifies the name of the instance provisioned by the user.
+ */
+ @JsonProperty(value = "project")
+ private String project;
+
+ /**
+ * Get identifies the name of the instance provisioned by the user.
+ *
+ * @return the project value
+ */
+ public String project() {
+ return this.project;
+ }
+
+ /**
+ * Set identifies the name of the instance provisioned by the user.
+ *
+ * @param project the project value to set
+ * @return the InfoField object itself.
+ */
+ public InfoField withProject(String project) {
+ this.project = project;
+ return this;
+ }
+
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/MeterInfo.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/MeterInfo.java
new file mode 100644
index 000000000000..4778584a41e2
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/MeterInfo.java
@@ -0,0 +1,287 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview;
+
+import java.util.UUID;
+import java.util.List;
+import java.util.Map;
+import org.joda.time.DateTime;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Detailed information about the meter.
+ */
+public class MeterInfo {
+ /**
+ * The unique identifier of the resource.
+ */
+ @JsonProperty(value = "MeterId")
+ private UUID meterId;
+
+ /**
+ * The name of the meter, within the given meter category.
+ */
+ @JsonProperty(value = "MeterName")
+ private String meterName;
+
+ /**
+ * The category of the meter, e.g., 'Cloud services', 'Networking', etc..
+ */
+ @JsonProperty(value = "MeterCategory")
+ private String meterCategory;
+
+ /**
+ * The subcategory of the meter, e.g., 'A6 Cloud services', 'ExpressRoute
+ * (IXP)', etc..
+ */
+ @JsonProperty(value = "MeterSubCategory")
+ private String meterSubCategory;
+
+ /**
+ * The unit in which the meter consumption is charged, e.g., 'Hours', 'GB',
+ * etc.
+ */
+ @JsonProperty(value = "Unit")
+ private String unit;
+
+ /**
+ * Provides additional meter data. 'Third Party' indicates a meter with no
+ * discount. Blanks indicate First Party.
+ */
+ @JsonProperty(value = "MeterTags")
+ private List meterTags;
+
+ /**
+ * The region in which the Azure service is available.
+ */
+ @JsonProperty(value = "MeterRegion")
+ private String meterRegion;
+
+ /**
+ * The list of key/value pairs for the meter rates, in the format
+ * 'key':'value' where key = the meter quantity, and value = the
+ * corresponding price.
+ */
+ @JsonProperty(value = "MeterRates")
+ private Map meterRates;
+
+ /**
+ * Indicates the date from which the meter rate is effective.
+ */
+ @JsonProperty(value = "EffectiveDate")
+ private DateTime effectiveDate;
+
+ /**
+ * The resource quantity that is included in the offer at no cost.
+ * Consumption beyond this quantity will be charged.
+ */
+ @JsonProperty(value = "IncludedQuantity")
+ private Double includedQuantity;
+
+ /**
+ * Get the unique identifier of the resource.
+ *
+ * @return the meterId value
+ */
+ public UUID meterId() {
+ return this.meterId;
+ }
+
+ /**
+ * Set the unique identifier of the resource.
+ *
+ * @param meterId the meterId value to set
+ * @return the MeterInfo object itself.
+ */
+ public MeterInfo withMeterId(UUID meterId) {
+ this.meterId = meterId;
+ return this;
+ }
+
+ /**
+ * Get the name of the meter, within the given meter category.
+ *
+ * @return the meterName value
+ */
+ public String meterName() {
+ return this.meterName;
+ }
+
+ /**
+ * Set the name of the meter, within the given meter category.
+ *
+ * @param meterName the meterName value to set
+ * @return the MeterInfo object itself.
+ */
+ public MeterInfo withMeterName(String meterName) {
+ this.meterName = meterName;
+ return this;
+ }
+
+ /**
+ * Get the category of the meter, e.g., 'Cloud services', 'Networking', etc..
+ *
+ * @return the meterCategory value
+ */
+ public String meterCategory() {
+ return this.meterCategory;
+ }
+
+ /**
+ * Set the category of the meter, e.g., 'Cloud services', 'Networking', etc..
+ *
+ * @param meterCategory the meterCategory value to set
+ * @return the MeterInfo object itself.
+ */
+ public MeterInfo withMeterCategory(String meterCategory) {
+ this.meterCategory = meterCategory;
+ return this;
+ }
+
+ /**
+ * Get the subcategory of the meter, e.g., 'A6 Cloud services', 'ExpressRoute (IXP)', etc..
+ *
+ * @return the meterSubCategory value
+ */
+ public String meterSubCategory() {
+ return this.meterSubCategory;
+ }
+
+ /**
+ * Set the subcategory of the meter, e.g., 'A6 Cloud services', 'ExpressRoute (IXP)', etc..
+ *
+ * @param meterSubCategory the meterSubCategory value to set
+ * @return the MeterInfo object itself.
+ */
+ public MeterInfo withMeterSubCategory(String meterSubCategory) {
+ this.meterSubCategory = meterSubCategory;
+ return this;
+ }
+
+ /**
+ * Get the unit in which the meter consumption is charged, e.g., 'Hours', 'GB', etc.
+ *
+ * @return the unit value
+ */
+ public String unit() {
+ return this.unit;
+ }
+
+ /**
+ * Set the unit in which the meter consumption is charged, e.g., 'Hours', 'GB', etc.
+ *
+ * @param unit the unit value to set
+ * @return the MeterInfo object itself.
+ */
+ public MeterInfo withUnit(String unit) {
+ this.unit = unit;
+ return this;
+ }
+
+ /**
+ * Get provides additional meter data. 'Third Party' indicates a meter with no discount. Blanks indicate First Party.
+ *
+ * @return the meterTags value
+ */
+ public List meterTags() {
+ return this.meterTags;
+ }
+
+ /**
+ * Set provides additional meter data. 'Third Party' indicates a meter with no discount. Blanks indicate First Party.
+ *
+ * @param meterTags the meterTags value to set
+ * @return the MeterInfo object itself.
+ */
+ public MeterInfo withMeterTags(List meterTags) {
+ this.meterTags = meterTags;
+ return this;
+ }
+
+ /**
+ * Get the region in which the Azure service is available.
+ *
+ * @return the meterRegion value
+ */
+ public String meterRegion() {
+ return this.meterRegion;
+ }
+
+ /**
+ * Set the region in which the Azure service is available.
+ *
+ * @param meterRegion the meterRegion value to set
+ * @return the MeterInfo object itself.
+ */
+ public MeterInfo withMeterRegion(String meterRegion) {
+ this.meterRegion = meterRegion;
+ return this;
+ }
+
+ /**
+ * Get the list of key/value pairs for the meter rates, in the format 'key':'value' where key = the meter quantity, and value = the corresponding price.
+ *
+ * @return the meterRates value
+ */
+ public Map meterRates() {
+ return this.meterRates;
+ }
+
+ /**
+ * Set the list of key/value pairs for the meter rates, in the format 'key':'value' where key = the meter quantity, and value = the corresponding price.
+ *
+ * @param meterRates the meterRates value to set
+ * @return the MeterInfo object itself.
+ */
+ public MeterInfo withMeterRates(Map meterRates) {
+ this.meterRates = meterRates;
+ return this;
+ }
+
+ /**
+ * Get indicates the date from which the meter rate is effective.
+ *
+ * @return the effectiveDate value
+ */
+ public DateTime effectiveDate() {
+ return this.effectiveDate;
+ }
+
+ /**
+ * Set indicates the date from which the meter rate is effective.
+ *
+ * @param effectiveDate the effectiveDate value to set
+ * @return the MeterInfo object itself.
+ */
+ public MeterInfo withEffectiveDate(DateTime effectiveDate) {
+ this.effectiveDate = effectiveDate;
+ return this;
+ }
+
+ /**
+ * Get the resource quantity that is included in the offer at no cost. Consumption beyond this quantity will be charged.
+ *
+ * @return the includedQuantity value
+ */
+ public Double includedQuantity() {
+ return this.includedQuantity;
+ }
+
+ /**
+ * Set the resource quantity that is included in the offer at no cost. Consumption beyond this quantity will be charged.
+ *
+ * @param includedQuantity the includedQuantity value to set
+ * @return the MeterInfo object itself.
+ */
+ public MeterInfo withIncludedQuantity(Double includedQuantity) {
+ this.includedQuantity = includedQuantity;
+ return this;
+ }
+
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/MonetaryCommitment.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/MonetaryCommitment.java
new file mode 100644
index 000000000000..a5e5ba8984da
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/MonetaryCommitment.java
@@ -0,0 +1,81 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview;
+
+import java.util.Map;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.UUID;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.microsoft.azure.management.commerce.v2015_06_01_preview.implementation.OfferTermInfoInner;
+
+/**
+ * Indicates that a monetary commitment is required for this offer.
+ */
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Name")
+@JsonTypeName("Monetary Commitment")
+public class MonetaryCommitment extends OfferTermInfoInner {
+ /**
+ * The list of key/value pairs for the tiered meter rates, in the format
+ * 'key':'value' where key = price, and value = the corresponding discount
+ * percentage. This field is used only by offer terms of type 'Monetary
+ * Commitment'.
+ */
+ @JsonProperty(value = "TieredDiscount")
+ private Map tieredDiscount;
+
+ /**
+ * An array of meter ids that are excluded from the given offer terms.
+ */
+ @JsonProperty(value = "ExcludedMeterIds")
+ private List excludedMeterIds;
+
+ /**
+ * Get the list of key/value pairs for the tiered meter rates, in the format 'key':'value' where key = price, and value = the corresponding discount percentage. This field is used only by offer terms of type 'Monetary Commitment'.
+ *
+ * @return the tieredDiscount value
+ */
+ public Map tieredDiscount() {
+ return this.tieredDiscount;
+ }
+
+ /**
+ * Set the list of key/value pairs for the tiered meter rates, in the format 'key':'value' where key = price, and value = the corresponding discount percentage. This field is used only by offer terms of type 'Monetary Commitment'.
+ *
+ * @param tieredDiscount the tieredDiscount value to set
+ * @return the MonetaryCommitment object itself.
+ */
+ public MonetaryCommitment withTieredDiscount(Map tieredDiscount) {
+ this.tieredDiscount = tieredDiscount;
+ return this;
+ }
+
+ /**
+ * Get an array of meter ids that are excluded from the given offer terms.
+ *
+ * @return the excludedMeterIds value
+ */
+ public List excludedMeterIds() {
+ return this.excludedMeterIds;
+ }
+
+ /**
+ * Set an array of meter ids that are excluded from the given offer terms.
+ *
+ * @param excludedMeterIds the excludedMeterIds value to set
+ * @return the MonetaryCommitment object itself.
+ */
+ public MonetaryCommitment withExcludedMeterIds(List excludedMeterIds) {
+ this.excludedMeterIds = excludedMeterIds;
+ return this;
+ }
+
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/MonetaryCredit.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/MonetaryCredit.java
new file mode 100644
index 000000000000..8da4aa44c2d7
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/MonetaryCredit.java
@@ -0,0 +1,77 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.UUID;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.microsoft.azure.management.commerce.v2015_06_01_preview.implementation.OfferTermInfoInner;
+
+/**
+ * Indicates that this is a monetary credit offer.
+ */
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Name")
+@JsonTypeName("Monetary Credit")
+public class MonetaryCredit extends OfferTermInfoInner {
+ /**
+ * The amount of credit provided under the terms of the given offer level.
+ */
+ @JsonProperty(value = "Credit")
+ private BigDecimal credit;
+
+ /**
+ * An array of meter ids that are excluded from the given offer terms.
+ */
+ @JsonProperty(value = "ExcludedMeterIds")
+ private List excludedMeterIds;
+
+ /**
+ * Get the amount of credit provided under the terms of the given offer level.
+ *
+ * @return the credit value
+ */
+ public BigDecimal credit() {
+ return this.credit;
+ }
+
+ /**
+ * Set the amount of credit provided under the terms of the given offer level.
+ *
+ * @param credit the credit value to set
+ * @return the MonetaryCredit object itself.
+ */
+ public MonetaryCredit withCredit(BigDecimal credit) {
+ this.credit = credit;
+ return this;
+ }
+
+ /**
+ * Get an array of meter ids that are excluded from the given offer terms.
+ *
+ * @return the excludedMeterIds value
+ */
+ public List excludedMeterIds() {
+ return this.excludedMeterIds;
+ }
+
+ /**
+ * Set an array of meter ids that are excluded from the given offer terms.
+ *
+ * @param excludedMeterIds the excludedMeterIds value to set
+ * @return the MonetaryCredit object itself.
+ */
+ public MonetaryCredit withExcludedMeterIds(List excludedMeterIds) {
+ this.excludedMeterIds = excludedMeterIds;
+ return this;
+ }
+
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/OfferTermInfo.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/OfferTermInfo.java
new file mode 100644
index 000000000000..7642dd6d24a2
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/OfferTermInfo.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.commerce.v2015_06_01_preview.implementation.CommerceManager;
+import com.microsoft.azure.management.commerce.v2015_06_01_preview.implementation.OfferTermInfoInner;
+import org.joda.time.DateTime;
+
+/**
+ * Type representing OfferTermInfo.
+ */
+public interface OfferTermInfo extends HasInner, HasManager {
+ /**
+ * @return the effectiveDate value.
+ */
+ DateTime effectiveDate();
+
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/RateCardQueryParameters.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/RateCardQueryParameters.java
new file mode 100644
index 000000000000..0cb686425328
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/RateCardQueryParameters.java
@@ -0,0 +1,126 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Parameters that are used in the odata $filter query parameter for providing
+ * RateCard information.
+ */
+public class RateCardQueryParameters {
+ /**
+ * The Offer ID parameter consists of the 'MS-AZR-' prefix, plus the Offer
+ * ID number (e.g., MS-AZR-0026P). See
+ * https://azure.microsoft.com/en-us/support/legal/offer-details/ for more
+ * information on the list of available Offer IDs, country/region
+ * availability, and billing currency.
+ */
+ @JsonProperty(value = "OfferDurableId", required = true)
+ private String offerDurableId;
+
+ /**
+ * The currency in which the rates need to be provided.
+ */
+ @JsonProperty(value = "Currency", required = true)
+ private String currency;
+
+ /**
+ * The culture in which the resource metadata needs to be localized.
+ */
+ @JsonProperty(value = "Locale", required = true)
+ private String locale;
+
+ /**
+ * 2 letter ISO code where the offer was purchased.
+ */
+ @JsonProperty(value = "RegionInfo", required = true)
+ private String regionInfo;
+
+ /**
+ * Get the Offer ID parameter consists of the 'MS-AZR-' prefix, plus the Offer ID number (e.g., MS-AZR-0026P). See https://azure.microsoft.com/en-us/support/legal/offer-details/ for more information on the list of available Offer IDs, country/region availability, and billing currency.
+ *
+ * @return the offerDurableId value
+ */
+ public String offerDurableId() {
+ return this.offerDurableId;
+ }
+
+ /**
+ * Set the Offer ID parameter consists of the 'MS-AZR-' prefix, plus the Offer ID number (e.g., MS-AZR-0026P). See https://azure.microsoft.com/en-us/support/legal/offer-details/ for more information on the list of available Offer IDs, country/region availability, and billing currency.
+ *
+ * @param offerDurableId the offerDurableId value to set
+ * @return the RateCardQueryParameters object itself.
+ */
+ public RateCardQueryParameters withOfferDurableId(String offerDurableId) {
+ this.offerDurableId = offerDurableId;
+ return this;
+ }
+
+ /**
+ * Get the currency in which the rates need to be provided.
+ *
+ * @return the currency value
+ */
+ public String currency() {
+ return this.currency;
+ }
+
+ /**
+ * Set the currency in which the rates need to be provided.
+ *
+ * @param currency the currency value to set
+ * @return the RateCardQueryParameters object itself.
+ */
+ public RateCardQueryParameters withCurrency(String currency) {
+ this.currency = currency;
+ return this;
+ }
+
+ /**
+ * Get the culture in which the resource metadata needs to be localized.
+ *
+ * @return the locale value
+ */
+ public String locale() {
+ return this.locale;
+ }
+
+ /**
+ * Set the culture in which the resource metadata needs to be localized.
+ *
+ * @param locale the locale value to set
+ * @return the RateCardQueryParameters object itself.
+ */
+ public RateCardQueryParameters withLocale(String locale) {
+ this.locale = locale;
+ return this;
+ }
+
+ /**
+ * Get 2 letter ISO code where the offer was purchased.
+ *
+ * @return the regionInfo value
+ */
+ public String regionInfo() {
+ return this.regionInfo;
+ }
+
+ /**
+ * Set 2 letter ISO code where the offer was purchased.
+ *
+ * @param regionInfo the regionInfo value to set
+ * @return the RateCardQueryParameters object itself.
+ */
+ public RateCardQueryParameters withRegionInfo(String regionInfo) {
+ this.regionInfo = regionInfo;
+ return this;
+ }
+
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/RateCards.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/RateCards.java
new file mode 100644
index 000000000000..e3e0050f6eed
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/RateCards.java
@@ -0,0 +1,28 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview;
+
+import rx.Observable;
+import com.microsoft.azure.management.commerce.v2015_06_01_preview.implementation.RateCardsInner;
+import com.microsoft.azure.arm.model.HasInner;
+
+/**
+ * Type representing RateCards.
+ */
+public interface RateCards extends HasInner {
+ /**
+ * Enables you to query for the resource/meter metadata and related prices used in a given subscription by Offer ID, Currency, Locale and Region. The metadata associated with the billing meters, including but not limited to service names, types, resources, units of measure, and regions, is subject to change at any time and without notice. If you intend to use this billing data in an automated fashion, please use the billing meter GUID to uniquely identify each billable item. If the billing meter GUID is scheduled to change due to a new billing model, you will be notified in advance of the change.
+ *
+ * @param filter The filter to apply on the operation. It ONLY supports the 'eq' and 'and' logical operators at this time. All the 4 query parameters 'OfferDurableId', 'Currency', 'Locale', 'Region' are required to be a part of the $filter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listAsync(String filter);
+
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/RecurringCharge.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/RecurringCharge.java
new file mode 100644
index 000000000000..b7821a6d00a5
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/RecurringCharge.java
@@ -0,0 +1,48 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.microsoft.azure.management.commerce.v2015_06_01_preview.implementation.OfferTermInfoInner;
+
+/**
+ * Indicates a recurring charge is present for this offer.
+ */
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Name")
+@JsonTypeName("Recurring Charge")
+public class RecurringCharge extends OfferTermInfoInner {
+ /**
+ * The amount of recurring charge as per the offer term.
+ */
+ @JsonProperty(value = "RecurringCharge")
+ private Integer recurringCharge;
+
+ /**
+ * Get the amount of recurring charge as per the offer term.
+ *
+ * @return the recurringCharge value
+ */
+ public Integer recurringCharge() {
+ return this.recurringCharge;
+ }
+
+ /**
+ * Set the amount of recurring charge as per the offer term.
+ *
+ * @param recurringCharge the recurringCharge value to set
+ * @return the RecurringCharge object itself.
+ */
+ public RecurringCharge withRecurringCharge(Integer recurringCharge) {
+ this.recurringCharge = recurringCharge;
+ return this;
+ }
+
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/UsageAggregates.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/UsageAggregates.java
new file mode 100644
index 000000000000..3e0e6b3dcff1
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/UsageAggregates.java
@@ -0,0 +1,30 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview;
+
+import rx.Observable;
+import org.joda.time.DateTime;
+import com.microsoft.azure.management.commerce.v2015_06_01_preview.implementation.UsageAggregatesInner;
+import com.microsoft.azure.arm.model.HasInner;
+
+/**
+ * Type representing UsageAggregates.
+ */
+public interface UsageAggregates extends HasInner {
+ /**
+ * Query aggregated Azure subscription consumption data for a date range.
+ *
+ * @param reportedStartTime The start of the time range to retrieve data for.
+ * @param reportedEndTime The end of the time range to retrieve data for.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listAsync(final DateTime reportedStartTime, final DateTime reportedEndTime);
+
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/UsageAggregation.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/UsageAggregation.java
new file mode 100644
index 000000000000..ece03b33dd2b
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/UsageAggregation.java
@@ -0,0 +1,97 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.commerce.v2015_06_01_preview.implementation.CommerceManager;
+import com.microsoft.azure.management.commerce.v2015_06_01_preview.implementation.UsageAggregationInner;
+import java.util.UUID;
+import org.joda.time.DateTime;
+
+/**
+ * Type representing UsageAggregation.
+ */
+public interface UsageAggregation extends HasInner, HasManager {
+ /**
+ * @return the id value.
+ */
+ String id();
+
+ /**
+ * @return the infoFields value.
+ */
+ InfoField infoFields();
+
+ /**
+ * @return the instanceData value.
+ */
+ String instanceData();
+
+ /**
+ * @return the meterCategory value.
+ */
+ String meterCategory();
+
+ /**
+ * @return the meterId value.
+ */
+ String meterId();
+
+ /**
+ * @return the meterName value.
+ */
+ String meterName();
+
+ /**
+ * @return the meterRegion value.
+ */
+ String meterRegion();
+
+ /**
+ * @return the meterSubCategory value.
+ */
+ String meterSubCategory();
+
+ /**
+ * @return the name value.
+ */
+ String name();
+
+ /**
+ * @return the quantity value.
+ */
+ Double quantity();
+
+ /**
+ * @return the subscriptionId value.
+ */
+ UUID subscriptionId();
+
+ /**
+ * @return the type value.
+ */
+ String type();
+
+ /**
+ * @return the unit value.
+ */
+ String unit();
+
+ /**
+ * @return the usageEndTime value.
+ */
+ DateTime usageEndTime();
+
+ /**
+ * @return the usageStartTime value.
+ */
+ DateTime usageStartTime();
+
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/CommerceManager.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/CommerceManager.java
new file mode 100644
index 000000000000..70e2fdf70121
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/CommerceManager.java
@@ -0,0 +1,111 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview.implementation;
+
+import com.microsoft.azure.AzureEnvironment;
+import com.microsoft.azure.AzureResponseBuilder;
+import com.microsoft.azure.credentials.AzureTokenCredentials;
+import com.microsoft.azure.management.apigeneration.Beta;
+import com.microsoft.azure.management.apigeneration.Beta.SinceVersion;
+import com.microsoft.azure.arm.resources.AzureConfigurable;
+import com.microsoft.azure.serializer.AzureJacksonAdapter;
+import com.microsoft.rest.RestClient;
+import com.microsoft.azure.management.commerce.v2015_06_01_preview.UsageAggregates;
+import com.microsoft.azure.management.commerce.v2015_06_01_preview.RateCards;
+import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl;
+import com.microsoft.azure.arm.resources.implementation.ManagerCore;
+
+/**
+ * Entry point to Azure Commerce resource management.
+ */
+public final class CommerceManager extends ManagerCore {
+ private UsageAggregates usageAggregates;
+ private RateCards rateCards;
+ /**
+ * Get a Configurable instance that can be used to create CommerceManager with optional configuration.
+ *
+ * @return the instance allowing configurations
+ */
+ public static Configurable configure() {
+ return new CommerceManager.ConfigurableImpl();
+ }
+ /**
+ * Creates an instance of CommerceManager that exposes Commerce resource management API entry points.
+ *
+ * @param credentials the credentials to use
+ * @param subscriptionId the subscription UUID
+ * @return the CommerceManager
+ */
+ public static CommerceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) {
+ return new CommerceManager(new RestClient.Builder()
+ .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER)
+ .withCredentials(credentials)
+ .withSerializerAdapter(new AzureJacksonAdapter())
+ .withResponseBuilderFactory(new AzureResponseBuilder.Factory())
+ .build(), subscriptionId);
+ }
+ /**
+ * Creates an instance of CommerceManager that exposes Commerce resource management API entry points.
+ *
+ * @param restClient the RestClient to be used for API calls.
+ * @param subscriptionId the subscription UUID
+ * @return the CommerceManager
+ */
+ public static CommerceManager authenticate(RestClient restClient, String subscriptionId) {
+ return new CommerceManager(restClient, subscriptionId);
+ }
+ /**
+ * The interface allowing configurations to be set.
+ */
+ public interface Configurable extends AzureConfigurable {
+ /**
+ * Creates an instance of CommerceManager that exposes Commerce management API entry points.
+ *
+ * @param credentials the credentials to use
+ * @param subscriptionId the subscription UUID
+ * @return the interface exposing Commerce management API entry points that work across subscriptions
+ */
+ CommerceManager authenticate(AzureTokenCredentials credentials, String subscriptionId);
+ }
+
+ /**
+ * @return Entry point to manage UsageAggregates.
+ */
+ public UsageAggregates usageAggregates() {
+ if (this.usageAggregates == null) {
+ this.usageAggregates = new UsageAggregatesImpl(this);
+ }
+ return this.usageAggregates;
+ }
+
+ /**
+ * @return Entry point to manage RateCards.
+ */
+ public RateCards rateCards() {
+ if (this.rateCards == null) {
+ this.rateCards = new RateCardsImpl(this);
+ }
+ return this.rateCards;
+ }
+
+ /**
+ * The implementation for Configurable interface.
+ */
+ private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable {
+ public CommerceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) {
+ return CommerceManager.authenticate(buildRestClient(credentials), subscriptionId);
+ }
+ }
+ private CommerceManager(RestClient restClient, String subscriptionId) {
+ super(
+ restClient,
+ subscriptionId,
+ new UsageManagementClientImpl(restClient).withSubscriptionId(subscriptionId));
+ }
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/IdParsingUtils.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/IdParsingUtils.java
new file mode 100644
index 000000000000..8e7dee5d623c
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/IdParsingUtils.java
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview.implementation;
+import java.util.Arrays;
+import java.util.Iterator;
+
+class IdParsingUtils {
+ public static String getValueFromIdByName(String id, String name) {
+ if (id == null) {
+ return null;
+ }
+ Iterable iterable = Arrays.asList(id.split("/"));
+ Iterator itr = iterable.iterator();
+ while (itr.hasNext()) {
+ String part = itr.next();
+ if (part != null && part.trim() != "") {
+ if (part.equalsIgnoreCase(name)) {
+ if (itr.hasNext()) {
+ return itr.next();
+ } else {
+ return null;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ public static String getValueFromIdByPosition(String id, int pos) {
+ if (id == null) {
+ return null;
+ }
+ Iterable iterable = Arrays.asList(id.split("/"));
+ Iterator itr = iterable.iterator();
+ int index = 0;
+ while (itr.hasNext()) {
+ String part = itr.next();
+ if (part != null && part.trim() != "") {
+ if (index == pos) {
+ if (itr.hasNext()) {
+ return itr.next();
+ } else {
+ return null;
+ }
+ }
+ }
+ index++;
+ }
+ return null;
+ }
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/OfferTermInfoImpl.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/OfferTermInfoImpl.java
new file mode 100644
index 000000000000..55ae1a8ae550
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/OfferTermInfoImpl.java
@@ -0,0 +1,32 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview.implementation;
+
+import com.microsoft.azure.management.commerce.v2015_06_01_preview.OfferTermInfo;
+import com.microsoft.azure.arm.model.implementation.WrapperImpl;
+import org.joda.time.DateTime;
+
+class OfferTermInfoImpl extends WrapperImpl implements OfferTermInfo {
+ private final CommerceManager manager;
+ OfferTermInfoImpl(OfferTermInfoInner inner, CommerceManager manager) {
+ super(inner);
+ this.manager = manager;
+ }
+
+ @Override
+ public CommerceManager manager() {
+ return this.manager;
+ }
+
+ @Override
+ public DateTime effectiveDate() {
+ return this.inner().effectiveDate();
+ }
+
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/OfferTermInfoInner.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/OfferTermInfoInner.java
new file mode 100644
index 000000000000..456bd21ed285
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/OfferTermInfoInner.java
@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview.implementation;
+
+import org.joda.time.DateTime;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+
+/**
+ * Describes the offer term.
+ */
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Name")
+@JsonTypeName("OfferTermInfo")
+@JsonSubTypes({
+ @JsonSubTypes.Type(name = "Monetary Credit", value = MonetaryCredit.class),
+ @JsonSubTypes.Type(name = "Monetary Commitment", value = MonetaryCommitment.class),
+ @JsonSubTypes.Type(name = "Recurring Charge", value = RecurringCharge.class)
+})
+public class OfferTermInfoInner {
+ /**
+ * Indicates the date from which the offer term is effective.
+ */
+ @JsonProperty(value = "EffectiveDate")
+ private DateTime effectiveDate;
+
+ /**
+ * Get indicates the date from which the offer term is effective.
+ *
+ * @return the effectiveDate value
+ */
+ public DateTime effectiveDate() {
+ return this.effectiveDate;
+ }
+
+ /**
+ * Set indicates the date from which the offer term is effective.
+ *
+ * @param effectiveDate the effectiveDate value to set
+ * @return the OfferTermInfoInner object itself.
+ */
+ public OfferTermInfoInner withEffectiveDate(DateTime effectiveDate) {
+ this.effectiveDate = effectiveDate;
+ return this;
+ }
+
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/PageImpl.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/PageImpl.java
new file mode 100644
index 000000000000..500d57840a8e
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/PageImpl.java
@@ -0,0 +1,75 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview.implementation;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.microsoft.azure.Page;
+import java.util.List;
+
+/**
+ * An instance of this class defines a page of Azure resources and a link to
+ * get the next page of resources, if any.
+ *
+ * @param type of Azure resource
+ */
+public class PageImpl implements Page {
+ /**
+ * The link to the next page.
+ */
+ @JsonProperty("nextLink")
+ private String nextPageLink;
+
+ /**
+ * The list of items.
+ */
+ @JsonProperty("value")
+ private List items;
+
+ /**
+ * Gets the link to the next page.
+ *
+ * @return the link to the next page.
+ */
+ @Override
+ public String nextPageLink() {
+ return this.nextPageLink;
+ }
+
+ /**
+ * Gets the list of items.
+ *
+ * @return the list of items in {@link List}.
+ */
+ @Override
+ public List items() {
+ return items;
+ }
+
+ /**
+ * Sets the link to the next page.
+ *
+ * @param nextPageLink the link to the next page.
+ * @return this Page object itself.
+ */
+ public PageImpl setNextPageLink(String nextPageLink) {
+ this.nextPageLink = nextPageLink;
+ return this;
+ }
+
+ /**
+ * Sets the list of items.
+ *
+ * @param items the list of items in {@link List}.
+ * @return this Page object itself.
+ */
+ public PageImpl setItems(List items) {
+ this.items = items;
+ return this;
+ }
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/PageImpl1.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/PageImpl1.java
new file mode 100644
index 000000000000..c0c3946b445b
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/PageImpl1.java
@@ -0,0 +1,75 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview.implementation;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.microsoft.azure.Page;
+import java.util.List;
+
+/**
+ * An instance of this class defines a page of Azure resources and a link to
+ * get the next page of resources, if any.
+ *
+ * @param type of Azure resource
+ */
+public class PageImpl1 implements Page {
+ /**
+ * The link to the next page.
+ */
+ @JsonProperty("")
+ private String nextPageLink;
+
+ /**
+ * The list of items.
+ */
+ @JsonProperty("value")
+ private List items;
+
+ /**
+ * Gets the link to the next page.
+ *
+ * @return the link to the next page.
+ */
+ @Override
+ public String nextPageLink() {
+ return this.nextPageLink;
+ }
+
+ /**
+ * Gets the list of items.
+ *
+ * @return the list of items in {@link List}.
+ */
+ @Override
+ public List items() {
+ return items;
+ }
+
+ /**
+ * Sets the link to the next page.
+ *
+ * @param nextPageLink the link to the next page.
+ * @return this Page object itself.
+ */
+ public PageImpl1 setNextPageLink(String nextPageLink) {
+ this.nextPageLink = nextPageLink;
+ return this;
+ }
+
+ /**
+ * Sets the list of items.
+ *
+ * @param items the list of items in {@link List}.
+ * @return this Page object itself.
+ */
+ public PageImpl1 setItems(List items) {
+ this.items = items;
+ return this;
+ }
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/RateCardsImpl.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/RateCardsImpl.java
new file mode 100644
index 000000000000..49f4ccc4f845
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/RateCardsImpl.java
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * abc
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview.implementation;
+
+import com.microsoft.azure.arm.model.implementation.WrapperImpl;
+import com.microsoft.azure.management.commerce.v2015_06_01_preview.RateCards;
+import rx.functions.Func1;
+import rx.Observable;
+import com.microsoft.azure.Page;
+import com.microsoft.azure.management.commerce.v2015_06_01_preview.OfferTermInfo;
+
+class RateCardsImpl extends WrapperImpl implements RateCards {
+ private final CommerceManager manager;
+
+ RateCardsImpl(CommerceManager manager) {
+ super(manager.inner().rateCards());
+ this.manager = manager;
+ }
+
+ public CommerceManager manager() {
+ return this.manager;
+ }
+
+ @Override
+ public Observable listAsync(String filter) {
+ RateCardsInner client = this.inner();
+ return client.listAsync(filter)
+ .flatMap(new Func1, Observable>() {
+ @Override
+ public Observable call(Page innerPage) {
+ return Observable.from(innerPage.items());
+ }
+ })
+ .map(new Func1() {
+ @Override
+ public OfferTermInfo call(OfferTermInfoInner inner) {
+ return new OfferTermInfoImpl(inner, manager());
+ }
+ });
+ }
+
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/RateCardsInner.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/RateCardsInner.java
new file mode 100644
index 000000000000..5a29e3264bf4
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/RateCardsInner.java
@@ -0,0 +1,151 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview.implementation;
+
+import retrofit2.Retrofit;
+import com.google.common.reflect.TypeToken;
+import com.microsoft.azure.management.commerce.v2015_06_01_preview.ErrorResponseException;
+import com.microsoft.azure.Page;
+import com.microsoft.azure.PagedList;
+import com.microsoft.rest.ServiceCallback;
+import com.microsoft.rest.ServiceFuture;
+import com.microsoft.rest.ServiceResponse;
+import java.io.IOException;
+import java.util.List;
+import okhttp3.ResponseBody;
+import retrofit2.http.GET;
+import retrofit2.http.Header;
+import retrofit2.http.Headers;
+import retrofit2.http.Path;
+import retrofit2.http.Query;
+import retrofit2.Response;
+import rx.functions.Func1;
+import rx.Observable;
+
+/**
+ * An instance of this class provides access to all the operations defined
+ * in RateCards.
+ */
+public class RateCardsInner {
+ /** The Retrofit service to perform REST calls. */
+ private RateCardsService service;
+ /** The service client containing this operation class. */
+ private UsageManagementClientImpl client;
+
+ /**
+ * Initializes an instance of RateCardsInner.
+ *
+ * @param retrofit the Retrofit instance built from a Retrofit Builder.
+ * @param client the instance of the service client containing this operation class.
+ */
+ public RateCardsInner(Retrofit retrofit, UsageManagementClientImpl client) {
+ this.service = retrofit.create(RateCardsService.class);
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for RateCards to be
+ * used by Retrofit to perform actually REST calls.
+ */
+ interface RateCardsService {
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.commerce.v2015_06_01_preview.RateCards list" })
+ @GET("subscriptions/{subscriptionId}/providers/Microsoft.Commerce/RateCard")
+ Observable> list(@Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+
+ }
+
+ /**
+ * Enables you to query for the resource/meter metadata and related prices used in a given subscription by Offer ID, Currency, Locale and Region. The metadata associated with the billing meters, including but not limited to service names, types, resources, units of measure, and regions, is subject to change at any time and without notice. If you intend to use this billing data in an automated fashion, please use the billing meter GUID to uniquely identify each billable item. If the billing meter GUID is scheduled to change due to a new billing model, you will be notified in advance of the change.
+ *
+ * @param filter The filter to apply on the operation. It ONLY supports the 'eq' and 'and' logical operators at this time. All the 4 query parameters 'OfferDurableId', 'Currency', 'Locale', 'Region' are required to be a part of the $filter.
+ * @return the PagedList object if successful.
+ */
+ public PagedList list(String filter) {
+ PageImpl1 page = new PageImpl1<>();
+ page.setItems(listWithServiceResponseAsync(filter).toBlocking().single().body());
+ page.setNextPageLink(null);
+ return new PagedList(page) {
+ @Override
+ public Page nextPage(String nextPageLink) {
+ return null;
+ }
+ };
+ }
+
+ /**
+ * Enables you to query for the resource/meter metadata and related prices used in a given subscription by Offer ID, Currency, Locale and Region. The metadata associated with the billing meters, including but not limited to service names, types, resources, units of measure, and regions, is subject to change at any time and without notice. If you intend to use this billing data in an automated fashion, please use the billing meter GUID to uniquely identify each billable item. If the billing meter GUID is scheduled to change due to a new billing model, you will be notified in advance of the change.
+ *
+ * @param filter The filter to apply on the operation. It ONLY supports the 'eq' and 'and' logical operators at this time. All the 4 query parameters 'OfferDurableId', 'Currency', 'Locale', 'Region' are required to be a part of the $filter.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @return the {@link ServiceFuture} object
+ */
+ public ServiceFuture> listAsync(String filter, final ServiceCallback> serviceCallback) {
+ return ServiceFuture.fromResponse(listWithServiceResponseAsync(filter), serviceCallback);
+ }
+
+ /**
+ * Enables you to query for the resource/meter metadata and related prices used in a given subscription by Offer ID, Currency, Locale and Region. The metadata associated with the billing meters, including but not limited to service names, types, resources, units of measure, and regions, is subject to change at any time and without notice. If you intend to use this billing data in an automated fashion, please use the billing meter GUID to uniquely identify each billable item. If the billing meter GUID is scheduled to change due to a new billing model, you will be notified in advance of the change.
+ *
+ * @param filter The filter to apply on the operation. It ONLY supports the 'eq' and 'and' logical operators at this time. All the 4 query parameters 'OfferDurableId', 'Currency', 'Locale', 'Region' are required to be a part of the $filter.
+ * @return the observable to the List<OfferTermInfoInner> object
+ */
+ public Observable> listAsync(String filter) {
+ return listWithServiceResponseAsync(filter).map(new Func1>, Page>() {
+ @Override
+ public Page call(ServiceResponse> response) {
+ PageImpl1 page = new PageImpl1<>();
+ page.setItems(response.body());
+ return page;
+ }
+ });
+ }
+
+ /**
+ * Enables you to query for the resource/meter metadata and related prices used in a given subscription by Offer ID, Currency, Locale and Region. The metadata associated with the billing meters, including but not limited to service names, types, resources, units of measure, and regions, is subject to change at any time and without notice. If you intend to use this billing data in an automated fashion, please use the billing meter GUID to uniquely identify each billable item. If the billing meter GUID is scheduled to change due to a new billing model, you will be notified in advance of the change.
+ *
+ * @param filter The filter to apply on the operation. It ONLY supports the 'eq' and 'and' logical operators at this time. All the 4 query parameters 'OfferDurableId', 'Currency', 'Locale', 'Region' are required to be a part of the $filter.
+ * @return the observable to the List<OfferTermInfoInner> object
+ */
+ public Observable>> listWithServiceResponseAsync(String filter) {
+ if (this.client.subscriptionId() == null) {
+ throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
+ }
+ if (filter == null) {
+ throw new IllegalArgumentException("Parameter filter is required and cannot be null.");
+ }
+ if (this.client.apiVersion() == null) {
+ throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
+ }
+ return service.list(this.client.subscriptionId(), filter, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>>() {
+ @Override
+ public Observable>> call(Response response) {
+ try {
+ ServiceResponse> result = listDelegate(response);
+ List items = null;
+ if (result.body() != null) {
+ items = result.body().items();
+ }
+ ServiceResponse> clientResponse = new ServiceResponse>(items, result.response());
+ return Observable.just(clientResponse);
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken>() { }.getType())
+ .registerError(ErrorResponseException.class)
+ .build(response);
+ }
+
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/UsageAggregatesImpl.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/UsageAggregatesImpl.java
new file mode 100644
index 000000000000..95ea1ba6ae70
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/UsageAggregatesImpl.java
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * abc
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview.implementation;
+
+import com.microsoft.azure.arm.model.implementation.WrapperImpl;
+import com.microsoft.azure.management.commerce.v2015_06_01_preview.UsageAggregates;
+import rx.functions.Func1;
+import rx.Observable;
+import com.microsoft.azure.Page;
+import com.microsoft.azure.management.commerce.v2015_06_01_preview.UsageAggregation;
+import org.joda.time.DateTime;
+
+class UsageAggregatesImpl extends WrapperImpl implements UsageAggregates {
+ private final CommerceManager manager;
+
+ UsageAggregatesImpl(CommerceManager manager) {
+ super(manager.inner().usageAggregates());
+ this.manager = manager;
+ }
+
+ public CommerceManager manager() {
+ return this.manager;
+ }
+
+ @Override
+ public Observable listAsync(final DateTime reportedStartTime, final DateTime reportedEndTime) {
+ UsageAggregatesInner client = this.inner();
+ return client.listAsync(reportedStartTime, reportedEndTime)
+ .flatMapIterable(new Func1, Iterable>() {
+ @Override
+ public Iterable call(Page page) {
+ return page.items();
+ }
+ })
+ .map(new Func1() {
+ @Override
+ public UsageAggregation call(UsageAggregationInner inner) {
+ return new UsageAggregationImpl(inner, manager());
+ }
+ });
+ }
+
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/UsageAggregatesInner.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/UsageAggregatesInner.java
new file mode 100644
index 000000000000..93658b79de41
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/UsageAggregatesInner.java
@@ -0,0 +1,439 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview.implementation;
+
+import retrofit2.Retrofit;
+import com.google.common.reflect.TypeToken;
+import com.microsoft.azure.AzureServiceFuture;
+import com.microsoft.azure.ListOperationCallback;
+import com.microsoft.azure.management.commerce.v2015_06_01_preview.AggregationGranularity;
+import com.microsoft.azure.management.commerce.v2015_06_01_preview.ErrorResponseException;
+import com.microsoft.azure.Page;
+import com.microsoft.azure.PagedList;
+import com.microsoft.rest.ServiceFuture;
+import com.microsoft.rest.ServiceResponse;
+import java.io.IOException;
+import java.util.List;
+import okhttp3.ResponseBody;
+import org.joda.time.DateTime;
+import retrofit2.http.GET;
+import retrofit2.http.Header;
+import retrofit2.http.Headers;
+import retrofit2.http.Path;
+import retrofit2.http.Query;
+import retrofit2.http.Url;
+import retrofit2.Response;
+import rx.functions.Func1;
+import rx.Observable;
+
+/**
+ * An instance of this class provides access to all the operations defined
+ * in UsageAggregates.
+ */
+public class UsageAggregatesInner {
+ /** The Retrofit service to perform REST calls. */
+ private UsageAggregatesService service;
+ /** The service client containing this operation class. */
+ private UsageManagementClientImpl client;
+
+ /**
+ * Initializes an instance of UsageAggregatesInner.
+ *
+ * @param retrofit the Retrofit instance built from a Retrofit Builder.
+ * @param client the instance of the service client containing this operation class.
+ */
+ public UsageAggregatesInner(Retrofit retrofit, UsageManagementClientImpl client) {
+ this.service = retrofit.create(UsageAggregatesService.class);
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for UsageAggregates to be
+ * used by Retrofit to perform actually REST calls.
+ */
+ interface UsageAggregatesService {
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.commerce.v2015_06_01_preview.UsageAggregates list" })
+ @GET("subscriptions/{subscriptionId}/providers/Microsoft.Commerce/UsageAggregates")
+ Observable> list(@Path("subscriptionId") String subscriptionId, @Query("reportedStartTime") DateTime reportedStartTime, @Query("reportedEndTime") DateTime reportedEndTime, @Query("showDetails") Boolean showDetails, @Query("aggregationGranularity") AggregationGranularity aggregationGranularity, @Query("continuationToken") String continuationToken, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.commerce.v2015_06_01_preview.UsageAggregates listNext" })
+ @GET
+ Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+
+ }
+
+ /**
+ * Query aggregated Azure subscription consumption data for a date range.
+ *
+ * @param reportedStartTime The start of the time range to retrieve data for.
+ * @param reportedEndTime The end of the time range to retrieve data for.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws ErrorResponseException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the PagedList<UsageAggregationInner> object if successful.
+ */
+ public PagedList list(final DateTime reportedStartTime, final DateTime reportedEndTime) {
+ ServiceResponse> response = listSinglePageAsync(reportedStartTime, reportedEndTime).toBlocking().single();
+ return new PagedList(response.body()) {
+ @Override
+ public Page nextPage(String nextPageLink) {
+ return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
+ }
+ };
+ }
+
+ /**
+ * Query aggregated Azure subscription consumption data for a date range.
+ *
+ * @param reportedStartTime The start of the time range to retrieve data for.
+ * @param reportedEndTime The end of the time range to retrieve data for.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ public ServiceFuture> listAsync(final DateTime reportedStartTime, final DateTime reportedEndTime, final ListOperationCallback serviceCallback) {
+ return AzureServiceFuture.fromPageResponse(
+ listSinglePageAsync(reportedStartTime, reportedEndTime),
+ new Func1>>>() {
+ @Override
+ public Observable>> call(String nextPageLink) {
+ return listNextSinglePageAsync(nextPageLink);
+ }
+ },
+ serviceCallback);
+ }
+
+ /**
+ * Query aggregated Azure subscription consumption data for a date range.
+ *
+ * @param reportedStartTime The start of the time range to retrieve data for.
+ * @param reportedEndTime The end of the time range to retrieve data for.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the PagedList<UsageAggregationInner> object
+ */
+ public Observable> listAsync(final DateTime reportedStartTime, final DateTime reportedEndTime) {
+ return listWithServiceResponseAsync(reportedStartTime, reportedEndTime)
+ .map(new Func1>, Page>() {
+ @Override
+ public Page call(ServiceResponse> response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * Query aggregated Azure subscription consumption data for a date range.
+ *
+ * @param reportedStartTime The start of the time range to retrieve data for.
+ * @param reportedEndTime The end of the time range to retrieve data for.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the PagedList<UsageAggregationInner> object
+ */
+ public Observable>> listWithServiceResponseAsync(final DateTime reportedStartTime, final DateTime reportedEndTime) {
+ return listSinglePageAsync(reportedStartTime, reportedEndTime)
+ .concatMap(new Func1>, Observable>>>() {
+ @Override
+ public Observable>> call(ServiceResponse> page) {
+ String nextPageLink = page.body().nextPageLink();
+ if (nextPageLink == null) {
+ return Observable.just(page);
+ }
+ return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
+ }
+ });
+ }
+
+ /**
+ * Query aggregated Azure subscription consumption data for a date range.
+ *
+ * @param reportedStartTime The start of the time range to retrieve data for.
+ * @param reportedEndTime The end of the time range to retrieve data for.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the PagedList<UsageAggregationInner> object wrapped in {@link ServiceResponse} if successful.
+ */
+ public Observable>> listSinglePageAsync(final DateTime reportedStartTime, final DateTime reportedEndTime) {
+ if (this.client.subscriptionId() == null) {
+ throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
+ }
+ if (reportedStartTime == null) {
+ throw new IllegalArgumentException("Parameter reportedStartTime is required and cannot be null.");
+ }
+ if (reportedEndTime == null) {
+ throw new IllegalArgumentException("Parameter reportedEndTime is required and cannot be null.");
+ }
+ if (this.client.apiVersion() == null) {
+ throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
+ }
+ final Boolean showDetails = null;
+ final AggregationGranularity aggregationGranularity = null;
+ final String continuationToken = null;
+ return service.list(this.client.subscriptionId(), reportedStartTime, reportedEndTime, showDetails, aggregationGranularity, continuationToken, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>>() {
+ @Override
+ public Observable>> call(Response response) {
+ try {
+ ServiceResponse> result = listDelegate(response);
+ return Observable.just(new ServiceResponse>(result.body(), result.response()));
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ /**
+ * Query aggregated Azure subscription consumption data for a date range.
+ *
+ * @param reportedStartTime The start of the time range to retrieve data for.
+ * @param reportedEndTime The end of the time range to retrieve data for.
+ * @param showDetails `True` returns usage data in instance-level detail, `false` causes server-side aggregation with fewer details. For example, if you have 3 website instances, by default you will get 3 line items for website consumption. If you specify showDetails = false, the data will be aggregated as a single line item for website consumption within the time period (for the given subscriptionId, meterId, usageStartTime and usageEndTime).
+ * @param aggregationGranularity `Daily` (default) returns the data in daily granularity, `Hourly` returns the data in hourly granularity. Possible values include: 'Daily', 'Hourly'
+ * @param continuationToken Used when a continuation token string is provided in the response body of the previous call, enabling paging through a large result set. If not present, the data is retrieved from the beginning of the day/hour (based on the granularity) passed in.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws ErrorResponseException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the PagedList<UsageAggregationInner> object if successful.
+ */
+ public PagedList list(final DateTime reportedStartTime, final DateTime reportedEndTime, final Boolean showDetails, final AggregationGranularity aggregationGranularity, final String continuationToken) {
+ ServiceResponse> response = listSinglePageAsync(reportedStartTime, reportedEndTime, showDetails, aggregationGranularity, continuationToken).toBlocking().single();
+ return new PagedList(response.body()) {
+ @Override
+ public Page nextPage(String nextPageLink) {
+ return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
+ }
+ };
+ }
+
+ /**
+ * Query aggregated Azure subscription consumption data for a date range.
+ *
+ * @param reportedStartTime The start of the time range to retrieve data for.
+ * @param reportedEndTime The end of the time range to retrieve data for.
+ * @param showDetails `True` returns usage data in instance-level detail, `false` causes server-side aggregation with fewer details. For example, if you have 3 website instances, by default you will get 3 line items for website consumption. If you specify showDetails = false, the data will be aggregated as a single line item for website consumption within the time period (for the given subscriptionId, meterId, usageStartTime and usageEndTime).
+ * @param aggregationGranularity `Daily` (default) returns the data in daily granularity, `Hourly` returns the data in hourly granularity. Possible values include: 'Daily', 'Hourly'
+ * @param continuationToken Used when a continuation token string is provided in the response body of the previous call, enabling paging through a large result set. If not present, the data is retrieved from the beginning of the day/hour (based on the granularity) passed in.
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ public ServiceFuture> listAsync(final DateTime reportedStartTime, final DateTime reportedEndTime, final Boolean showDetails, final AggregationGranularity aggregationGranularity, final String continuationToken, final ListOperationCallback serviceCallback) {
+ return AzureServiceFuture.fromPageResponse(
+ listSinglePageAsync(reportedStartTime, reportedEndTime, showDetails, aggregationGranularity, continuationToken),
+ new Func1>>>() {
+ @Override
+ public Observable>> call(String nextPageLink) {
+ return listNextSinglePageAsync(nextPageLink);
+ }
+ },
+ serviceCallback);
+ }
+
+ /**
+ * Query aggregated Azure subscription consumption data for a date range.
+ *
+ * @param reportedStartTime The start of the time range to retrieve data for.
+ * @param reportedEndTime The end of the time range to retrieve data for.
+ * @param showDetails `True` returns usage data in instance-level detail, `false` causes server-side aggregation with fewer details. For example, if you have 3 website instances, by default you will get 3 line items for website consumption. If you specify showDetails = false, the data will be aggregated as a single line item for website consumption within the time period (for the given subscriptionId, meterId, usageStartTime and usageEndTime).
+ * @param aggregationGranularity `Daily` (default) returns the data in daily granularity, `Hourly` returns the data in hourly granularity. Possible values include: 'Daily', 'Hourly'
+ * @param continuationToken Used when a continuation token string is provided in the response body of the previous call, enabling paging through a large result set. If not present, the data is retrieved from the beginning of the day/hour (based on the granularity) passed in.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the PagedList<UsageAggregationInner> object
+ */
+ public Observable> listAsync(final DateTime reportedStartTime, final DateTime reportedEndTime, final Boolean showDetails, final AggregationGranularity aggregationGranularity, final String continuationToken) {
+ return listWithServiceResponseAsync(reportedStartTime, reportedEndTime, showDetails, aggregationGranularity, continuationToken)
+ .map(new Func1>, Page>() {
+ @Override
+ public Page call(ServiceResponse> response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * Query aggregated Azure subscription consumption data for a date range.
+ *
+ * @param reportedStartTime The start of the time range to retrieve data for.
+ * @param reportedEndTime The end of the time range to retrieve data for.
+ * @param showDetails `True` returns usage data in instance-level detail, `false` causes server-side aggregation with fewer details. For example, if you have 3 website instances, by default you will get 3 line items for website consumption. If you specify showDetails = false, the data will be aggregated as a single line item for website consumption within the time period (for the given subscriptionId, meterId, usageStartTime and usageEndTime).
+ * @param aggregationGranularity `Daily` (default) returns the data in daily granularity, `Hourly` returns the data in hourly granularity. Possible values include: 'Daily', 'Hourly'
+ * @param continuationToken Used when a continuation token string is provided in the response body of the previous call, enabling paging through a large result set. If not present, the data is retrieved from the beginning of the day/hour (based on the granularity) passed in.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the PagedList<UsageAggregationInner> object
+ */
+ public Observable>> listWithServiceResponseAsync(final DateTime reportedStartTime, final DateTime reportedEndTime, final Boolean showDetails, final AggregationGranularity aggregationGranularity, final String continuationToken) {
+ return listSinglePageAsync(reportedStartTime, reportedEndTime, showDetails, aggregationGranularity, continuationToken)
+ .concatMap(new Func1>, Observable>>>() {
+ @Override
+ public Observable>> call(ServiceResponse> page) {
+ String nextPageLink = page.body().nextPageLink();
+ if (nextPageLink == null) {
+ return Observable.just(page);
+ }
+ return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
+ }
+ });
+ }
+
+ /**
+ * Query aggregated Azure subscription consumption data for a date range.
+ *
+ ServiceResponse> * @param reportedStartTime The start of the time range to retrieve data for.
+ ServiceResponse> * @param reportedEndTime The end of the time range to retrieve data for.
+ ServiceResponse> * @param showDetails `True` returns usage data in instance-level detail, `false` causes server-side aggregation with fewer details. For example, if you have 3 website instances, by default you will get 3 line items for website consumption. If you specify showDetails = false, the data will be aggregated as a single line item for website consumption within the time period (for the given subscriptionId, meterId, usageStartTime and usageEndTime).
+ ServiceResponse> * @param aggregationGranularity `Daily` (default) returns the data in daily granularity, `Hourly` returns the data in hourly granularity. Possible values include: 'Daily', 'Hourly'
+ ServiceResponse> * @param continuationToken Used when a continuation token string is provided in the response body of the previous call, enabling paging through a large result set. If not present, the data is retrieved from the beginning of the day/hour (based on the granularity) passed in.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the PagedList<UsageAggregationInner> object wrapped in {@link ServiceResponse} if successful.
+ */
+ public Observable>> listSinglePageAsync(final DateTime reportedStartTime, final DateTime reportedEndTime, final Boolean showDetails, final AggregationGranularity aggregationGranularity, final String continuationToken) {
+ if (this.client.subscriptionId() == null) {
+ throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
+ }
+ if (reportedStartTime == null) {
+ throw new IllegalArgumentException("Parameter reportedStartTime is required and cannot be null.");
+ }
+ if (reportedEndTime == null) {
+ throw new IllegalArgumentException("Parameter reportedEndTime is required and cannot be null.");
+ }
+ if (this.client.apiVersion() == null) {
+ throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
+ }
+ return service.list(this.client.subscriptionId(), reportedStartTime, reportedEndTime, showDetails, aggregationGranularity, continuationToken, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>>() {
+ @Override
+ public Observable>> call(Response response) {
+ try {
+ ServiceResponse> result = listDelegate(response);
+ return Observable.just(new ServiceResponse>(result.body(), result.response()));
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken>() { }.getType())
+ .registerError(ErrorResponseException.class)
+ .build(response);
+ }
+
+ /**
+ * Query aggregated Azure subscription consumption data for a date range.
+ *
+ * @param nextPageLink The NextLink from the previous successful call to List operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws ErrorResponseException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the PagedList<UsageAggregationInner> object if successful.
+ */
+ public PagedList listNext(final String nextPageLink) {
+ ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single();
+ return new PagedList(response.body()) {
+ @Override
+ public Page nextPage(String nextPageLink) {
+ return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
+ }
+ };
+ }
+
+ /**
+ * Query aggregated Azure subscription consumption data for a date range.
+ *
+ * @param nextPageLink The NextLink from the previous successful call to List operation.
+ * @param serviceFuture the ServiceFuture object tracking the Retrofit calls
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) {
+ return AzureServiceFuture.fromPageResponse(
+ listNextSinglePageAsync(nextPageLink),
+ new Func1>>>() {
+ @Override
+ public Observable>> call(String nextPageLink) {
+ return listNextSinglePageAsync(nextPageLink);
+ }
+ },
+ serviceCallback);
+ }
+
+ /**
+ * Query aggregated Azure subscription consumption data for a date range.
+ *
+ * @param nextPageLink The NextLink from the previous successful call to List operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the PagedList<UsageAggregationInner> object
+ */
+ public Observable> listNextAsync(final String nextPageLink) {
+ return listNextWithServiceResponseAsync(nextPageLink)
+ .map(new Func1>, Page>() {
+ @Override
+ public Page call(ServiceResponse> response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * Query aggregated Azure subscription consumption data for a date range.
+ *
+ * @param nextPageLink The NextLink from the previous successful call to List operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the PagedList<UsageAggregationInner> object
+ */
+ public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) {
+ return listNextSinglePageAsync(nextPageLink)
+ .concatMap(new Func1>, Observable>>>() {
+ @Override
+ public Observable>> call(ServiceResponse> page) {
+ String nextPageLink = page.body().nextPageLink();
+ if (nextPageLink == null) {
+ return Observable.just(page);
+ }
+ return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink));
+ }
+ });
+ }
+
+ /**
+ * Query aggregated Azure subscription consumption data for a date range.
+ *
+ ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the PagedList<UsageAggregationInner> object wrapped in {@link ServiceResponse} if successful.
+ */
+ public Observable>> listNextSinglePageAsync(final String nextPageLink) {
+ if (nextPageLink == null) {
+ throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
+ }
+ String nextUrl = String.format("%s", nextPageLink);
+ return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>>() {
+ @Override
+ public Observable>> call(Response response) {
+ try {
+ ServiceResponse> result = listNextDelegate(response);
+ return Observable.just(new ServiceResponse>(result.body(), result.response()));
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken>() { }.getType())
+ .registerError(ErrorResponseException.class)
+ .build(response);
+ }
+
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/UsageAggregationImpl.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/UsageAggregationImpl.java
new file mode 100644
index 000000000000..d7fed8f44395
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/UsageAggregationImpl.java
@@ -0,0 +1,104 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview.implementation;
+
+import com.microsoft.azure.management.commerce.v2015_06_01_preview.UsageAggregation;
+import com.microsoft.azure.arm.model.implementation.WrapperImpl;
+import com.microsoft.azure.management.commerce.v2015_06_01_preview.InfoField;
+import java.util.UUID;
+import org.joda.time.DateTime;
+
+class UsageAggregationImpl extends WrapperImpl implements UsageAggregation {
+ private final CommerceManager manager;
+ UsageAggregationImpl(UsageAggregationInner inner, CommerceManager manager) {
+ super(inner);
+ this.manager = manager;
+ }
+
+ @Override
+ public CommerceManager manager() {
+ return this.manager;
+ }
+
+ @Override
+ public String id() {
+ return this.inner().id();
+ }
+
+ @Override
+ public InfoField infoFields() {
+ return this.inner().infoFields();
+ }
+
+ @Override
+ public String instanceData() {
+ return this.inner().instanceData();
+ }
+
+ @Override
+ public String meterCategory() {
+ return this.inner().meterCategory();
+ }
+
+ @Override
+ public String meterId() {
+ return this.inner().meterId();
+ }
+
+ @Override
+ public String meterName() {
+ return this.inner().meterName();
+ }
+
+ @Override
+ public String meterRegion() {
+ return this.inner().meterRegion();
+ }
+
+ @Override
+ public String meterSubCategory() {
+ return this.inner().meterSubCategory();
+ }
+
+ @Override
+ public String name() {
+ return this.inner().name();
+ }
+
+ @Override
+ public Double quantity() {
+ return this.inner().quantity();
+ }
+
+ @Override
+ public UUID subscriptionId() {
+ return this.inner().subscriptionId();
+ }
+
+ @Override
+ public String type() {
+ return this.inner().type();
+ }
+
+ @Override
+ public String unit() {
+ return this.inner().unit();
+ }
+
+ @Override
+ public DateTime usageEndTime() {
+ return this.inner().usageEndTime();
+ }
+
+ @Override
+ public DateTime usageStartTime() {
+ return this.inner().usageStartTime();
+ }
+
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/UsageAggregationInner.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/UsageAggregationInner.java
new file mode 100644
index 000000000000..c8d634676de9
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/UsageAggregationInner.java
@@ -0,0 +1,414 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview.implementation;
+
+import java.util.UUID;
+import org.joda.time.DateTime;
+import com.microsoft.azure.management.commerce.v2015_06_01_preview.InfoField;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.microsoft.rest.serializer.JsonFlatten;
+
+/**
+ * Describes the usageAggregation.
+ */
+@JsonFlatten
+public class UsageAggregationInner {
+ /**
+ * Unique Id for the usage aggregate.
+ */
+ @JsonProperty(value = "id")
+ private String id;
+
+ /**
+ * Name of the usage aggregate.
+ */
+ @JsonProperty(value = "name")
+ private String name;
+
+ /**
+ * Type of the resource being returned.
+ */
+ @JsonProperty(value = "type")
+ private String type;
+
+ /**
+ * The subscription identifier for the Azure user.
+ */
+ @JsonProperty(value = "properties.subscriptionId")
+ private UUID subscriptionId;
+
+ /**
+ * Unique ID for the resource that was consumed (aka ResourceID).
+ */
+ @JsonProperty(value = "properties.meterId")
+ private String meterId;
+
+ /**
+ * UTC start time for the usage bucket to which this usage aggregate
+ * belongs.
+ */
+ @JsonProperty(value = "properties.usageStartTime")
+ private DateTime usageStartTime;
+
+ /**
+ * UTC end time for the usage bucket to which this usage aggregate belongs.
+ */
+ @JsonProperty(value = "properties.usageEndTime")
+ private DateTime usageEndTime;
+
+ /**
+ * The amount of the resource consumption that occurred in this time frame.
+ */
+ @JsonProperty(value = "properties.quantity")
+ private Double quantity;
+
+ /**
+ * The unit in which the usage for this resource is being counted, e.g.
+ * Hours, GB.
+ */
+ @JsonProperty(value = "properties.unit")
+ private String unit;
+
+ /**
+ * Friendly name of the resource being consumed.
+ */
+ @JsonProperty(value = "properties.meterName")
+ private String meterName;
+
+ /**
+ * Category of the consumed resource.
+ */
+ @JsonProperty(value = "properties.meterCategory")
+ private String meterCategory;
+
+ /**
+ * Sub-category of the consumed resource.
+ */
+ @JsonProperty(value = "properties.meterSubCategory")
+ private String meterSubCategory;
+
+ /**
+ * Region of the meterId used for billing purposes.
+ */
+ @JsonProperty(value = "properties.meterRegion")
+ private String meterRegion;
+
+ /**
+ * Key-value pairs of instance details (legacy format).
+ */
+ @JsonProperty(value = "properties.infoFields")
+ private InfoField infoFields;
+
+ /**
+ * Key-value pairs of instance details represented as a string.
+ */
+ @JsonProperty(value = "properties.instanceData")
+ private String instanceData;
+
+ /**
+ * Get unique Id for the usage aggregate.
+ *
+ * @return the id value
+ */
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Set unique Id for the usage aggregate.
+ *
+ * @param id the id value to set
+ * @return the UsageAggregationInner object itself.
+ */
+ public UsageAggregationInner withId(String id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get name of the usage aggregate.
+ *
+ * @return the name value
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set name of the usage aggregate.
+ *
+ * @param name the name value to set
+ * @return the UsageAggregationInner object itself.
+ */
+ public UsageAggregationInner withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get type of the resource being returned.
+ *
+ * @return the type value
+ */
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Set type of the resource being returned.
+ *
+ * @param type the type value to set
+ * @return the UsageAggregationInner object itself.
+ */
+ public UsageAggregationInner withType(String type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Get the subscription identifier for the Azure user.
+ *
+ * @return the subscriptionId value
+ */
+ public UUID subscriptionId() {
+ return this.subscriptionId;
+ }
+
+ /**
+ * Set the subscription identifier for the Azure user.
+ *
+ * @param subscriptionId the subscriptionId value to set
+ * @return the UsageAggregationInner object itself.
+ */
+ public UsageAggregationInner withSubscriptionId(UUID subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /**
+ * Get unique ID for the resource that was consumed (aka ResourceID).
+ *
+ * @return the meterId value
+ */
+ public String meterId() {
+ return this.meterId;
+ }
+
+ /**
+ * Set unique ID for the resource that was consumed (aka ResourceID).
+ *
+ * @param meterId the meterId value to set
+ * @return the UsageAggregationInner object itself.
+ */
+ public UsageAggregationInner withMeterId(String meterId) {
+ this.meterId = meterId;
+ return this;
+ }
+
+ /**
+ * Get uTC start time for the usage bucket to which this usage aggregate belongs.
+ *
+ * @return the usageStartTime value
+ */
+ public DateTime usageStartTime() {
+ return this.usageStartTime;
+ }
+
+ /**
+ * Set uTC start time for the usage bucket to which this usage aggregate belongs.
+ *
+ * @param usageStartTime the usageStartTime value to set
+ * @return the UsageAggregationInner object itself.
+ */
+ public UsageAggregationInner withUsageStartTime(DateTime usageStartTime) {
+ this.usageStartTime = usageStartTime;
+ return this;
+ }
+
+ /**
+ * Get uTC end time for the usage bucket to which this usage aggregate belongs.
+ *
+ * @return the usageEndTime value
+ */
+ public DateTime usageEndTime() {
+ return this.usageEndTime;
+ }
+
+ /**
+ * Set uTC end time for the usage bucket to which this usage aggregate belongs.
+ *
+ * @param usageEndTime the usageEndTime value to set
+ * @return the UsageAggregationInner object itself.
+ */
+ public UsageAggregationInner withUsageEndTime(DateTime usageEndTime) {
+ this.usageEndTime = usageEndTime;
+ return this;
+ }
+
+ /**
+ * Get the amount of the resource consumption that occurred in this time frame.
+ *
+ * @return the quantity value
+ */
+ public Double quantity() {
+ return this.quantity;
+ }
+
+ /**
+ * Set the amount of the resource consumption that occurred in this time frame.
+ *
+ * @param quantity the quantity value to set
+ * @return the UsageAggregationInner object itself.
+ */
+ public UsageAggregationInner withQuantity(Double quantity) {
+ this.quantity = quantity;
+ return this;
+ }
+
+ /**
+ * Get the unit in which the usage for this resource is being counted, e.g. Hours, GB.
+ *
+ * @return the unit value
+ */
+ public String unit() {
+ return this.unit;
+ }
+
+ /**
+ * Set the unit in which the usage for this resource is being counted, e.g. Hours, GB.
+ *
+ * @param unit the unit value to set
+ * @return the UsageAggregationInner object itself.
+ */
+ public UsageAggregationInner withUnit(String unit) {
+ this.unit = unit;
+ return this;
+ }
+
+ /**
+ * Get friendly name of the resource being consumed.
+ *
+ * @return the meterName value
+ */
+ public String meterName() {
+ return this.meterName;
+ }
+
+ /**
+ * Set friendly name of the resource being consumed.
+ *
+ * @param meterName the meterName value to set
+ * @return the UsageAggregationInner object itself.
+ */
+ public UsageAggregationInner withMeterName(String meterName) {
+ this.meterName = meterName;
+ return this;
+ }
+
+ /**
+ * Get category of the consumed resource.
+ *
+ * @return the meterCategory value
+ */
+ public String meterCategory() {
+ return this.meterCategory;
+ }
+
+ /**
+ * Set category of the consumed resource.
+ *
+ * @param meterCategory the meterCategory value to set
+ * @return the UsageAggregationInner object itself.
+ */
+ public UsageAggregationInner withMeterCategory(String meterCategory) {
+ this.meterCategory = meterCategory;
+ return this;
+ }
+
+ /**
+ * Get sub-category of the consumed resource.
+ *
+ * @return the meterSubCategory value
+ */
+ public String meterSubCategory() {
+ return this.meterSubCategory;
+ }
+
+ /**
+ * Set sub-category of the consumed resource.
+ *
+ * @param meterSubCategory the meterSubCategory value to set
+ * @return the UsageAggregationInner object itself.
+ */
+ public UsageAggregationInner withMeterSubCategory(String meterSubCategory) {
+ this.meterSubCategory = meterSubCategory;
+ return this;
+ }
+
+ /**
+ * Get region of the meterId used for billing purposes.
+ *
+ * @return the meterRegion value
+ */
+ public String meterRegion() {
+ return this.meterRegion;
+ }
+
+ /**
+ * Set region of the meterId used for billing purposes.
+ *
+ * @param meterRegion the meterRegion value to set
+ * @return the UsageAggregationInner object itself.
+ */
+ public UsageAggregationInner withMeterRegion(String meterRegion) {
+ this.meterRegion = meterRegion;
+ return this;
+ }
+
+ /**
+ * Get key-value pairs of instance details (legacy format).
+ *
+ * @return the infoFields value
+ */
+ public InfoField infoFields() {
+ return this.infoFields;
+ }
+
+ /**
+ * Set key-value pairs of instance details (legacy format).
+ *
+ * @param infoFields the infoFields value to set
+ * @return the UsageAggregationInner object itself.
+ */
+ public UsageAggregationInner withInfoFields(InfoField infoFields) {
+ this.infoFields = infoFields;
+ return this;
+ }
+
+ /**
+ * Get key-value pairs of instance details represented as a string.
+ *
+ * @return the instanceData value
+ */
+ public String instanceData() {
+ return this.instanceData;
+ }
+
+ /**
+ * Set key-value pairs of instance details represented as a string.
+ *
+ * @param instanceData the instanceData value to set
+ * @return the UsageAggregationInner object itself.
+ */
+ public UsageAggregationInner withInstanceData(String instanceData) {
+ this.instanceData = instanceData;
+ return this;
+ }
+
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/UsageManagementClientImpl.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/UsageManagementClientImpl.java
new file mode 100644
index 000000000000..c2f4aaf66f9e
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/UsageManagementClientImpl.java
@@ -0,0 +1,210 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.commerce.v2015_06_01_preview.implementation;
+
+import com.microsoft.azure.AzureClient;
+import com.microsoft.azure.AzureServiceClient;
+import com.microsoft.rest.credentials.ServiceClientCredentials;
+import com.microsoft.rest.RestClient;
+
+/**
+ * Initializes a new instance of the UsageManagementClientImpl class.
+ */
+public class UsageManagementClientImpl extends AzureServiceClient {
+ /** the {@link AzureClient} used for long running operations. */
+ private AzureClient azureClient;
+
+ /**
+ * Gets the {@link AzureClient} used for long running operations.
+ * @return the azure client;
+ */
+ public AzureClient getAzureClient() {
+ return this.azureClient;
+ }
+
+ /** It uniquely identifies Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */
+ private String subscriptionId;
+
+ /**
+ * Gets It uniquely identifies Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
+ *
+ * @return the subscriptionId value.
+ */
+ public String subscriptionId() {
+ return this.subscriptionId;
+ }
+
+ /**
+ * Sets It uniquely identifies Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
+ *
+ * @param subscriptionId the subscriptionId value.
+ * @return the service client itself
+ */
+ public UsageManagementClientImpl withSubscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /** Client Api Version. */
+ private String apiVersion;
+
+ /**
+ * Gets Client Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ public String apiVersion() {
+ return this.apiVersion;
+ }
+
+ /** The preferred language for the response. */
+ private String acceptLanguage;
+
+ /**
+ * Gets The preferred language for the response.
+ *
+ * @return the acceptLanguage value.
+ */
+ public String acceptLanguage() {
+ return this.acceptLanguage;
+ }
+
+ /**
+ * Sets The preferred language for the response.
+ *
+ * @param acceptLanguage the acceptLanguage value.
+ * @return the service client itself
+ */
+ public UsageManagementClientImpl withAcceptLanguage(String acceptLanguage) {
+ this.acceptLanguage = acceptLanguage;
+ return this;
+ }
+
+ /** The retry timeout in seconds for Long Running Operations. Default value is 30. */
+ private int longRunningOperationRetryTimeout;
+
+ /**
+ * Gets The retry timeout in seconds for Long Running Operations. Default value is 30.
+ *
+ * @return the longRunningOperationRetryTimeout value.
+ */
+ public int longRunningOperationRetryTimeout() {
+ return this.longRunningOperationRetryTimeout;
+ }
+
+ /**
+ * Sets The retry timeout in seconds for Long Running Operations. Default value is 30.
+ *
+ * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value.
+ * @return the service client itself
+ */
+ public UsageManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) {
+ this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout;
+ return this;
+ }
+
+ /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */
+ private boolean generateClientRequestId;
+
+ /**
+ * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
+ *
+ * @return the generateClientRequestId value.
+ */
+ public boolean generateClientRequestId() {
+ return this.generateClientRequestId;
+ }
+
+ /**
+ * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
+ *
+ * @param generateClientRequestId the generateClientRequestId value.
+ * @return the service client itself
+ */
+ public UsageManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) {
+ this.generateClientRequestId = generateClientRequestId;
+ return this;
+ }
+
+ /**
+ * The UsageAggregatesInner object to access its operations.
+ */
+ private UsageAggregatesInner usageAggregates;
+
+ /**
+ * Gets the UsageAggregatesInner object to access its operations.
+ * @return the UsageAggregatesInner object.
+ */
+ public UsageAggregatesInner usageAggregates() {
+ return this.usageAggregates;
+ }
+
+ /**
+ * The RateCardsInner object to access its operations.
+ */
+ private RateCardsInner rateCards;
+
+ /**
+ * Gets the RateCardsInner object to access its operations.
+ * @return the RateCardsInner object.
+ */
+ public RateCardsInner rateCards() {
+ return this.rateCards;
+ }
+
+ /**
+ * Initializes an instance of UsageManagementClient client.
+ *
+ * @param credentials the management credentials for Azure
+ */
+ public UsageManagementClientImpl(ServiceClientCredentials credentials) {
+ this("https://management.azure.com", credentials);
+ }
+
+ /**
+ * Initializes an instance of UsageManagementClient client.
+ *
+ * @param baseUrl the base URL of the host
+ * @param credentials the management credentials for Azure
+ */
+ public UsageManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) {
+ super(baseUrl, credentials);
+ initialize();
+ }
+
+ /**
+ * Initializes an instance of UsageManagementClient client.
+ *
+ * @param restClient the REST client to connect to Azure.
+ */
+ public UsageManagementClientImpl(RestClient restClient) {
+ super(restClient);
+ initialize();
+ }
+
+ protected void initialize() {
+ this.apiVersion = "2015-06-01-preview";
+ this.acceptLanguage = "en-US";
+ this.longRunningOperationRetryTimeout = 30;
+ this.generateClientRequestId = true;
+ this.usageAggregates = new UsageAggregatesInner(restClient().retrofit(), this);
+ this.rateCards = new RateCardsInner(restClient().retrofit(), this);
+ this.azureClient = new AzureClient(this);
+ }
+
+ /**
+ * Gets the User-Agent header for the client.
+ *
+ * @return the user agent string.
+ */
+ @Override
+ public String userAgent() {
+ return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "UsageManagementClient", "2015-06-01-preview");
+ }
+}
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/package-info.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/package-info.java
new file mode 100644
index 000000000000..21137d9cbfe6
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/implementation/package-info.java
@@ -0,0 +1,10 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/**
+ * This package contains the implementation classes for UsageManagementClient.
+ */
+package com.microsoft.azure.management.commerce.v2015_06_01_preview.implementation;
diff --git a/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/package-info.java b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/package-info.java
new file mode 100644
index 000000000000..23f3e1036f97
--- /dev/null
+++ b/commerce/resource-manager/v2015_06_01_preview/src/main/java/com/microsoft/azure/management/commerce/v2015_06_01_preview/package-info.java
@@ -0,0 +1,10 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/**
+ * This package contains the classes for UsageManagementClient.
+ */
+package com.microsoft.azure.management.commerce.v2015_06_01_preview;