Skip to content

Commit

Permalink
CodeGen from PR 31024 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 09ce82f26c0c0df0466da7765c7c66255cb248a2 into de278c0e1b5bcfe706e5adb5b082e5a6fc9e4318
  • Loading branch information
SDKAuto committed Oct 21, 2024
1 parent 46f877d commit 1382511
Show file tree
Hide file tree
Showing 836 changed files with 17,170 additions and 18,788 deletions.
981 changes: 977 additions & 4 deletions sdk/eventgrid/azure-resourcemanager-eventgrid/CHANGELOG.md

Large diffs are not rendered by default.

15 changes: 6 additions & 9 deletions sdk/eventgrid/azure-resourcemanager-eventgrid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Azure Resource Manager EventGrid client library for Java.

This package contains Microsoft Azure SDK for EventGrid Management SDK. Azure EventGrid Management Client. Package tag package-2024-06-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
This package contains Microsoft Azure SDK for EventGrid Management SDK. Azure EventGrid Management Client. Package tag package-2024-12-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

## We'd love to hear your feedback

Expand Down Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-eventgrid</artifactId>
<version>1.2.0-beta.6</version>
<version>1.2.0-beta.7</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand All @@ -45,15 +45,11 @@ Azure Management Libraries require a `TokenCredential` implementation for authen

### Authentication

By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables.
Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package.

- `AZURE_CLIENT_ID` for Azure client ID.
- `AZURE_TENANT_ID` for Azure tenant ID.
- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate.
Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable.

In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable.

With above configuration, `azure` client can be authenticated using the following code:
Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code:

