Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Automation] Generate Fluent Lite from Swagger cost-management#package-2022-10 #43580

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
@@ -296,7 +296,7 @@ com.azure.resourcemanager:azure-resourcemanager-postgresql;1.1.0;1.2.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-hdinsight;1.0.0;1.1.0-beta.3
com.azure.resourcemanager:azure-resourcemanager-sqlvirtualmachine;1.0.0-beta.5;1.0.0-beta.6
com.azure.resourcemanager:azure-resourcemanager-relay;1.0.0-beta.3;1.1.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-costmanagement;1.0.0-beta.7;1.0.0-beta.8
com.azure.resourcemanager:azure-resourcemanager-costmanagement;1.0.0-beta.7;1.0.0
com.azure.resourcemanager:azure-resourcemanager-recoveryservices;1.4.0;1.5.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-kusto;1.1.0;1.2.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-loganalytics;1.1.0;1.2.0-beta.1
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
# Release History

## 1.0.0-beta.8 (Unreleased)
## 1.0.0 (2024-12-24)

### Features Added
- Azure Resource Manager CostManagement client library for Java. This package contains Microsoft Azure SDK for CostManagement Management SDK. CostManagement management client provides access to CostManagement resources for Azure Enterprise Subscriptions. Package tag package-2022-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

### Breaking Changes

### Bugs Fixed
#### `models.SingleScopeBenefitRecommendationProperties` was modified

* `currencyCode()` was removed
* `costWithoutBenefit()` was removed
* `lastConsumptionDate()` was removed
* `totalHours()` was removed
* `firstConsumptionDate()` was removed
* `allRecommendationDetails()` was removed
* `armSkuName()` was removed

#### `models.SharedScopeBenefitRecommendationProperties` was modified

### Other Changes
* `allRecommendationDetails()` was removed
* `firstConsumptionDate()` was removed
* `costWithoutBenefit()` was removed
* `totalHours()` was removed
* `lastConsumptionDate()` was removed
* `currencyCode()` was removed
* `armSkuName()` was removed

