Skip to content
Merged
Show file tree
Hide file tree
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 sdk/monitor/azure-monitor-query-metrics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 1.0.0 (07-30-2025)
## 1.0.0 (2025-07-30)

### Features Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@ public class MetricsQueryCustomization extends Customization {
* Customizes the MonitorQueryMetricsClientBuilder by adding audience support for authorization scopes.
* This customization adds a MetricsQueryAudience field and setter to the builder, and modifies
* the HTTP pipeline creation to use the audience when configuring bearer token authentication.
* This customization also updates the module-info.java file to export the metrics models package.
*
* @param libraryCustomization The library customization object for modifying generated code.
* @param logger The logger for recording customization activities.
*/
@Override
public void customize(LibraryCustomization libraryCustomization, Logger logger) {
String original = libraryCustomization.getRawEditor().getFileContent("src/main/java/module-info.java");
String replace = original.replace("exports com.azure.monitor.query.metrics.implementation;", "");

libraryCustomization.getRawEditor().replaceFile("src/main/java/module-info.java", replace);

libraryCustomization.getClass("com.azure.monitor.query.metrics.implementation", "MonitorQueryMetricsClientBuilder")
.customizeAst(ast -> {
ast.addImport("com.azure.monitor.query.metrics.models.MetricsQueryAudience");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ public MetricsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) {
* @param tokenCredential the tokenCredential value.
* @return the {@link MetricsClientBuilder}.
*/
@Override
public MetricsClientBuilder credential(TokenCredential tokenCredential) {
innerBuilder.credential(tokenCredential);
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public String getVersion() {

/**
* Gets the latest service version supported by this client library.
*
*
* @return The latest {@link MetricsServiceVersion}.
*/
public static MetricsServiceVersion getLatest() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.monitor.query.metrics.implementation;

import com.azure.core.annotation.Generated;
Expand All @@ -26,12 +25,13 @@
*/
@ServiceClient(builder = MonitorQueryMetricsClientBuilder.class, isAsync = true)
public final class MonitorQueryMetricsAsyncClient {

@Generated
private final MonitorQueryMetricsClientImpl serviceClient;

/**
* Initializes an instance of MonitorQueryMetricsAsyncClient class.
*
*
* @param serviceClient the service client implementation.
*/
@Generated
Expand Down Expand Up @@ -147,7 +147,7 @@ public final class MonitorQueryMetricsAsyncClient {
* }
* }
* </pre>
*
*
* @param subscriptionId The subscription identifier for the resources in this batch.
* @param metricNamespace Metric namespace that contains the requested metric names.
* @param metricNames The names of the metrics (comma separated) to retrieve.
Expand All @@ -169,7 +169,7 @@ public Mono<Response<BinaryData>> queryResourcesWithResponse(String subscription

/**
* Lists the metric values for multiple resources.
*
*
* @param subscriptionId The subscription identifier for the resources in this batch.
* @param metricNamespace Metric namespace that contains the requested metric names.
* @param metricNames The names of the metrics (comma separated) to retrieve.
Expand Down Expand Up @@ -251,7 +251,7 @@ public Mono<MetricResultsResponse> queryResources(String subscriptionId, String

/**
* Lists the metric values for multiple resources.
*
*
* @param subscriptionId The subscription identifier for the resources in this batch.
* @param metricNamespace Metric namespace that contains the requested metric names.
* @param metricNames The names of the metrics (comma separated) to retrieve.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.monitor.query.metrics.implementation;

import com.azure.core.annotation.Generated;
Expand All @@ -24,12 +23,13 @@
*/
@ServiceClient(builder = MonitorQueryMetricsClientBuilder.class)
public final class MonitorQueryMetricsClient {

@Generated
private final MonitorQueryMetricsClientImpl serviceClient;

/**
* Initializes an instance of MonitorQueryMetricsClient class.
*
*
* @param serviceClient the service client implementation.
*/
@Generated
Expand Down Expand Up @@ -145,7 +145,7 @@ public final class MonitorQueryMetricsClient {
* }
* }
* </pre>
*
*
* @param subscriptionId The subscription identifier for the resources in this batch.
* @param metricNamespace Metric namespace that contains the requested metric names.
* @param metricNames The names of the metrics (comma separated) to retrieve.
Expand All @@ -167,7 +167,7 @@ public Response<BinaryData> queryResourcesWithResponse(String subscriptionId, St

/**
* Lists the metric values for multiple resources.
*
*
* @param subscriptionId The subscription identifier for the resources in this batch.
* @param metricNamespace Metric namespace that contains the requested metric names.
* @param metricNames The names of the metrics (comma separated) to retrieve.
Expand Down Expand Up @@ -248,7 +248,7 @@ public MetricResultsResponse queryResources(String subscriptionId, String metric

/**
* Lists the metric values for multiple resources.
*
*
* @param subscriptionId The subscription identifier for the resources in this batch.
* @param metricNamespace Metric namespace that contains the requested metric names.
* @param metricNames The names of the metrics (comma separated) to retrieve.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,18 +221,6 @@ public MonitorQueryMetricsClientBuilder endpoint(String endpoint) {
@Generated
private MetricsServiceVersion serviceVersion;

/**
* Sets Service version.
*
* @param serviceVersion the serviceVersion value.
* @return the MonitorQueryMetricsClientBuilder.
*/
@Generated
public MonitorQueryMetricsClientBuilder serviceVersion(MetricsServiceVersion serviceVersion) {
this.serviceVersion = serviceVersion;
return this;
}

/*
* The retry policy that will attempt to retry failed requests, if applicable.
*/
Expand Down Expand Up @@ -355,4 +343,16 @@ public MonitorQueryMetricsClientBuilder audience(MetricsQueryAudience audience)
this.audience = audience;
return this;
}

/**
* Sets Service version.
*
* @param serviceVersion the serviceVersion value.
* @return the MonitorQueryMetricsClientBuilder.
*/
@Generated
public MonitorQueryMetricsClientBuilder serviceVersion(MetricsServiceVersion serviceVersion) {
this.serviceVersion = serviceVersion;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public final class MonitorQueryMetricsClientImpl {
/**
* Gets The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com. The region should match
* the region of the requested resources. For global resources, the region should be 'global'.
*
*
* @return the endpoint value.
*/
public String getEndpoint() {
Expand All @@ -70,7 +70,7 @@ public String getEndpoint() {

/**
* Gets Service version.
*
*
* @return the serviceVersion value.
*/
public MetricsServiceVersion getServiceVersion() {
Expand All @@ -84,7 +84,7 @@ public MetricsServiceVersion getServiceVersion() {

/**
* Gets The HTTP pipeline to send requests through.
*
*
* @return the httpPipeline value.
*/
public HttpPipeline getHttpPipeline() {
Expand All @@ -98,7 +98,7 @@ public HttpPipeline getHttpPipeline() {

/**
* Gets The serializer to serialize an object into a string.
*
*
* @return the serializerAdapter value.
*/
public SerializerAdapter getSerializerAdapter() {
Expand All @@ -107,7 +107,7 @@ public SerializerAdapter getSerializerAdapter() {

/**
* Initializes an instance of MonitorQueryMetricsClient client.
*
*
* @param endpoint The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com. The region
* should match
* the region of the requested resources. For global resources, the region should be 'global'.
Expand All @@ -120,7 +120,7 @@ public SerializerAdapter getSerializerAdapter() {

/**
* Initializes an instance of MonitorQueryMetricsClient client.
*
*
* @param httpPipeline The HTTP pipeline to send requests through.
* @param endpoint The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com. The region
* should match
Expand All @@ -133,7 +133,7 @@ public SerializerAdapter getSerializerAdapter() {

/**
* Initializes an instance of MonitorQueryMetricsClient client.
*
*
* @param httpPipeline The HTTP pipeline to send requests through.
* @param serializerAdapter The serializer to serialize an object into a string.
* @param endpoint The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com. The region
Expand Down Expand Up @@ -228,7 +228,7 @@ Response<BinaryData> queryResourcesSync(@HostParam("endpoint") String endpoint,
* </table>
* You can add these to a request with {@link RequestOptions#addQueryParam}
* <p><strong>Request Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand All @@ -238,9 +238,9 @@ Response<BinaryData> queryResourcesSync(@HostParam("endpoint") String endpoint,
* }
* }
* </pre>
*
*
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand Down Expand Up @@ -291,7 +291,7 @@ Response<BinaryData> queryResourcesSync(@HostParam("endpoint") String endpoint,
* }
* }
* </pre>
*
*
* @param subscriptionId The subscription identifier for the resources in this batch.
* @param metricNamespace Metric namespace that contains the requested metric names.
* @param metricNames The names of the metrics (comma separated) to retrieve.
Expand Down Expand Up @@ -361,7 +361,7 @@ public Mono<Response<BinaryData>> queryResourcesWithResponseAsync(String subscri
* </table>
* You can add these to a request with {@link RequestOptions#addQueryParam}
* <p><strong>Request Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand All @@ -371,9 +371,9 @@ public Mono<Response<BinaryData>> queryResourcesWithResponseAsync(String subscri
* }
* }
* </pre>
*
*
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand Down Expand Up @@ -424,7 +424,7 @@ public Mono<Response<BinaryData>> queryResourcesWithResponseAsync(String subscri
* }
* }
* </pre>
*
*
* @param subscriptionId The subscription identifier for the resources in this batch.
* @param metricNamespace Metric namespace that contains the requested metric names.
* @param metricNames The names of the metrics (comma separated) to retrieve.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.monitor.query.metrics.implementation.models;

import com.azure.core.annotation.Generated;
Expand All @@ -17,6 +16,7 @@
*/
@Immutable
public final class LocalizableString implements JsonSerializable<LocalizableString> {

/*
* The invariant value.
*/
Expand All @@ -31,7 +31,7 @@ public final class LocalizableString implements JsonSerializable<LocalizableStri

/**
* Creates an instance of LocalizableString class.
*
*
* @param value the value value to set.
*/
@Generated
Expand All @@ -41,7 +41,7 @@ private LocalizableString(String value) {

/**
* Get the value property: The invariant value.
*
*
* @return the value value.
*/
@Generated
Expand All @@ -51,7 +51,7 @@ public String getValue() {

/**
* Get the localizedValue property: The display name.
*
*
* @return the localizedValue value.
*/
@Generated
Expand All @@ -73,7 +73,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {

/**
* Reads an instance of LocalizableString from the JsonReader.
*
*
* @param jsonReader The JsonReader being read.
* @return An instance of LocalizableString if the JsonReader was pointing to an instance of it, or null if it was
* pointing to JSON null.
Expand All @@ -88,7 +88,6 @@ public static LocalizableString fromJson(JsonReader jsonReader) throws IOExcepti
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();

if ("value".equals(fieldName)) {
value = reader.getString();
} else if ("localizedValue".equals(fieldName)) {
Expand All @@ -99,7 +98,6 @@ public static LocalizableString fromJson(JsonReader jsonReader) throws IOExcepti
}
LocalizableString deserializedLocalizableString = new LocalizableString(value);
deserializedLocalizableString.localizedValue = localizedValue;

return deserializedLocalizableString;
});
}
Expand Down
Loading