```java
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
Expand Down Expand Up @@ -97,6 +93,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/
[azure_subscription]: https://azure.microsoft.com/free/
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity
[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials
[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty
[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md
[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md
Expand Down
865 changes: 648 additions & 217 deletions sdk/eventgrid/azure-resourcemanager-eventgrid/SAMPLE.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<packaging>jar</packaging>

<name>Microsoft Azure SDK for EventGrid Management</name>
<description>This package contains Microsoft Azure SDK for EventGrid Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure EventGrid Management Client. Package tag package-2024-06-preview.</description>
<description>This package contains Microsoft Azure SDK for EventGrid Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure EventGrid Management Client. Package tag package-2024-12-preview.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand Down Expand Up @@ -46,6 +46,7 @@
<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>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
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.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.core.http.policy.HttpPolicyProviders;
import com.azure.core.http.policy.RequestIdPolicy;
Expand All @@ -29,15 +29,15 @@
import com.azure.resourcemanager.eventgrid.implementation.ClientGroupsImpl;
import com.azure.resourcemanager.eventgrid.implementation.ClientsImpl;
import com.azure.resourcemanager.eventgrid.implementation.DomainEventSubscriptionsImpl;
import com.azure.resourcemanager.eventgrid.implementation.DomainsImpl;
import com.azure.resourcemanager.eventgrid.implementation.DomainTopicEventSubscriptionsImpl;
import com.azure.resourcemanager.eventgrid.implementation.DomainTopicsImpl;
import com.azure.resourcemanager.eventgrid.implementation.DomainsImpl;
import com.azure.resourcemanager.eventgrid.implementation.EventGridManagementClientBuilder;
import com.azure.resourcemanager.eventgrid.implementation.EventSubscriptionsImpl;
import com.azure.resourcemanager.eventgrid.implementation.ExtensionTopicsImpl;
import com.azure.resourcemanager.eventgrid.implementation.NamespacesImpl;
import com.azure.resourcemanager.eventgrid.implementation.NamespaceTopicEventSubscriptionsImpl;
import com.azure.resourcemanager.eventgrid.implementation.NamespaceTopicsImpl;
import com.azure.resourcemanager.eventgrid.implementation.NamespacesImpl;
import com.azure.resourcemanager.eventgrid.implementation.NetworkSecurityPerimeterConfigurationsImpl;
import com.azure.resourcemanager.eventgrid.implementation.OperationsImpl;
import com.azure.resourcemanager.eventgrid.implementation.PartnerConfigurationsImpl;
Expand All @@ -52,23 +52,23 @@
import com.azure.resourcemanager.eventgrid.implementation.SystemTopicEventSubscriptionsImpl;
import com.azure.resourcemanager.eventgrid.implementation.SystemTopicsImpl;
import com.azure.resourcemanager.eventgrid.implementation.TopicEventSubscriptionsImpl;
import com.azure.resourcemanager.eventgrid.implementation.TopicsImpl;
import com.azure.resourcemanager.eventgrid.implementation.TopicSpacesImpl;
import com.azure.resourcemanager.eventgrid.implementation.TopicTypesImpl;
import com.azure.resourcemanager.eventgrid.implementation.TopicsImpl;
import com.azure.resourcemanager.eventgrid.implementation.VerifiedPartnersImpl;
import com.azure.resourcemanager.eventgrid.models.CaCertificates;
import com.azure.resourcemanager.eventgrid.models.Channels;
import com.azure.resourcemanager.eventgrid.models.ClientGroups;
import com.azure.resourcemanager.eventgrid.models.Clients;
import com.azure.resourcemanager.eventgrid.models.DomainEventSubscriptions;
import com.azure.resourcemanager.eventgrid.models.Domains;
import com.azure.resourcemanager.eventgrid.models.DomainTopicEventSubscriptions;
import com.azure.resourcemanager.eventgrid.models.DomainTopics;
import com.azure.resourcemanager.eventgrid.models.Domains;
import com.azure.resourcemanager.eventgrid.models.EventSubscriptions;
import com.azure.resourcemanager.eventgrid.models.ExtensionTopics;
import com.azure.resourcemanager.eventgrid.models.Namespaces;
import com.azure.resourcemanager.eventgrid.models.NamespaceTopicEventSubscriptions;
import com.azure.resourcemanager.eventgrid.models.NamespaceTopics;
import com.azure.resourcemanager.eventgrid.models.Namespaces;
import com.azure.resourcemanager.eventgrid.models.NetworkSecurityPerimeterConfigurations;
import com.azure.resourcemanager.eventgrid.models.Operations;
import com.azure.resourcemanager.eventgrid.models.PartnerConfigurations;
Expand All @@ -83,9 +83,9 @@
import com.azure.resourcemanager.eventgrid.models.SystemTopicEventSubscriptions;
import com.azure.resourcemanager.eventgrid.models.SystemTopics;
import com.azure.resourcemanager.eventgrid.models.TopicEventSubscriptions;
import com.azure.resourcemanager.eventgrid.models.Topics;
import com.azure.resourcemanager.eventgrid.models.TopicSpaces;
import com.azure.resourcemanager.eventgrid.models.TopicTypes;
import com.azure.resourcemanager.eventgrid.models.Topics;
import com.azure.resourcemanager.eventgrid.models.VerifiedPartners;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
Expand Down Expand Up @@ -325,7 +325,7 @@ public EventGridManager authenticate(TokenCredential credential, AzureProfile pr
.append("-")
.append("com.azure.resourcemanager.eventgrid")
.append("/")
.append("1.2.0-beta.6");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder.append(" (")
.append(Configuration.getGlobalConfiguration().get("java.version"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,28 @@
package com.azure.resourcemanager.eventgrid.fluent.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
* Properties of an Azure Active Directory Partner Client Authentication.
*/
@Fluent
public final class AzureADPartnerClientAuthenticationProperties {
public final class AzureADPartnerClientAuthenticationProperties
implements JsonSerializable<AzureADPartnerClientAuthenticationProperties> {
/*
* The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests.
* The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in
* delivery requests.
*/
@JsonProperty(value = "azureActiveDirectoryTenantId")
private String azureActiveDirectoryTenantId;

/*
* The Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in delivery requests.
* The Azure Active Directory Application ID or URI to get the access token that will be included as the bearer
* token in delivery requests.
*/
@JsonProperty(value = "azureActiveDirectoryApplicationIdOrUri")
private String azureActiveDirectoryApplicationIdOrUri;

/**
Expand Down Expand Up @@ -83,4 +88,47 @@ public String azureActiveDirectoryApplicationIdOrUri() {
*/
public void validate() {
}

/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("azureActiveDirectoryTenantId", this.azureActiveDirectoryTenantId);
jsonWriter.writeStringField("azureActiveDirectoryApplicationIdOrUri",
this.azureActiveDirectoryApplicationIdOrUri);
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of AzureADPartnerClientAuthenticationProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AzureADPartnerClientAuthenticationProperties if the JsonReader was pointing to an instance
* of it, or null if it was pointing to JSON null.
* @throws IOException If an error occurs while reading the AzureADPartnerClientAuthenticationProperties.
*/
public static AzureADPartnerClientAuthenticationProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
AzureADPartnerClientAuthenticationProperties deserializedAzureADPartnerClientAuthenticationProperties
= new AzureADPartnerClientAuthenticationProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();

if ("azureActiveDirectoryTenantId".equals(fieldName)) {
deserializedAzureADPartnerClientAuthenticationProperties.azureActiveDirectoryTenantId
= reader.getString();
} else if ("azureActiveDirectoryApplicationIdOrUri".equals(fieldName)) {
deserializedAzureADPartnerClientAuthenticationProperties.azureActiveDirectoryApplicationIdOrUri
= reader.getString();
} else {
reader.skipChildren();
}
}

return deserializedAzureADPartnerClientAuthenticationProperties;
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,38 @@
package com.azure.resourcemanager.eventgrid.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeMapping;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.IOException;
import java.util.List;

/**
* The properties that represent the Azure Function destination of an event subscription.
*/
@Fluent
public final class AzureFunctionEventSubscriptionDestinationProperties {
public final class AzureFunctionEventSubscriptionDestinationProperties
implements JsonSerializable<AzureFunctionEventSubscriptionDestinationProperties> {
/*
* The Azure Resource Id that represents the endpoint of the Azure Function destination of an event subscription.
*/
@JsonProperty(value = "resourceId")
private String resourceId;

/*
* Maximum number of events per batch.
*/
@JsonProperty(value = "maxEventsPerBatch")
private Integer maxEventsPerBatch;

/*
* Preferred batch size in Kilobytes.
*/
@JsonProperty(value = "preferredBatchSizeInKilobytes")
private Integer preferredBatchSizeInKilobytes;

/*
* Delivery attribute details.
*/
@JsonProperty(value = "deliveryAttributeMappings")
private List<DeliveryAttributeMapping> deliveryAttributeMappings;

/**
Expand Down Expand Up @@ -138,4 +139,57 @@ public void validate() {
deliveryAttributeMappings().forEach(e -> e.validate());
}
}

/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("resourceId", this.resourceId);
jsonWriter.writeNumberField("maxEventsPerBatch", this.maxEventsPerBatch);
jsonWriter.writeNumberField("preferredBatchSizeInKilobytes", this.preferredBatchSizeInKilobytes);
jsonWriter.writeArrayField("deliveryAttributeMappings", this.deliveryAttributeMappings,
(writer, element) -> writer.writeJson(element));
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of AzureFunctionEventSubscriptionDestinationProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AzureFunctionEventSubscriptionDestinationProperties if the JsonReader was pointing to an
* instance of it, or null if it was pointing to JSON null.
* @throws IOException If an error occurs while reading the AzureFunctionEventSubscriptionDestinationProperties.
*/
public static AzureFunctionEventSubscriptionDestinationProperties fromJson(JsonReader jsonReader)
throws IOException {
return jsonReader.readObject(reader -> {
AzureFunctionEventSubscriptionDestinationProperties deserializedAzureFunctionEventSubscriptionDestinationProperties
= new AzureFunctionEventSubscriptionDestinationProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();

if ("resourceId".equals(fieldName)) {
deserializedAzureFunctionEventSubscriptionDestinationProperties.resourceId = reader.getString();
} else if ("maxEventsPerBatch".equals(fieldName)) {
deserializedAzureFunctionEventSubscriptionDestinationProperties.maxEventsPerBatch
= reader.getNullable(JsonReader::getInt);
} else if ("preferredBatchSizeInKilobytes".equals(fieldName)) {
deserializedAzureFunctionEventSubscriptionDestinationProperties.preferredBatchSizeInKilobytes
= reader.getNullable(JsonReader::getInt);
} else if ("deliveryAttributeMappings".equals(fieldName)) {
List<DeliveryAttributeMapping> deliveryAttributeMappings
= reader.readArray(reader1 -> DeliveryAttributeMapping.fromJson(reader1));
deserializedAzureFunctionEventSubscriptionDestinationProperties.deliveryAttributeMappings
= deliveryAttributeMappings;
} else {
reader.skipChildren();
}
}

return deserializedAzureFunctionEventSubscriptionDestinationProperties;
});
}
}
Loading

0 comments on commit 1382511

Please sign in to comment.