## 1.0.0-beta.7 (2024-10-31)

Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-costmanagement</artifactId>
<version>1.0.0-beta.7</version>
<version>1.0.0</version>
</dependency>
```
[//]: # ({x-version-update-end})
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@

<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-costmanagement</artifactId>
<version>1.0.0-beta.8</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-costmanagement;current} -->
<version>1.0.0</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-costmanagement;current} -->
<packaging>jar</packaging>

<name>Microsoft Azure SDK for CostManagement Management</name>
@@ -45,7 +45,6 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
<revapi.skip>true</revapi.skip>
<spotless.skip>false</spotless.skip>
</properties>
<dependencies>
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
@@ -19,7 +20,6 @@
import com.azure.core.http.policy.RetryOptions;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
import com.azure.core.management.profile.AzureProfile;
import com.azure.core.util.Configuration;
import com.azure.core.util.logging.ClientLogger;
@@ -264,7 +264,7 @@ public CostManagementManager authenticate(TokenCredential credential, AzureProfi
.append("-")
.append("com.azure.resourcemanager.costmanagement")
.append("/")
.append("1.0.0-beta.7");
.append("1.0.0");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder.append(" (")
.append(Configuration.getGlobalConfiguration().get("java.version"))
@@ -297,7 +297,7 @@ public CostManagementManager authenticate(TokenCredential credential, AzureProfi
HttpPolicyProviders.addBeforeRetryPolicies(policies);
policies.add(retryPolicy);
policies.add(new AddDatePolicy());
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0])));
policies.addAll(this.policies.stream()
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
.collect(Collectors.toList()));
Original file line number Diff line number Diff line change
@@ -11,7 +11,6 @@
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.math.BigDecimal;
import java.time.OffsetDateTime;

/**
* The properties of the benefit recommendation when scope is 'Shared'.
@@ -23,42 +22,6 @@ public final class SharedScopeBenefitRecommendationProperties extends BenefitRec
*/
private Scope scope = Scope.SHARED;

/*
* The list of all benefit recommendations with the recommendation details.
*/
private AllSavingsList allRecommendationDetails;

/*
* The current cost without benefit, corresponds to 'totalHours' in the look-back period.
*/
private BigDecimal costWithoutBenefit;

/*
* An ISO 4217 currency code identifier for the costs and savings amounts.
*/
private String currencyCode;

/*
* ARM SKU name. 'Compute_Savings_Plan' for SavingsPlan.
*/
private String armSkuName;

/*
* The total hours for which the cost is covered. Its equal to number of records in a property
* 'properties/usage/charges'.
*/
private Integer totalHours;

/*
* The last usage date used for looking back for computing the recommendations.
*/
private OffsetDateTime lastConsumptionDate;

/*
* The first usage date used for looking back for computing the recommendations.
*/
private OffsetDateTime firstConsumptionDate;

/**
* Creates an instance of SharedScopeBenefitRecommendationProperties class.
*/
@@ -75,81 +38,6 @@ public Scope scope() {
return this.scope;
}

/**
* Get the allRecommendationDetails property: The list of all benefit recommendations with the recommendation
* details.
*
* @return the allRecommendationDetails value.
*/
@Override
public AllSavingsList allRecommendationDetails() {
return this.allRecommendationDetails;
}

/**
* Get the costWithoutBenefit property: The current cost without benefit, corresponds to 'totalHours' in the
* look-back period.
*
* @return the costWithoutBenefit value.
*/
@Override
public BigDecimal costWithoutBenefit() {
return this.costWithoutBenefit;
}

/**
* Get the currencyCode property: An ISO 4217 currency code identifier for the costs and savings amounts.
*
* @return the currencyCode value.
*/
@Override
public String currencyCode() {
return this.currencyCode;
}

/**
* Get the armSkuName property: ARM SKU name. 'Compute_Savings_Plan' for SavingsPlan.
*
* @return the armSkuName value.
*/
@Override
public String armSkuName() {
return this.armSkuName;
}

/**
* Get the totalHours property: The total hours for which the cost is covered. Its equal to number of records in a
* property 'properties/usage/charges'.
*
* @return the totalHours value.
*/
@Override
public Integer totalHours() {
return this.totalHours;
}

/**
* Get the lastConsumptionDate property: The last usage date used for looking back for computing the
* recommendations.
*
* @return the lastConsumptionDate value.
*/
@Override
public OffsetDateTime lastConsumptionDate() {
return this.lastConsumptionDate;
}

/**
* Get the firstConsumptionDate property: The first usage date used for looking back for computing the
* recommendations.
*
* @return the firstConsumptionDate value.
*/
@Override
public OffsetDateTime firstConsumptionDate() {
return this.firstConsumptionDate;
}

/**
* {@inheritDoc}
*/
@@ -247,39 +135,39 @@ public static SharedScopeBenefitRecommendationProperties fromJson(JsonReader jso
reader.nextToken();

if ("firstConsumptionDate".equals(fieldName)) {
deserializedSharedScopeBenefitRecommendationProperties.firstConsumptionDate = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
deserializedSharedScopeBenefitRecommendationProperties.withFirstConsumptionDate(reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
} else if ("lastConsumptionDate".equals(fieldName)) {
deserializedSharedScopeBenefitRecommendationProperties.lastConsumptionDate = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
deserializedSharedScopeBenefitRecommendationProperties.withLastConsumptionDate(reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
} else if ("lookBackPeriod".equals(fieldName)) {
deserializedSharedScopeBenefitRecommendationProperties
.withLookBackPeriod(LookBackPeriod.fromString(reader.getString()));
} else if ("totalHours".equals(fieldName)) {
deserializedSharedScopeBenefitRecommendationProperties.totalHours
= reader.getNullable(JsonReader::getInt);
deserializedSharedScopeBenefitRecommendationProperties
.withTotalHours(reader.getNullable(JsonReader::getInt));
} else if ("usage".equals(fieldName)) {
deserializedSharedScopeBenefitRecommendationProperties
.withUsage(RecommendationUsageDetails.fromJson(reader));
} else if ("armSkuName".equals(fieldName)) {
deserializedSharedScopeBenefitRecommendationProperties.armSkuName = reader.getString();
deserializedSharedScopeBenefitRecommendationProperties.withArmSkuName(reader.getString());
} else if ("term".equals(fieldName)) {
deserializedSharedScopeBenefitRecommendationProperties
.withTerm(Term.fromString(reader.getString()));
} else if ("commitmentGranularity".equals(fieldName)) {
deserializedSharedScopeBenefitRecommendationProperties
.withCommitmentGranularity(Grain.fromString(reader.getString()));
} else if ("currencyCode".equals(fieldName)) {
deserializedSharedScopeBenefitRecommendationProperties.currencyCode = reader.getString();
deserializedSharedScopeBenefitRecommendationProperties.withCurrencyCode(reader.getString());
} else if ("costWithoutBenefit".equals(fieldName)) {
deserializedSharedScopeBenefitRecommendationProperties.costWithoutBenefit
= reader.getNullable(nonNullReader -> new BigDecimal(nonNullReader.getString()));
deserializedSharedScopeBenefitRecommendationProperties.withCostWithoutBenefit(
reader.getNullable(nonNullReader -> new BigDecimal(nonNullReader.getString())));
} else if ("recommendationDetails".equals(fieldName)) {
deserializedSharedScopeBenefitRecommendationProperties
.withRecommendationDetails(AllSavingsBenefitDetails.fromJson(reader));
} else if ("allRecommendationDetails".equals(fieldName)) {
deserializedSharedScopeBenefitRecommendationProperties.allRecommendationDetails
= AllSavingsList.fromJson(reader);
deserializedSharedScopeBenefitRecommendationProperties
.withAllRecommendationDetails(AllSavingsList.fromJson(reader));
} else if ("scope".equals(fieldName)) {
deserializedSharedScopeBenefitRecommendationProperties.scope = Scope.fromString(reader.getString());
} else {
Original file line number Diff line number Diff line change
@@ -11,7 +11,6 @@
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.math.BigDecimal;
import java.time.OffsetDateTime;

/**
* The properties of the benefit recommendations when scope is 'Single'.
@@ -35,42 +34,6 @@ public final class SingleScopeBenefitRecommendationProperties extends BenefitRec
*/
private String resourceGroup;

/*
* The list of all benefit recommendations with the recommendation details.
*/
private AllSavingsList allRecommendationDetails;

/*
* The current cost without benefit, corresponds to 'totalHours' in the look-back period.
*/
private BigDecimal costWithoutBenefit;

/*
* An ISO 4217 currency code identifier for the costs and savings amounts.
*/
private String currencyCode;

/*
* ARM SKU name. 'Compute_Savings_Plan' for SavingsPlan.
*/
private String armSkuName;

/*
* The total hours for which the cost is covered. Its equal to number of records in a property
* 'properties/usage/charges'.
*/
private Integer totalHours;

/*
* The last usage date used for looking back for computing the recommendations.
*/
private OffsetDateTime lastConsumptionDate;

/*
* The first usage date used for looking back for computing the recommendations.
*/
private OffsetDateTime firstConsumptionDate;

/**
* Creates an instance of SingleScopeBenefitRecommendationProperties class.
*/
@@ -107,81 +70,6 @@ public String resourceGroup() {
return this.resourceGroup;
}

/**
* Get the allRecommendationDetails property: The list of all benefit recommendations with the recommendation
* details.
*
* @return the allRecommendationDetails value.
*/
@Override
public AllSavingsList allRecommendationDetails() {
return this.allRecommendationDetails;
}

/**
* Get the costWithoutBenefit property: The current cost without benefit, corresponds to 'totalHours' in the
* look-back period.
*
* @return the costWithoutBenefit value.
*/
@Override
public BigDecimal costWithoutBenefit() {
return this.costWithoutBenefit;
}

/**
* Get the currencyCode property: An ISO 4217 currency code identifier for the costs and savings amounts.
*
* @return the currencyCode value.
*/
@Override
public String currencyCode() {
return this.currencyCode;
}

/**
* Get the armSkuName property: ARM SKU name. 'Compute_Savings_Plan' for SavingsPlan.
*
* @return the armSkuName value.
*/
@Override
public String armSkuName() {
return this.armSkuName;
}

/**
* Get the totalHours property: The total hours for which the cost is covered. Its equal to number of records in a
* property 'properties/usage/charges'.
*
* @return the totalHours value.
*/
@Override
public Integer totalHours() {
return this.totalHours;
}

/**
* Get the lastConsumptionDate property: The last usage date used for looking back for computing the
* recommendations.
*
* @return the lastConsumptionDate value.
*/
@Override
public OffsetDateTime lastConsumptionDate() {
return this.lastConsumptionDate;
}

/**
* Get the firstConsumptionDate property: The first usage date used for looking back for computing the
* recommendations.
*
* @return the firstConsumptionDate value.
*/
@Override
public OffsetDateTime firstConsumptionDate() {
return this.firstConsumptionDate;
}

/**
* {@inheritDoc}
*/
@@ -279,39 +167,39 @@ public static SingleScopeBenefitRecommendationProperties fromJson(JsonReader jso
reader.nextToken();

if ("firstConsumptionDate".equals(fieldName)) {
deserializedSingleScopeBenefitRecommendationProperties.firstConsumptionDate = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
deserializedSingleScopeBenefitRecommendationProperties.withFirstConsumptionDate(reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
} else if ("lastConsumptionDate".equals(fieldName)) {
deserializedSingleScopeBenefitRecommendationProperties.lastConsumptionDate = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
deserializedSingleScopeBenefitRecommendationProperties.withLastConsumptionDate(reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())));
} else if ("lookBackPeriod".equals(fieldName)) {
deserializedSingleScopeBenefitRecommendationProperties
.withLookBackPeriod(LookBackPeriod.fromString(reader.getString()));
} else if ("totalHours".equals(fieldName)) {
deserializedSingleScopeBenefitRecommendationProperties.totalHours
= reader.getNullable(JsonReader::getInt);
deserializedSingleScopeBenefitRecommendationProperties
.withTotalHours(reader.getNullable(JsonReader::getInt));
} else if ("usage".equals(fieldName)) {
deserializedSingleScopeBenefitRecommendationProperties
.withUsage(RecommendationUsageDetails.fromJson(reader));
} else if ("armSkuName".equals(fieldName)) {
deserializedSingleScopeBenefitRecommendationProperties.armSkuName = reader.getString();
deserializedSingleScopeBenefitRecommendationProperties.withArmSkuName(reader.getString());
} else if ("term".equals(fieldName)) {
deserializedSingleScopeBenefitRecommendationProperties
.withTerm(Term.fromString(reader.getString()));
} else if ("commitmentGranularity".equals(fieldName)) {
deserializedSingleScopeBenefitRecommendationProperties
.withCommitmentGranularity(Grain.fromString(reader.getString()));
} else if ("currencyCode".equals(fieldName)) {
deserializedSingleScopeBenefitRecommendationProperties.currencyCode = reader.getString();
deserializedSingleScopeBenefitRecommendationProperties.withCurrencyCode(reader.getString());
} else if ("costWithoutBenefit".equals(fieldName)) {
deserializedSingleScopeBenefitRecommendationProperties.costWithoutBenefit
= reader.getNullable(nonNullReader -> new BigDecimal(nonNullReader.getString()));
deserializedSingleScopeBenefitRecommendationProperties.withCostWithoutBenefit(
reader.getNullable(nonNullReader -> new BigDecimal(nonNullReader.getString())));
} else if ("recommendationDetails".equals(fieldName)) {
deserializedSingleScopeBenefitRecommendationProperties
.withRecommendationDetails(AllSavingsBenefitDetails.fromJson(reader));
} else if ("allRecommendationDetails".equals(fieldName)) {
deserializedSingleScopeBenefitRecommendationProperties.allRecommendationDetails
= AllSavingsList.fromJson(reader);
deserializedSingleScopeBenefitRecommendationProperties
.withAllRecommendationDetails(AllSavingsList.fromJson(reader));
} else if ("scope".equals(fieldName)) {
deserializedSingleScopeBenefitRecommendationProperties.scope = Scope.fromString(reader.getString());
} else if ("subscriptionId".equals(fieldName)) {