diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/CHANGELOG.md b/sdk/eventgrid/azure-resourcemanager-eventgrid/CHANGELOG.md index f100b8e9b5dd..dc697019e024 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/CHANGELOG.md +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.1.0-beta.4 (Unreleased) +## 1.0.0-beta.1 (2021-10-20) + +- 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-2021-12. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/README.md b/sdk/eventgrid/azure-resourcemanager-eventgrid/README.md index 2bfde3cb6768..d07e907209cd 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/README.md +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-eventgrid - 1.1.0-beta.3 + 1.1.0-beta.4 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/SAMPLE.md b/sdk/eventgrid/azure-resourcemanager-eventgrid/SAMPLE.md index c82b5d249f40..e5c56120bd6b 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/SAMPLE.md +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/SAMPLE.md @@ -38,6 +38,10 @@ - [ListRegionalBySubscriptionForTopicType](#eventsubscriptions_listregionalbysubscriptionfortopictype) - [Update](#eventsubscriptions_update) +## ExtensionTopics + +- [Get](#extensiontopics_get) + ## Operations - [List](#operations_list) @@ -1233,6 +1237,31 @@ public final class EventSubscriptionsUpdateSamples { } ``` +### ExtensionTopics_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ExtensionTopics Get. */ +public final class ExtensionTopicsGetSamples { + /* + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/ExtensionTopics_Get.json + */ + /** + * Sample code: ExtensionTopics_Get. + * + * @param manager Entry point to EventGridManager. + */ + public static void extensionTopicsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager + .extensionTopics() + .getWithResponse( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.storage/storageaccounts/exampleResourceName/providers/Microsoft.eventgrid/extensionTopics/default", + Context.NONE); + } +} +``` + ### Operations_List ```java diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml b/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml index 05639ef5315c..96f23c1a9709 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml @@ -97,8 +97,6 @@ revapi-maven-plugin 0.11.2 - true - diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/EventGridManager.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/EventGridManager.java index e1b2e12d6c57..3aba612ee57c 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/EventGridManager.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/EventGridManager.java @@ -25,6 +25,7 @@ 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.OperationsImpl; import com.azure.resourcemanager.eventgrid.implementation.PrivateEndpointConnectionsImpl; import com.azure.resourcemanager.eventgrid.implementation.PrivateLinkResourcesImpl; @@ -35,6 +36,7 @@ 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.Operations; import com.azure.resourcemanager.eventgrid.models.PrivateEndpointConnections; import com.azure.resourcemanager.eventgrid.models.PrivateLinkResources; @@ -68,6 +70,8 @@ public final class EventGridManager { private SystemTopics systemTopics; + private ExtensionTopics extensionTopics; + private TopicTypes topicTypes; private final EventGridManagementClient clientObject; @@ -206,7 +210,7 @@ public EventGridManager authenticate(TokenCredential credential, AzureProfile pr .append("-") .append("com.azure.resourcemanager.eventgrid") .append("/") - .append("1.1.0-beta.3"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -319,6 +323,14 @@ public SystemTopics systemTopics() { return systemTopics; } + /** @return Resource collection API of ExtensionTopics. */ + public ExtensionTopics extensionTopics() { + if (this.extensionTopics == null) { + this.extensionTopics = new ExtensionTopicsImpl(clientObject.getExtensionTopics(), this); + } + return extensionTopics; + } + /** @return Resource collection API of TopicTypes. */ public TopicTypes topicTypes() { if (this.topicTypes == null) { diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/EventGridManagementClient.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/EventGridManagementClient.java index 65fe0a455bc0..0d87b87ec6f6 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/EventGridManagementClient.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/EventGridManagementClient.java @@ -108,6 +108,13 @@ public interface EventGridManagementClient { */ SystemTopicsClient getSystemTopics(); + /** + * Gets the ExtensionTopicsClient object to access its operations. + * + * @return the ExtensionTopicsClient object. + */ + ExtensionTopicsClient getExtensionTopics(); + /** * Gets the TopicTypesClient object to access its operations. * diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/ExtensionTopicsClient.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/ExtensionTopicsClient.java new file mode 100644 index 000000000000..49da41e827f0 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/ExtensionTopicsClient.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventgrid.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventgrid.fluent.models.ExtensionTopicInner; + +/** An instance of this class provides access to all the operations defined in ExtensionTopicsClient. */ +public interface ExtensionTopicsClient { + /** + * Get the properties of an extension topic. + * + * @param scope The identifier of the resource to which extension topic is queried. The scope can be a subscription, + * or a resource group, or a top level resource belonging to a resource provider namespace. For example, use + * '/subscriptions/{subscriptionId}/' for a subscription, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + * for Azure resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an extension topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtensionTopicInner get(String scope); + + /** + * Get the properties of an extension topic. + * + * @param scope The identifier of the resource to which extension topic is queried. The scope can be a subscription, + * or a resource group, or a top level resource belonging to a resource provider namespace. For example, use + * '/subscriptions/{subscriptionId}/' for a subscription, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + * for Azure resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an extension topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String scope, Context context); +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/EventSubscriptionInner.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/EventSubscriptionInner.java index 79fa871dfaa7..15ffbf94870c 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/EventSubscriptionInner.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/EventSubscriptionInner.java @@ -9,6 +9,8 @@ import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.eventgrid.models.DeadLetterDestination; +import com.azure.resourcemanager.eventgrid.models.DeadLetterWithResourceIdentity; +import com.azure.resourcemanager.eventgrid.models.DeliveryWithResourceIdentity; import com.azure.resourcemanager.eventgrid.models.EventDeliverySchema; import com.azure.resourcemanager.eventgrid.models.EventSubscriptionDestination; import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; @@ -97,6 +99,34 @@ public EventSubscriptionInner withDestination(EventSubscriptionDestination desti return this; } + /** + * Get the deliveryWithResourceIdentity property: Information about the destination where events have to be + * delivered for the event subscription. Uses the managed identity setup on the parent resource (namely, topic or + * domain) to acquire the authentication tokens being used during delivery / dead-lettering. + * + * @return the deliveryWithResourceIdentity value. + */ + public DeliveryWithResourceIdentity deliveryWithResourceIdentity() { + return this.innerProperties() == null ? null : this.innerProperties().deliveryWithResourceIdentity(); + } + + /** + * Set the deliveryWithResourceIdentity property: Information about the destination where events have to be + * delivered for the event subscription. Uses the managed identity setup on the parent resource (namely, topic or + * domain) to acquire the authentication tokens being used during delivery / dead-lettering. + * + * @param deliveryWithResourceIdentity the deliveryWithResourceIdentity value to set. + * @return the EventSubscriptionInner object itself. + */ + public EventSubscriptionInner withDeliveryWithResourceIdentity( + DeliveryWithResourceIdentity deliveryWithResourceIdentity) { + if (this.innerProperties() == null) { + this.innerProperties = new EventSubscriptionProperties(); + } + this.innerProperties().withDeliveryWithResourceIdentity(deliveryWithResourceIdentity); + return this; + } + /** * Get the filter property: Information about the filter for the event subscription. * @@ -237,6 +267,36 @@ public EventSubscriptionInner withDeadLetterDestination(DeadLetterDestination de return this; } + /** + * Get the deadLetterWithResourceIdentity property: The dead letter destination of the event subscription. Any event + * that cannot be delivered to its' destination is sent to the dead letter destination. Uses the managed identity + * setup on the parent resource (namely, topic or domain) to acquire the authentication tokens being used during + * delivery / dead-lettering. + * + * @return the deadLetterWithResourceIdentity value. + */ + public DeadLetterWithResourceIdentity deadLetterWithResourceIdentity() { + return this.innerProperties() == null ? null : this.innerProperties().deadLetterWithResourceIdentity(); + } + + /** + * Set the deadLetterWithResourceIdentity property: The dead letter destination of the event subscription. Any event + * that cannot be delivered to its' destination is sent to the dead letter destination. Uses the managed identity + * setup on the parent resource (namely, topic or domain) to acquire the authentication tokens being used during + * delivery / dead-lettering. + * + * @param deadLetterWithResourceIdentity the deadLetterWithResourceIdentity value to set. + * @return the EventSubscriptionInner object itself. + */ + public EventSubscriptionInner withDeadLetterWithResourceIdentity( + DeadLetterWithResourceIdentity deadLetterWithResourceIdentity) { + if (this.innerProperties() == null) { + this.innerProperties = new EventSubscriptionProperties(); + } + this.innerProperties().withDeadLetterWithResourceIdentity(deadLetterWithResourceIdentity); + return this; + } + /** * Validates the instance. * diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/EventSubscriptionProperties.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/EventSubscriptionProperties.java index e83289964684..af1b492a4201 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/EventSubscriptionProperties.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/EventSubscriptionProperties.java @@ -7,6 +7,8 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.eventgrid.models.DeadLetterDestination; +import com.azure.resourcemanager.eventgrid.models.DeadLetterWithResourceIdentity; +import com.azure.resourcemanager.eventgrid.models.DeliveryWithResourceIdentity; import com.azure.resourcemanager.eventgrid.models.EventDeliverySchema; import com.azure.resourcemanager.eventgrid.models.EventSubscriptionDestination; import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; @@ -41,6 +43,16 @@ public final class EventSubscriptionProperties { @JsonProperty(value = "destination") private EventSubscriptionDestination destination; + /* + * Information about the destination where events have to be delivered for + * the event subscription. + * Uses the managed identity setup on the parent resource (namely, topic or + * domain) to acquire the authentication tokens being used during delivery + * / dead-lettering. + */ + @JsonProperty(value = "deliveryWithResourceIdentity") + private DeliveryWithResourceIdentity deliveryWithResourceIdentity; + /* * Information about the filter for the event subscription. */ @@ -78,6 +90,17 @@ public final class EventSubscriptionProperties { @JsonProperty(value = "deadLetterDestination") private DeadLetterDestination deadLetterDestination; + /* + * The dead letter destination of the event subscription. Any event that + * cannot be delivered to its' destination is sent to the dead letter + * destination. + * Uses the managed identity setup on the parent resource (namely, topic or + * domain) to acquire the authentication tokens being used during delivery + * / dead-lettering. + */ + @JsonProperty(value = "deadLetterWithResourceIdentity") + private DeadLetterWithResourceIdentity deadLetterWithResourceIdentity; + /** * Get the topic property: Name of the topic of the event subscription. * @@ -118,6 +141,31 @@ public EventSubscriptionProperties withDestination(EventSubscriptionDestination return this; } + /** + * Get the deliveryWithResourceIdentity property: Information about the destination where events have to be + * delivered for the event subscription. Uses the managed identity setup on the parent resource (namely, topic or + * domain) to acquire the authentication tokens being used during delivery / dead-lettering. + * + * @return the deliveryWithResourceIdentity value. + */ + public DeliveryWithResourceIdentity deliveryWithResourceIdentity() { + return this.deliveryWithResourceIdentity; + } + + /** + * Set the deliveryWithResourceIdentity property: Information about the destination where events have to be + * delivered for the event subscription. Uses the managed identity setup on the parent resource (namely, topic or + * domain) to acquire the authentication tokens being used during delivery / dead-lettering. + * + * @param deliveryWithResourceIdentity the deliveryWithResourceIdentity value to set. + * @return the EventSubscriptionProperties object itself. + */ + public EventSubscriptionProperties withDeliveryWithResourceIdentity( + DeliveryWithResourceIdentity deliveryWithResourceIdentity) { + this.deliveryWithResourceIdentity = deliveryWithResourceIdentity; + return this; + } + /** * Get the filter property: Information about the filter for the event subscription. * @@ -240,6 +288,33 @@ public EventSubscriptionProperties withDeadLetterDestination(DeadLetterDestinati return this; } + /** + * Get the deadLetterWithResourceIdentity property: The dead letter destination of the event subscription. Any event + * that cannot be delivered to its' destination is sent to the dead letter destination. Uses the managed identity + * setup on the parent resource (namely, topic or domain) to acquire the authentication tokens being used during + * delivery / dead-lettering. + * + * @return the deadLetterWithResourceIdentity value. + */ + public DeadLetterWithResourceIdentity deadLetterWithResourceIdentity() { + return this.deadLetterWithResourceIdentity; + } + + /** + * Set the deadLetterWithResourceIdentity property: The dead letter destination of the event subscription. Any event + * that cannot be delivered to its' destination is sent to the dead letter destination. Uses the managed identity + * setup on the parent resource (namely, topic or domain) to acquire the authentication tokens being used during + * delivery / dead-lettering. + * + * @param deadLetterWithResourceIdentity the deadLetterWithResourceIdentity value to set. + * @return the EventSubscriptionProperties object itself. + */ + public EventSubscriptionProperties withDeadLetterWithResourceIdentity( + DeadLetterWithResourceIdentity deadLetterWithResourceIdentity) { + this.deadLetterWithResourceIdentity = deadLetterWithResourceIdentity; + return this; + } + /** * Validates the instance. * @@ -249,6 +324,9 @@ public void validate() { if (destination() != null) { destination().validate(); } + if (deliveryWithResourceIdentity() != null) { + deliveryWithResourceIdentity().validate(); + } if (filter() != null) { filter().validate(); } @@ -258,5 +336,8 @@ public void validate() { if (deadLetterDestination() != null) { deadLetterDestination().validate(); } + if (deadLetterWithResourceIdentity() != null) { + deadLetterWithResourceIdentity().validate(); + } } } diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/ExtensionTopicInner.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/ExtensionTopicInner.java new file mode 100644 index 000000000000..f0188b58abdd --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/ExtensionTopicInner.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventgrid.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Event grid Extension Topic. This is used for getting Event Grid related metrics for Azure resources. */ +@Fluent +public final class ExtensionTopicInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtensionTopicInner.class); + + /* + * Properties of the extension topic + */ + @JsonProperty(value = "properties") + private ExtensionTopicProperties innerProperties; + + /* + * The system metadata relating to the Extension Topic resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Properties of the extension topic. + * + * @return the innerProperties value. + */ + private ExtensionTopicProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: The system metadata relating to the Extension Topic resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the description property: Description of the extension topic. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: Description of the extension topic. + * + * @param description the description value to set. + * @return the ExtensionTopicInner object itself. + */ + public ExtensionTopicInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new ExtensionTopicProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the systemTopic property: System topic resource id which is mapped to the source. + * + * @return the systemTopic value. + */ + public String systemTopic() { + return this.innerProperties() == null ? null : this.innerProperties().systemTopic(); + } + + /** + * Set the systemTopic property: System topic resource id which is mapped to the source. + * + * @param systemTopic the systemTopic value to set. + * @return the ExtensionTopicInner object itself. + */ + public ExtensionTopicInner withSystemTopic(String systemTopic) { + if (this.innerProperties() == null) { + this.innerProperties = new ExtensionTopicProperties(); + } + this.innerProperties().withSystemTopic(systemTopic); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/ExtensionTopicProperties.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/ExtensionTopicProperties.java new file mode 100644 index 000000000000..2fb7ee848e98 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/ExtensionTopicProperties.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventgrid.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the Extension Topic. */ +@Fluent +public final class ExtensionTopicProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtensionTopicProperties.class); + + /* + * Description of the extension topic. + */ + @JsonProperty(value = "description") + private String description; + + /* + * System topic resource id which is mapped to the source. + */ + @JsonProperty(value = "systemTopic") + private String systemTopic; + + /** + * Get the description property: Description of the extension topic. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Description of the extension topic. + * + * @param description the description value to set. + * @return the ExtensionTopicProperties object itself. + */ + public ExtensionTopicProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the systemTopic property: System topic resource id which is mapped to the source. + * + * @return the systemTopic value. + */ + public String systemTopic() { + return this.systemTopic; + } + + /** + * Set the systemTopic property: System topic resource id which is mapped to the source. + * + * @param systemTopic the systemTopic value to set. + * @return the ExtensionTopicProperties object itself. + */ + public ExtensionTopicProperties withSystemTopic(String systemTopic) { + this.systemTopic = systemTopic; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/TopicInner.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/TopicInner.java index de0eab5106d6..3440e60dc5bc 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/TopicInner.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/TopicInner.java @@ -8,6 +8,7 @@ import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.eventgrid.models.IdentityInfo; import com.azure.resourcemanager.eventgrid.models.InboundIpRule; import com.azure.resourcemanager.eventgrid.models.InputSchema; import com.azure.resourcemanager.eventgrid.models.InputSchemaMapping; @@ -29,6 +30,12 @@ public final class TopicInner extends Resource { @JsonProperty(value = "properties") private TopicProperties innerProperties; + /* + * Identity information for the resource. + */ + @JsonProperty(value = "identity") + private IdentityInfo identity; + /* * The system metadata relating to Topic resource. */ @@ -44,6 +51,26 @@ private TopicProperties innerProperties() { return this.innerProperties; } + /** + * Get the identity property: Identity information for the resource. + * + * @return the identity value. + */ + public IdentityInfo identity() { + return this.identity; + } + + /** + * Set the identity property: Identity information for the resource. + * + * @param identity the identity value to set. + * @return the TopicInner object itself. + */ + public TopicInner withIdentity(IdentityInfo identity) { + this.identity = identity; + return this; + } + /** * Get the systemData property: The system metadata relating to Topic resource. * @@ -243,5 +270,8 @@ public void validate() { if (innerProperties() != null) { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } } diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventGridManagementClientImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventGridManagementClientImpl.java index bc2fd551a098..a30c78ef65a2 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventGridManagementClientImpl.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventGridManagementClientImpl.java @@ -25,6 +25,7 @@ import com.azure.resourcemanager.eventgrid.fluent.DomainsClient; import com.azure.resourcemanager.eventgrid.fluent.EventGridManagementClient; import com.azure.resourcemanager.eventgrid.fluent.EventSubscriptionsClient; +import com.azure.resourcemanager.eventgrid.fluent.ExtensionTopicsClient; import com.azure.resourcemanager.eventgrid.fluent.OperationsClient; import com.azure.resourcemanager.eventgrid.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.eventgrid.fluent.PrivateLinkResourcesClient; @@ -231,6 +232,18 @@ public SystemTopicsClient getSystemTopics() { return this.systemTopics; } + /** The ExtensionTopicsClient object to access its operations. */ + private final ExtensionTopicsClient extensionTopics; + + /** + * Gets the ExtensionTopicsClient object to access its operations. + * + * @return the ExtensionTopicsClient object. + */ + public ExtensionTopicsClient getExtensionTopics() { + return this.extensionTopics; + } + /** The TopicTypesClient object to access its operations. */ private final TopicTypesClient topicTypes; @@ -276,6 +289,7 @@ public TopicTypesClient getTopicTypes() { this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); this.systemTopics = new SystemTopicsClientImpl(this); + this.extensionTopics = new ExtensionTopicsClientImpl(this); this.topicTypes = new TopicTypesClientImpl(this); } diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventSubscriptionImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventSubscriptionImpl.java index b30ccda3987e..8b141b6ed28c 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventSubscriptionImpl.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventSubscriptionImpl.java @@ -9,7 +9,9 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner; import com.azure.resourcemanager.eventgrid.models.DeadLetterDestination; +import com.azure.resourcemanager.eventgrid.models.DeadLetterWithResourceIdentity; import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeListResult; +import com.azure.resourcemanager.eventgrid.models.DeliveryWithResourceIdentity; import com.azure.resourcemanager.eventgrid.models.EventDeliverySchema; import com.azure.resourcemanager.eventgrid.models.EventSubscription; import com.azure.resourcemanager.eventgrid.models.EventSubscriptionDestination; @@ -56,6 +58,10 @@ public EventSubscriptionDestination destination() { return this.innerModel().destination(); } + public DeliveryWithResourceIdentity deliveryWithResourceIdentity() { + return this.innerModel().deliveryWithResourceIdentity(); + } + public EventSubscriptionFilter filter() { return this.innerModel().filter(); } @@ -85,6 +91,10 @@ public DeadLetterDestination deadLetterDestination() { return this.innerModel().deadLetterDestination(); } + public DeadLetterWithResourceIdentity deadLetterWithResourceIdentity() { + return this.innerModel().deadLetterWithResourceIdentity(); + } + public EventSubscriptionInner innerModel() { return this.innerObject; } @@ -217,6 +227,17 @@ public EventSubscriptionImpl withDestination(EventSubscriptionDestination destin } } + public EventSubscriptionImpl withDeliveryWithResourceIdentity( + DeliveryWithResourceIdentity deliveryWithResourceIdentity) { + if (isInCreateMode()) { + this.innerModel().withDeliveryWithResourceIdentity(deliveryWithResourceIdentity); + return this; + } else { + this.updateEventSubscriptionUpdateParameters.withDeliveryWithResourceIdentity(deliveryWithResourceIdentity); + return this; + } + } + public EventSubscriptionImpl withFilter(EventSubscriptionFilter filter) { if (isInCreateMode()) { this.innerModel().withFilter(filter); @@ -277,6 +298,19 @@ public EventSubscriptionImpl withDeadLetterDestination(DeadLetterDestination dea } } + public EventSubscriptionImpl withDeadLetterWithResourceIdentity( + DeadLetterWithResourceIdentity deadLetterWithResourceIdentity) { + if (isInCreateMode()) { + this.innerModel().withDeadLetterWithResourceIdentity(deadLetterWithResourceIdentity); + return this; + } else { + this + .updateEventSubscriptionUpdateParameters + .withDeadLetterWithResourceIdentity(deadLetterWithResourceIdentity); + return this; + } + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/ExtensionTopicImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/ExtensionTopicImpl.java new file mode 100644 index 000000000000..1afdde46a222 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/ExtensionTopicImpl.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventgrid.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.eventgrid.fluent.models.ExtensionTopicInner; +import com.azure.resourcemanager.eventgrid.models.ExtensionTopic; + +public final class ExtensionTopicImpl implements ExtensionTopic { + private ExtensionTopicInner innerObject; + + private final com.azure.resourcemanager.eventgrid.EventGridManager serviceManager; + + ExtensionTopicImpl( + ExtensionTopicInner innerObject, com.azure.resourcemanager.eventgrid.EventGridManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String description() { + return this.innerModel().description(); + } + + public String systemTopic() { + return this.innerModel().systemTopic(); + } + + public ExtensionTopicInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.eventgrid.EventGridManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/ExtensionTopicsClientImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/ExtensionTopicsClientImpl.java new file mode 100644 index 000000000000..ed08707601a3 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/ExtensionTopicsClientImpl.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventgrid.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.eventgrid.fluent.ExtensionTopicsClient; +import com.azure.resourcemanager.eventgrid.fluent.models.ExtensionTopicInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExtensionTopicsClient. */ +public final class ExtensionTopicsClientImpl implements ExtensionTopicsClient { + private final ClientLogger logger = new ClientLogger(ExtensionTopicsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExtensionTopicsService service; + + /** The service client containing this operation class. */ + private final EventGridManagementClientImpl client; + + /** + * Initializes an instance of ExtensionTopicsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExtensionTopicsClientImpl(EventGridManagementClientImpl client) { + this.service = + RestProxy.create(ExtensionTopicsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EventGridManagementClientExtensionTopics to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EventGridManagementC") + private interface ExtensionTopicsService { + @Headers({"Content-Type: application/json"}) + @Get("/{scope}/providers/Microsoft.EventGrid/extensionTopics/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("scope") String scope, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the properties of an extension topic. + * + * @param scope The identifier of the resource to which extension topic is queried. The scope can be a subscription, + * or a resource group, or a top level resource belonging to a resource provider namespace. For example, use + * '/subscriptions/{subscriptionId}/' for a subscription, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + * for Azure resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an extension topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String scope) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.get(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the properties of an extension topic. + * + * @param scope The identifier of the resource to which extension topic is queried. The scope can be a subscription, + * or a resource group, or a top level resource belonging to a resource provider namespace. For example, use + * '/subscriptions/{subscriptionId}/' for a subscription, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + * for Azure resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an extension topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String scope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (scope == null) { + return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context); + } + + /** + * Get the properties of an extension topic. + * + * @param scope The identifier of the resource to which extension topic is queried. The scope can be a subscription, + * or a resource group, or a top level resource belonging to a resource provider namespace. For example, use + * '/subscriptions/{subscriptionId}/' for a subscription, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + * for Azure resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an extension topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String scope) { + return getWithResponseAsync(scope) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the properties of an extension topic. + * + * @param scope The identifier of the resource to which extension topic is queried. The scope can be a subscription, + * or a resource group, or a top level resource belonging to a resource provider namespace. For example, use + * '/subscriptions/{subscriptionId}/' for a subscription, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + * for Azure resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an extension topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtensionTopicInner get(String scope) { + return getAsync(scope).block(); + } + + /** + * Get the properties of an extension topic. + * + * @param scope The identifier of the resource to which extension topic is queried. The scope can be a subscription, + * or a resource group, or a top level resource belonging to a resource provider namespace. For example, use + * '/subscriptions/{subscriptionId}/' for a subscription, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + * for Azure resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an extension topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String scope, Context context) { + return getWithResponseAsync(scope, context).block(); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/ExtensionTopicsImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/ExtensionTopicsImpl.java new file mode 100644 index 000000000000..653a26805381 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/ExtensionTopicsImpl.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventgrid.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.eventgrid.fluent.ExtensionTopicsClient; +import com.azure.resourcemanager.eventgrid.fluent.models.ExtensionTopicInner; +import com.azure.resourcemanager.eventgrid.models.ExtensionTopic; +import com.azure.resourcemanager.eventgrid.models.ExtensionTopics; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExtensionTopicsImpl implements ExtensionTopics { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtensionTopicsImpl.class); + + private final ExtensionTopicsClient innerClient; + + private final com.azure.resourcemanager.eventgrid.EventGridManager serviceManager; + + public ExtensionTopicsImpl( + ExtensionTopicsClient innerClient, com.azure.resourcemanager.eventgrid.EventGridManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ExtensionTopic get(String scope) { + ExtensionTopicInner inner = this.serviceClient().get(scope); + if (inner != null) { + return new ExtensionTopicImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse(String scope, Context context) { + Response inner = this.serviceClient().getWithResponse(scope, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExtensionTopicImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ExtensionTopicsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.eventgrid.EventGridManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/TopicImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/TopicImpl.java index 993444550611..586c118c9fca 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/TopicImpl.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/TopicImpl.java @@ -10,6 +10,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.eventgrid.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.eventgrid.fluent.models.TopicInner; +import com.azure.resourcemanager.eventgrid.models.IdentityInfo; import com.azure.resourcemanager.eventgrid.models.InboundIpRule; import com.azure.resourcemanager.eventgrid.models.InputSchema; import com.azure.resourcemanager.eventgrid.models.InputSchemaMapping; @@ -55,6 +56,10 @@ public Map tags() { } } + public IdentityInfo identity() { + return this.innerModel().identity(); + } + public SystemData systemData() { return this.innerModel().systemData(); } @@ -247,6 +252,16 @@ public TopicImpl withTags(Map tags) { } } + public TopicImpl withIdentity(IdentityInfo identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateTopicUpdateParameters.withIdentity(identity); + return this; + } + } + public TopicImpl withInputSchema(InputSchema inputSchema) { this.innerModel().withInputSchema(inputSchema); return this; diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DeadLetterWithResourceIdentity.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DeadLetterWithResourceIdentity.java new file mode 100644 index 000000000000..2f85f5867161 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DeadLetterWithResourceIdentity.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventgrid.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Information about the deadletter destination with resource identity. */ +@Fluent +public class DeadLetterWithResourceIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeadLetterWithResourceIdentity.class); + + /* + * The identity to use when dead-lettering events. + */ + @JsonProperty(value = "identity") + private EventSubscriptionIdentity identity; + + /* + * Information about the destination where events have to be delivered for + * the event subscription. + * Uses the managed identity setup on the parent resource (namely, topic or + * domain) to acquire the authentication tokens being used during delivery + * / dead-lettering. + */ + @JsonProperty(value = "deadLetterDestination") + private DeadLetterDestination deadLetterDestination; + + /** + * Get the identity property: The identity to use when dead-lettering events. + * + * @return the identity value. + */ + public EventSubscriptionIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity to use when dead-lettering events. + * + * @param identity the identity value to set. + * @return the DeadLetterWithResourceIdentity object itself. + */ + public DeadLetterWithResourceIdentity withIdentity(EventSubscriptionIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the deadLetterDestination property: Information about the destination where events have to be delivered for + * the event subscription. Uses the managed identity setup on the parent resource (namely, topic or domain) to + * acquire the authentication tokens being used during delivery / dead-lettering. + * + * @return the deadLetterDestination value. + */ + public DeadLetterDestination deadLetterDestination() { + return this.deadLetterDestination; + } + + /** + * Set the deadLetterDestination property: Information about the destination where events have to be delivered for + * the event subscription. Uses the managed identity setup on the parent resource (namely, topic or domain) to + * acquire the authentication tokens being used during delivery / dead-lettering. + * + * @param deadLetterDestination the deadLetterDestination value to set. + * @return the DeadLetterWithResourceIdentity object itself. + */ + public DeadLetterWithResourceIdentity withDeadLetterDestination(DeadLetterDestination deadLetterDestination) { + this.deadLetterDestination = deadLetterDestination; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (deadLetterDestination() != null) { + deadLetterDestination().validate(); + } + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DeliveryWithResourceIdentity.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DeliveryWithResourceIdentity.java new file mode 100644 index 000000000000..c05c95383245 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DeliveryWithResourceIdentity.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventgrid.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Information about the delivery for an event subscription with resource identity. */ +@Fluent +public class DeliveryWithResourceIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryWithResourceIdentity.class); + + /* + * The identity to use when delivering events. + */ + @JsonProperty(value = "identity") + private EventSubscriptionIdentity identity; + + /* + * Information about the destination where events have to be delivered for + * the event subscription. + * Uses Azure Event Grid's identity to acquire the authentication tokens + * being used during delivery / dead-lettering. + */ + @JsonProperty(value = "destination") + private EventSubscriptionDestination destination; + + /** + * Get the identity property: The identity to use when delivering events. + * + * @return the identity value. + */ + public EventSubscriptionIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity to use when delivering events. + * + * @param identity the identity value to set. + * @return the DeliveryWithResourceIdentity object itself. + */ + public DeliveryWithResourceIdentity withIdentity(EventSubscriptionIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the destination property: Information about the destination where events have to be delivered for the event + * subscription. Uses Azure Event Grid's identity to acquire the authentication tokens being used during delivery / + * dead-lettering. + * + * @return the destination value. + */ + public EventSubscriptionDestination destination() { + return this.destination; + } + + /** + * Set the destination property: Information about the destination where events have to be delivered for the event + * subscription. Uses Azure Event Grid's identity to acquire the authentication tokens being used during delivery / + * dead-lettering. + * + * @param destination the destination value to set. + * @return the DeliveryWithResourceIdentity object itself. + */ + public DeliveryWithResourceIdentity withDestination(EventSubscriptionDestination destination) { + this.destination = destination; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (destination() != null) { + destination().validate(); + } + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventSubscription.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventSubscription.java index 52a4b975ef21..e62e5076019a 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventSubscription.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventSubscription.java @@ -63,6 +63,15 @@ public interface EventSubscription { */ EventSubscriptionDestination destination(); + /** + * Gets the deliveryWithResourceIdentity property: Information about the destination where events have to be + * delivered for the event subscription. Uses the managed identity setup on the parent resource (namely, topic or + * domain) to acquire the authentication tokens being used during delivery / dead-lettering. + * + * @return the deliveryWithResourceIdentity value. + */ + DeliveryWithResourceIdentity deliveryWithResourceIdentity(); + /** * Gets the filter property: Information about the filter for the event subscription. * @@ -106,6 +115,16 @@ public interface EventSubscription { */ DeadLetterDestination deadLetterDestination(); + /** + * Gets the deadLetterWithResourceIdentity property: The dead letter destination of the event subscription. Any + * event that cannot be delivered to its' destination is sent to the dead letter destination. Uses the managed + * identity setup on the parent resource (namely, topic or domain) to acquire the authentication tokens being used + * during delivery / dead-lettering. + * + * @return the deadLetterWithResourceIdentity value. + */ + DeadLetterWithResourceIdentity deadLetterWithResourceIdentity(); + /** * Gets the inner com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner object. * @@ -145,12 +164,14 @@ interface WithScope { */ interface WithCreate extends DefinitionStages.WithDestination, + DefinitionStages.WithDeliveryWithResourceIdentity, DefinitionStages.WithFilter, DefinitionStages.WithLabels, DefinitionStages.WithExpirationTimeUtc, DefinitionStages.WithEventDeliverySchema, DefinitionStages.WithRetryPolicy, - DefinitionStages.WithDeadLetterDestination { + DefinitionStages.WithDeadLetterDestination, + DefinitionStages.WithDeadLetterWithResourceIdentity { /** * Executes the create request. * @@ -178,6 +199,21 @@ interface WithDestination { */ WithCreate withDestination(EventSubscriptionDestination destination); } + /** The stage of the EventSubscription definition allowing to specify deliveryWithResourceIdentity. */ + interface WithDeliveryWithResourceIdentity { + /** + * Specifies the deliveryWithResourceIdentity property: Information about the destination where events have + * to be delivered for the event subscription. Uses the managed identity setup on the parent resource + * (namely, topic or domain) to acquire the authentication tokens being used during delivery / + * dead-lettering.. + * + * @param deliveryWithResourceIdentity Information about the destination where events have to be delivered + * for the event subscription. Uses the managed identity setup on the parent resource (namely, topic or + * domain) to acquire the authentication tokens being used during delivery / dead-lettering. + * @return the next definition stage. + */ + WithCreate withDeliveryWithResourceIdentity(DeliveryWithResourceIdentity deliveryWithResourceIdentity); + } /** The stage of the EventSubscription definition allowing to specify filter. */ interface WithFilter { /** @@ -240,6 +276,23 @@ interface WithDeadLetterDestination { */ WithCreate withDeadLetterDestination(DeadLetterDestination deadLetterDestination); } + /** The stage of the EventSubscription definition allowing to specify deadLetterWithResourceIdentity. */ + interface WithDeadLetterWithResourceIdentity { + /** + * Specifies the deadLetterWithResourceIdentity property: The dead letter destination of the event + * subscription. Any event that cannot be delivered to its' destination is sent to the dead letter + * destination. Uses the managed identity setup on the parent resource (namely, topic or domain) to acquire + * the authentication tokens being used during delivery / dead-lettering.. + * + * @param deadLetterWithResourceIdentity The dead letter destination of the event subscription. Any event + * that cannot be delivered to its' destination is sent to the dead letter destination. Uses the managed + * identity setup on the parent resource (namely, topic or domain) to acquire the authentication tokens + * being used during delivery / dead-lettering. + * @return the next definition stage. + */ + WithCreate withDeadLetterWithResourceIdentity( + DeadLetterWithResourceIdentity deadLetterWithResourceIdentity); + } } /** * Begins update for the EventSubscription resource. @@ -251,12 +304,14 @@ interface WithDeadLetterDestination { /** The template for EventSubscription update. */ interface Update extends UpdateStages.WithDestination, + UpdateStages.WithDeliveryWithResourceIdentity, UpdateStages.WithFilter, UpdateStages.WithLabels, UpdateStages.WithExpirationTimeUtc, UpdateStages.WithEventDeliverySchema, UpdateStages.WithRetryPolicy, - UpdateStages.WithDeadLetterDestination { + UpdateStages.WithDeadLetterDestination, + UpdateStages.WithDeadLetterWithResourceIdentity { /** * Executes the update request. * @@ -286,6 +341,20 @@ interface WithDestination { */ Update withDestination(EventSubscriptionDestination destination); } + /** The stage of the EventSubscription update allowing to specify deliveryWithResourceIdentity. */ + interface WithDeliveryWithResourceIdentity { + /** + * Specifies the deliveryWithResourceIdentity property: Information about the destination where events have + * to be delivered for the event subscription. Uses the managed identity setup on the parent resource (topic + * / domain) to acquire the authentication tokens being used during delivery / dead-lettering.. + * + * @param deliveryWithResourceIdentity Information about the destination where events have to be delivered + * for the event subscription. Uses the managed identity setup on the parent resource (topic / domain) + * to acquire the authentication tokens being used during delivery / dead-lettering. + * @return the next definition stage. + */ + Update withDeliveryWithResourceIdentity(DeliveryWithResourceIdentity deliveryWithResourceIdentity); + } /** The stage of the EventSubscription update allowing to specify filter. */ interface WithFilter { /** @@ -349,6 +418,22 @@ interface WithDeadLetterDestination { */ Update withDeadLetterDestination(DeadLetterDestination deadLetterDestination); } + /** The stage of the EventSubscription update allowing to specify deadLetterWithResourceIdentity. */ + interface WithDeadLetterWithResourceIdentity { + /** + * Specifies the deadLetterWithResourceIdentity property: The dead letter destination of the event + * subscription. Any event that cannot be delivered to its' destination is sent to the dead letter + * destination. Uses the managed identity setup on the parent resource (topic / domain) to acquire the + * authentication tokens being used during delivery / dead-lettering.. + * + * @param deadLetterWithResourceIdentity The dead letter destination of the event subscription. Any event + * that cannot be delivered to its' destination is sent to the dead letter destination. Uses the managed + * identity setup on the parent resource (topic / domain) to acquire the authentication tokens being + * used during delivery / dead-lettering. + * @return the next definition stage. + */ + Update withDeadLetterWithResourceIdentity(DeadLetterWithResourceIdentity deadLetterWithResourceIdentity); + } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventSubscriptionIdentity.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventSubscriptionIdentity.java new file mode 100644 index 000000000000..37f4e6cdb9c5 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventSubscriptionIdentity.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventgrid.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The identity information with the event subscription. */ +@Fluent +public class EventSubscriptionIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventSubscriptionIdentity.class); + + /* + * The type of managed identity used. The type 'SystemAssigned, + * UserAssigned' includes both an implicitly created identity and a set of + * user-assigned identities. The type 'None' will remove any identity. + */ + @JsonProperty(value = "type") + private EventSubscriptionIdentityType type; + + /* + * The user identity associated with the resource. + */ + @JsonProperty(value = "userAssignedIdentity") + private String userAssignedIdentity; + + /** + * Get the type property: The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both + * an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identity. + * + * @return the type value. + */ + public EventSubscriptionIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both + * an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identity. + * + * @param type the type value to set. + * @return the EventSubscriptionIdentity object itself. + */ + public EventSubscriptionIdentity withType(EventSubscriptionIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentity property: The user identity associated with the resource. + * + * @return the userAssignedIdentity value. + */ + public String userAssignedIdentity() { + return this.userAssignedIdentity; + } + + /** + * Set the userAssignedIdentity property: The user identity associated with the resource. + * + * @param userAssignedIdentity the userAssignedIdentity value to set. + * @return the EventSubscriptionIdentity object itself. + */ + public EventSubscriptionIdentity withUserAssignedIdentity(String userAssignedIdentity) { + this.userAssignedIdentity = userAssignedIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventSubscriptionIdentityType.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventSubscriptionIdentityType.java new file mode 100644 index 000000000000..1ee3b47e8d2c --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventSubscriptionIdentityType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventgrid.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EventSubscriptionIdentityType. */ +public final class EventSubscriptionIdentityType extends ExpandableStringEnum { + /** Static value SystemAssigned for EventSubscriptionIdentityType. */ + public static final EventSubscriptionIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for EventSubscriptionIdentityType. */ + public static final EventSubscriptionIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Creates or finds a EventSubscriptionIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EventSubscriptionIdentityType. + */ + @JsonCreator + public static EventSubscriptionIdentityType fromString(String name) { + return fromString(name, EventSubscriptionIdentityType.class); + } + + /** @return known EventSubscriptionIdentityType values. */ + public static Collection values() { + return values(EventSubscriptionIdentityType.class); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventSubscriptionUpdateParameters.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventSubscriptionUpdateParameters.java index be14e3e69c79..d1273b464c6e 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventSubscriptionUpdateParameters.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventSubscriptionUpdateParameters.java @@ -23,6 +23,16 @@ public final class EventSubscriptionUpdateParameters { @JsonProperty(value = "destination") private EventSubscriptionDestination destination; + /* + * Information about the destination where events have to be delivered for + * the event subscription. + * Uses the managed identity setup on the parent resource (topic / domain) + * to acquire the authentication tokens being used during delivery / + * dead-lettering. + */ + @JsonProperty(value = "deliveryWithResourceIdentity") + private DeliveryWithResourceIdentity deliveryWithResourceIdentity; + /* * Information about the filter for the event subscription. */ @@ -60,6 +70,17 @@ public final class EventSubscriptionUpdateParameters { @JsonProperty(value = "deadLetterDestination") private DeadLetterDestination deadLetterDestination; + /* + * The dead letter destination of the event subscription. Any event that + * cannot be delivered to its' destination is sent to the dead letter + * destination. + * Uses the managed identity setup on the parent resource (topic / domain) + * to acquire the authentication tokens being used during delivery / + * dead-lettering. + */ + @JsonProperty(value = "deadLetterWithResourceIdentity") + private DeadLetterWithResourceIdentity deadLetterWithResourceIdentity; + /** * Get the destination property: Information about the destination where events have to be delivered for the event * subscription. @@ -82,6 +103,31 @@ public EventSubscriptionUpdateParameters withDestination(EventSubscriptionDestin return this; } + /** + * Get the deliveryWithResourceIdentity property: Information about the destination where events have to be + * delivered for the event subscription. Uses the managed identity setup on the parent resource (topic / domain) to + * acquire the authentication tokens being used during delivery / dead-lettering. + * + * @return the deliveryWithResourceIdentity value. + */ + public DeliveryWithResourceIdentity deliveryWithResourceIdentity() { + return this.deliveryWithResourceIdentity; + } + + /** + * Set the deliveryWithResourceIdentity property: Information about the destination where events have to be + * delivered for the event subscription. Uses the managed identity setup on the parent resource (topic / domain) to + * acquire the authentication tokens being used during delivery / dead-lettering. + * + * @param deliveryWithResourceIdentity the deliveryWithResourceIdentity value to set. + * @return the EventSubscriptionUpdateParameters object itself. + */ + public EventSubscriptionUpdateParameters withDeliveryWithResourceIdentity( + DeliveryWithResourceIdentity deliveryWithResourceIdentity) { + this.deliveryWithResourceIdentity = deliveryWithResourceIdentity; + return this; + } + /** * Get the filter property: Information about the filter for the event subscription. * @@ -204,6 +250,33 @@ public EventSubscriptionUpdateParameters withDeadLetterDestination(DeadLetterDes return this; } + /** + * Get the deadLetterWithResourceIdentity property: The dead letter destination of the event subscription. Any event + * that cannot be delivered to its' destination is sent to the dead letter destination. Uses the managed identity + * setup on the parent resource (topic / domain) to acquire the authentication tokens being used during delivery / + * dead-lettering. + * + * @return the deadLetterWithResourceIdentity value. + */ + public DeadLetterWithResourceIdentity deadLetterWithResourceIdentity() { + return this.deadLetterWithResourceIdentity; + } + + /** + * Set the deadLetterWithResourceIdentity property: The dead letter destination of the event subscription. Any event + * that cannot be delivered to its' destination is sent to the dead letter destination. Uses the managed identity + * setup on the parent resource (topic / domain) to acquire the authentication tokens being used during delivery / + * dead-lettering. + * + * @param deadLetterWithResourceIdentity the deadLetterWithResourceIdentity value to set. + * @return the EventSubscriptionUpdateParameters object itself. + */ + public EventSubscriptionUpdateParameters withDeadLetterWithResourceIdentity( + DeadLetterWithResourceIdentity deadLetterWithResourceIdentity) { + this.deadLetterWithResourceIdentity = deadLetterWithResourceIdentity; + return this; + } + /** * Validates the instance. * @@ -213,6 +286,9 @@ public void validate() { if (destination() != null) { destination().validate(); } + if (deliveryWithResourceIdentity() != null) { + deliveryWithResourceIdentity().validate(); + } if (filter() != null) { filter().validate(); } @@ -222,5 +298,8 @@ public void validate() { if (deadLetterDestination() != null) { deadLetterDestination().validate(); } + if (deadLetterWithResourceIdentity() != null) { + deadLetterWithResourceIdentity().validate(); + } } } diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ExtensionTopic.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ExtensionTopic.java new file mode 100644 index 000000000000..7383041af683 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ExtensionTopic.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventgrid.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.eventgrid.fluent.models.ExtensionTopicInner; + +/** An immutable client-side representation of ExtensionTopic. */ +public interface ExtensionTopic { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: The system metadata relating to the Extension Topic resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the description property: Description of the extension topic. + * + * @return the description value. + */ + String description(); + + /** + * Gets the systemTopic property: System topic resource id which is mapped to the source. + * + * @return the systemTopic value. + */ + String systemTopic(); + + /** + * Gets the inner com.azure.resourcemanager.eventgrid.fluent.models.ExtensionTopicInner object. + * + * @return the inner object. + */ + ExtensionTopicInner innerModel(); +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ExtensionTopics.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ExtensionTopics.java new file mode 100644 index 000000000000..3277558d86aa --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ExtensionTopics.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventgrid.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ExtensionTopics. */ +public interface ExtensionTopics { + /** + * Get the properties of an extension topic. + * + * @param scope The identifier of the resource to which extension topic is queried. The scope can be a subscription, + * or a resource group, or a top level resource belonging to a resource provider namespace. For example, use + * '/subscriptions/{subscriptionId}/' for a subscription, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + * for Azure resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an extension topic. + */ + ExtensionTopic get(String scope); + + /** + * Get the properties of an extension topic. + * + * @param scope The identifier of the resource to which extension topic is queried. The scope can be a subscription, + * or a resource group, or a top level resource belonging to a resource provider namespace. For example, use + * '/subscriptions/{subscriptionId}/' for a subscription, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a resource group, and + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + * for Azure resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of an extension topic. + */ + Response getWithResponse(String scope, Context context); +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/Topic.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/Topic.java index 32c7b8611017..7866fe5bf26e 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/Topic.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/Topic.java @@ -49,6 +49,13 @@ public interface Topic { */ Map tags(); + /** + * Gets the identity property: Identity information for the resource. + * + * @return the identity value. + */ + IdentityInfo identity(); + /** * Gets the systemData property: The system metadata relating to Topic resource. * @@ -194,6 +201,7 @@ interface WithResourceGroup { */ interface WithCreate extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, DefinitionStages.WithInputSchema, DefinitionStages.WithInputSchemaMapping, DefinitionStages.WithPublicNetworkAccess, @@ -224,6 +232,16 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the Topic definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Identity information for the resource.. + * + * @param identity Identity information for the resource. + * @return the next definition stage. + */ + WithCreate withIdentity(IdentityInfo identity); + } /** The stage of the Topic definition allowing to specify inputSchema. */ interface WithInputSchema { /** @@ -302,6 +320,7 @@ interface WithDisableLocalAuth { /** The template for Topic update. */ interface Update extends UpdateStages.WithTags, + UpdateStages.WithIdentity, UpdateStages.WithPublicNetworkAccess, UpdateStages.WithInboundIpRules, UpdateStages.WithDisableLocalAuth { @@ -332,6 +351,16 @@ interface WithTags { */ Update withTags(Map tags); } + /** The stage of the Topic update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Topic resource identity information.. + * + * @param identity Topic resource identity information. + * @return the next definition stage. + */ + Update withIdentity(IdentityInfo identity); + } /** The stage of the Topic update allowing to specify publicNetworkAccess. */ interface WithPublicNetworkAccess { /** diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/TopicUpdateParameters.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/TopicUpdateParameters.java index 259bcaa0b81c..efc739e15d66 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/TopicUpdateParameters.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/TopicUpdateParameters.java @@ -25,6 +25,12 @@ public final class TopicUpdateParameters { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /* + * Topic resource identity information. + */ + @JsonProperty(value = "identity") + private IdentityInfo identity; + /* * Properties of the resource. */ @@ -51,6 +57,26 @@ public TopicUpdateParameters withTags(Map tags) { return this; } + /** + * Get the identity property: Topic resource identity information. + * + * @return the identity value. + */ + public IdentityInfo identity() { + return this.identity; + } + + /** + * Set the identity property: Topic resource identity information. + * + * @param identity the identity value to set. + * @return the TopicUpdateParameters object itself. + */ + public TopicUpdateParameters withIdentity(IdentityInfo identity) { + this.identity = identity; + return this; + } + /** * Get the innerProperties property: Properties of the resource. * @@ -147,6 +173,9 @@ public TopicUpdateParameters withDisableLocalAuth(Boolean disableLocalAuth) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (identity() != null) { + identity().validate(); + } if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/samples/java/com/azure/resourcemanager/eventgrid/generated/ExtensionTopicsGetSamples.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/samples/java/com/azure/resourcemanager/eventgrid/generated/ExtensionTopicsGetSamples.java new file mode 100644 index 000000000000..0882137f8fc2 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/samples/java/com/azure/resourcemanager/eventgrid/generated/ExtensionTopicsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.eventgrid.generated; + +import com.azure.core.util.Context; + +/** Samples for ExtensionTopics Get. */ +public final class ExtensionTopicsGetSamples { + /* + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/ExtensionTopics_Get.json + */ + /** + * Sample code: ExtensionTopics_Get. + * + * @param manager Entry point to EventGridManager. + */ + public static void extensionTopicsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager + .extensionTopics() + .getWithResponse( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.storage/storageaccounts/exampleResourceName/providers/Microsoft.eventgrid/extensionTopics/default", + Context.NONE); + } +}