diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/CHANGELOG.md b/sdk/eventgrid/azure-resourcemanager-eventgrid/CHANGELOG.md index 3d5228d69c042..20833462ca090 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/CHANGELOG.md +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/CHANGELOG.md @@ -1,7 +1,320 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0-beta.1 (2021-06-21) +- 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-06-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +### New Feature + +* `models.ExtensionTopic` was added + +* `models.PartnerNamespaces` was added + +* `models.SystemTopic` was added + +* `models.StringNotBeginsWithAdvancedFilter` was added + +* `models.EventSubscriptionIdentity` was added + +* `models.PartnerNamespaceSharedAccessKeys` was added + +* `models.EventChannel` was added + +* `models.Sku` was added + +* `models.PartnerNamespace` was added + +* `models.NumberInRangeAdvancedFilter` was added + +* `models.DeadLetterWithResourceIdentity` was added + +* `models.IsNotNullAdvancedFilter` was added + +* `models.PartnerRegistration$UpdateStages` was added + +* `models.PartnerRegistration$Update` was added + +* `models.EventChannel$Definition` was added + +* `models.UserIdentityProperties` was added + +* `models.SystemTopic$Definition` was added + +* `models.EventChannels` was added + +* `models.EventChannelDestination` was added + +* `models.IsNullOrUndefinedAdvancedFilter` was added + +* `models.PartnerTopicUpdateParameters` was added + +* `models.ResourceSku` was added + +* `models.ResourceKind` was added + +* `models.PartnerRegistration$DefinitionStages` was added + +* `models.EventChannelProvisioningState` was added + +* `models.NumberNotInRangeAdvancedFilter` was added + +* `models.PartnerTopicEventSubscriptions` was added + +* `models.PartnerNamespace$Update` was added + +* `models.EventChannel$DefinitionStages` was added + +* `models.IdentityInfo` was added + +* `models.EventChannelSource` was added + +* `models.PartnerTopicReadinessState` was added + +* `models.PartnerNamespacesListResult` was added + +* `models.SystemTopic$UpdateStages` was added + +* `models.DeliveryAttributeListResult` was added + +* `models.DeliveryAttributeMapping` was added + +* `models.PartnerRegistration$Definition` was added + +* `models.StringNotEndsWithAdvancedFilter` was added + +* `models.EventChannel$Update` was added + +* `models.PartnerTopicActivationState` was added + +* `models.SystemTopicUpdateParameters` was added + +* `models.PartnerRegistrationProvisioningState` was added + +* `models.DeliveryAttributeMappingType` was added + +* `models.PartnerNamespaceUpdateParameters` was added + +* `models.IdentityType` was added + +* `models.StaticDeliveryAttributeMapping` was added + +* `models.PartnerTopics` was added + +* `models.DeliveryWithResourceIdentity` was added + +* `models.TopicTypePropertiesSupportedScopesForSourceItem` was added + +* `models.PartnerRegistrationsListResult` was added + +* `models.PartnerRegistrationUpdateParameters` was added + +* `models.DynamicDeliveryAttributeMapping` was added + +* `models.ExtensionTopics` was added + +* `models.EventChannelsListResult` was added + +* `models.PartnerRegistration` was added + +* `models.SystemTopicsListResult` was added + +* `models.PartnerRegistrationVisibilityState` was added + +* `models.EventSubscriptionIdentityType` was added + +* `models.PartnerNamespace$DefinitionStages` was added + +* `models.StringNotContainsAdvancedFilter` was added + +* `models.SystemTopic$Update` was added + +* `models.EventChannelFilter` was added + +* `models.SystemTopic$DefinitionStages` was added + +* `models.PartnerNamespaceProvisioningState` was added + +* `models.PartnerTopicProvisioningState` was added + +* `models.PartnerTopicsListResult` was added + +* `models.EventChannel$UpdateStages` was added + +* `models.PartnerTopic` was added + +* `models.SystemTopics` was added + +* `models.ExtendedLocation` was added + +* `models.PartnerNamespace$Definition` was added + +* `models.PartnerRegistrations` was added + +* `models.PartnerNamespaceRegenerateKeyRequest` was added + +* `models.PartnerNamespace$UpdateStages` was added + +* `models.SystemTopicEventSubscriptions` was added + +#### `models.Topic` was modified + +* `disableLocalAuth()` was added +* `kind()` was added +* `identity()` was added +* `extendedLocation()` was added +* `sku()` was added + +#### `models.EventSubscriptionFilter` was modified + +* `withEnableAdvancedFilteringOnArrays(java.lang.Boolean)` was added +* `enableAdvancedFilteringOnArrays()` was added + +#### `models.WebhookEventSubscriptionDestination` was modified + +* `withDeliveryAttributeMappings(java.util.List)` was added +* `deliveryAttributeMappings()` was added + +#### `models.StorageQueueEventSubscriptionDestination` was modified + +* `queueMessageTimeToLiveInSeconds()` was added +* `withQueueMessageTimeToLiveInSeconds(java.lang.Long)` was added + +#### `models.EventSubscription$Definition` was modified + +* `withDeliveryWithResourceIdentity(models.DeliveryWithResourceIdentity)` was added +* `withDeadLetterWithResourceIdentity(models.DeadLetterWithResourceIdentity)` was added + +#### `models.ServiceBusQueueEventSubscriptionDestination` was modified + +* `deliveryAttributeMappings()` was added +* `withDeliveryAttributeMappings(java.util.List)` was added + +#### `models.TopicUpdateParameters` was modified + +* `withIdentity(models.IdentityInfo)` was added +* `withDisableLocalAuth(java.lang.Boolean)` was added +* `identity()` was added +* `withSku(models.ResourceSku)` was added +* `disableLocalAuth()` was added +* `sku()` was added + +#### `models.Domain$Update` was modified + +* `withDisableLocalAuth(java.lang.Boolean)` was added +* `withIdentity(models.IdentityInfo)` was added +* `withSku(models.ResourceSku)` was added +* `withAutoDeleteTopicWithLastSubscription(java.lang.Boolean)` was added +* `withAutoCreateTopicWithFirstSubscription(java.lang.Boolean)` was added + +#### `models.Topic$Definition` was modified + +* `withExtendedLocation(models.ExtendedLocation)` was added +* `withKind(models.ResourceKind)` was added +* `withDisableLocalAuth(java.lang.Boolean)` was added +* `withIdentity(models.IdentityInfo)` was added +* `withSku(models.ResourceSku)` was added + +#### `models.ServiceBusTopicEventSubscriptionDestination` was modified + +* `deliveryAttributeMappings()` was added +* `withDeliveryAttributeMappings(java.util.List)` was added + +#### `models.DomainUpdateParameters` was modified + +* `autoDeleteTopicWithLastSubscription()` was added +* `identity()` was added +* `sku()` was added +* `withAutoCreateTopicWithFirstSubscription(java.lang.Boolean)` was added +* `withAutoDeleteTopicWithLastSubscription(java.lang.Boolean)` was added +* `withSku(models.ResourceSku)` was added +* `withIdentity(models.IdentityInfo)` was added +* `withDisableLocalAuth(java.lang.Boolean)` was added +* `autoCreateTopicWithFirstSubscription()` was added +* `disableLocalAuth()` was added + +#### `models.Topic$Update` was modified + +* `withIdentity(models.IdentityInfo)` was added +* `withDisableLocalAuth(java.lang.Boolean)` was added +* `withSku(models.ResourceSku)` was added + +#### `models.Operation` was modified + +* `isDataAction()` was added + +#### `models.EventSubscription` was modified + +* `deliveryWithResourceIdentity()` was added +* `getDeliveryAttributesWithResponse(com.azure.core.util.Context)` was added +* `deadLetterWithResourceIdentity()` was added +* `getDeliveryAttributes()` was added + +#### `models.Domain` was modified + +* `disableLocalAuth()` was added +* `autoCreateTopicWithFirstSubscription()` was added +* `identity()` was added +* `sku()` was added +* `autoDeleteTopicWithLastSubscription()` was added + +#### `models.AzureFunctionEventSubscriptionDestination` was modified + +* `withDeliveryAttributeMappings(java.util.List)` was added +* `deliveryAttributeMappings()` was added + +#### `models.EventSubscription$Update` was modified + +* `withDeadLetterWithResourceIdentity(models.DeadLetterWithResourceIdentity)` was added +* `withDeliveryWithResourceIdentity(models.DeliveryWithResourceIdentity)` was added + +#### `models.HybridConnectionEventSubscriptionDestination` was modified + +* `deliveryAttributeMappings()` was added +* `withDeliveryAttributeMappings(java.util.List)` was added + +#### `models.TopicTypeInfo` was modified + +* `supportedScopesForSource()` was added + +#### `models.EventHubEventSubscriptionDestination` was modified + +* `deliveryAttributeMappings()` was added +* `withDeliveryAttributeMappings(java.util.List)` was added + +#### `models.EventSubscriptions` was modified + +* `getDeliveryAttributes(java.lang.String,java.lang.String)` was added +* `getDeliveryAttributesWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added + +#### `EventGridManager` was modified + +* `partnerTopicEventSubscriptions()` was added +* `systemTopics()` was added +* `partnerNamespaces()` was added +* `partnerRegistrations()` was added +* `eventChannels()` was added +* `systemTopicEventSubscriptions()` was added +* `partnerTopics()` was added +* `extensionTopics()` was added + +#### `models.Domain$Definition` was modified + +* `withSku(models.ResourceSku)` was added +* `withAutoDeleteTopicWithLastSubscription(java.lang.Boolean)` was added +* `withDisableLocalAuth(java.lang.Boolean)` was added +* `withAutoCreateTopicWithFirstSubscription(java.lang.Boolean)` was added +* `withIdentity(models.IdentityInfo)` was added + +#### `EventGridManager$Configurable` was modified + +* `withScope(java.lang.String)` was added + +#### `models.EventSubscriptionUpdateParameters` was modified + +* `withDeadLetterWithResourceIdentity(models.DeadLetterWithResourceIdentity)` was added +* `deadLetterWithResourceIdentity()` was added +* `deliveryWithResourceIdentity()` was added +* `withDeliveryWithResourceIdentity(models.DeliveryWithResourceIdentity)` was added ## 1.0.0 (2021-04-09) diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/README.md b/sdk/eventgrid/azure-resourcemanager-eventgrid/README.md index fe6f2a5a4af41..338cfae3bd23b 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/README.md +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/README.md @@ -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-2020-06. 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-2021-06-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 @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-eventgrid - 1.0.0 + 1.1.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,8 @@ See [API design][design] for general introduction on design and key concepts on ## Examples + + ## Troubleshooting ## Next steps diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml b/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml index 790929709e3ac..7ebff73ea30f9 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml @@ -1,67 +1,88 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-eventgrid - 1.1.0-beta.1 - jar + com.azure.resourcemanager + azure-resourcemanager-eventgrid + 1.1.0-beta.1 + jar - Microsoft Azure SDK for EventGrid Management - 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-2020-06. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for EventGrid Management + 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-2021-06-preview. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - - - - - com.azure - azure-core - 1.17.0 - - - com.azure - azure-core-management - 1.3.0 - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.5 - - true - - - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.17.0 + + + com.azure + azure-core-management + 1.3.0 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + true + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + 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 90a7cc9cf8bb0..e7954e196a763 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 @@ -9,7 +9,6 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,25 +16,42 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.eventgrid.fluent.EventGridManagementClient; import com.azure.resourcemanager.eventgrid.implementation.DomainTopicsImpl; import com.azure.resourcemanager.eventgrid.implementation.DomainsImpl; +import com.azure.resourcemanager.eventgrid.implementation.EventChannelsImpl; 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.PartnerNamespacesImpl; +import com.azure.resourcemanager.eventgrid.implementation.PartnerRegistrationsImpl; +import com.azure.resourcemanager.eventgrid.implementation.PartnerTopicEventSubscriptionsImpl; +import com.azure.resourcemanager.eventgrid.implementation.PartnerTopicsImpl; import com.azure.resourcemanager.eventgrid.implementation.PrivateEndpointConnectionsImpl; import com.azure.resourcemanager.eventgrid.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.eventgrid.implementation.SystemTopicEventSubscriptionsImpl; +import com.azure.resourcemanager.eventgrid.implementation.SystemTopicsImpl; import com.azure.resourcemanager.eventgrid.implementation.TopicTypesImpl; import com.azure.resourcemanager.eventgrid.implementation.TopicsImpl; import com.azure.resourcemanager.eventgrid.models.DomainTopics; import com.azure.resourcemanager.eventgrid.models.Domains; +import com.azure.resourcemanager.eventgrid.models.EventChannels; 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.PartnerNamespaces; +import com.azure.resourcemanager.eventgrid.models.PartnerRegistrations; +import com.azure.resourcemanager.eventgrid.models.PartnerTopicEventSubscriptions; +import com.azure.resourcemanager.eventgrid.models.PartnerTopics; import com.azure.resourcemanager.eventgrid.models.PrivateEndpointConnections; import com.azure.resourcemanager.eventgrid.models.PrivateLinkResources; +import com.azure.resourcemanager.eventgrid.models.SystemTopicEventSubscriptions; +import com.azure.resourcemanager.eventgrid.models.SystemTopics; import com.azure.resourcemanager.eventgrid.models.TopicTypes; import com.azure.resourcemanager.eventgrid.models.Topics; import java.time.Duration; @@ -50,16 +66,32 @@ public final class EventGridManager { private DomainTopics domainTopics; + private EventChannels eventChannels; + private EventSubscriptions eventSubscriptions; + private SystemTopicEventSubscriptions systemTopicEventSubscriptions; + + private PartnerTopicEventSubscriptions partnerTopicEventSubscriptions; + private Operations operations; - private Topics topics; + private PartnerNamespaces partnerNamespaces; + + private PartnerRegistrations partnerRegistrations; + + private PartnerTopics partnerTopics; private PrivateEndpointConnections privateEndpointConnections; private PrivateLinkResources privateLinkResources; + private SystemTopics systemTopics; + + private Topics topics; + + private ExtensionTopics extensionTopics; + private TopicTypes topicTypes; private final EventGridManagementClient clientObject; @@ -105,6 +137,7 @@ public static final class Configurable { private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -144,6 +177,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -186,7 +230,7 @@ public EventGridManager authenticate(TokenCredential credential, AzureProfile pr .append("-") .append("com.azure.resourcemanager.eventgrid") .append("/") - .append("1.0.0"); + .append("1.1.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -200,6 +244,9 @@ public EventGridManager authenticate(TokenCredential credential, AzureProfile pr userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } @@ -209,10 +256,7 @@ public EventGridManager authenticate(TokenCredential credential, AzureProfile pr HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); - policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies.addAll(this.policies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); @@ -241,6 +285,14 @@ public DomainTopics domainTopics() { return domainTopics; } + /** @return Resource collection API of EventChannels. */ + public EventChannels eventChannels() { + if (this.eventChannels == null) { + this.eventChannels = new EventChannelsImpl(clientObject.getEventChannels(), this); + } + return eventChannels; + } + /** @return Resource collection API of EventSubscriptions. */ public EventSubscriptions eventSubscriptions() { if (this.eventSubscriptions == null) { @@ -249,6 +301,24 @@ public EventSubscriptions eventSubscriptions() { return eventSubscriptions; } + /** @return Resource collection API of SystemTopicEventSubscriptions. */ + public SystemTopicEventSubscriptions systemTopicEventSubscriptions() { + if (this.systemTopicEventSubscriptions == null) { + this.systemTopicEventSubscriptions = + new SystemTopicEventSubscriptionsImpl(clientObject.getSystemTopicEventSubscriptions(), this); + } + return systemTopicEventSubscriptions; + } + + /** @return Resource collection API of PartnerTopicEventSubscriptions. */ + public PartnerTopicEventSubscriptions partnerTopicEventSubscriptions() { + if (this.partnerTopicEventSubscriptions == null) { + this.partnerTopicEventSubscriptions = + new PartnerTopicEventSubscriptionsImpl(clientObject.getPartnerTopicEventSubscriptions(), this); + } + return partnerTopicEventSubscriptions; + } + /** @return Resource collection API of Operations. */ public Operations operations() { if (this.operations == null) { @@ -257,12 +327,28 @@ public Operations operations() { return operations; } - /** @return Resource collection API of Topics. */ - public Topics topics() { - if (this.topics == null) { - this.topics = new TopicsImpl(clientObject.getTopics(), this); + /** @return Resource collection API of PartnerNamespaces. */ + public PartnerNamespaces partnerNamespaces() { + if (this.partnerNamespaces == null) { + this.partnerNamespaces = new PartnerNamespacesImpl(clientObject.getPartnerNamespaces(), this); } - return topics; + return partnerNamespaces; + } + + /** @return Resource collection API of PartnerRegistrations. */ + public PartnerRegistrations partnerRegistrations() { + if (this.partnerRegistrations == null) { + this.partnerRegistrations = new PartnerRegistrationsImpl(clientObject.getPartnerRegistrations(), this); + } + return partnerRegistrations; + } + + /** @return Resource collection API of PartnerTopics. */ + public PartnerTopics partnerTopics() { + if (this.partnerTopics == null) { + this.partnerTopics = new PartnerTopicsImpl(clientObject.getPartnerTopics(), this); + } + return partnerTopics; } /** @return Resource collection API of PrivateEndpointConnections. */ @@ -282,6 +368,30 @@ public PrivateLinkResources privateLinkResources() { return privateLinkResources; } + /** @return Resource collection API of SystemTopics. */ + public SystemTopics systemTopics() { + if (this.systemTopics == null) { + this.systemTopics = new SystemTopicsImpl(clientObject.getSystemTopics(), this); + } + return systemTopics; + } + + /** @return Resource collection API of Topics. */ + public Topics topics() { + if (this.topics == null) { + this.topics = new TopicsImpl(clientObject.getTopics(), this); + } + return topics; + } + + /** @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/EventChannelsClient.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/EventChannelsClient.java new file mode 100644 index 0000000000000..2bf14d42d1ad2 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/EventChannelsClient.java @@ -0,0 +1,181 @@ +// 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.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.eventgrid.fluent.models.EventChannelInner; + +/** An instance of this class provides access to all the operations defined in EventChannelsClient. */ +public interface EventChannelsClient { + /** + * Get properties of an event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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 properties of an event channel. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EventChannelInner get(String resourceGroupName, String partnerNamespaceName, String eventChannelName); + + /** + * Get properties of an event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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 properties of an event channel. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String partnerNamespaceName, String eventChannelName, Context context); + + /** + * Asynchronously creates a new event channel with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @param eventChannelInfo EventChannel information. + * @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 event Channel. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EventChannelInner createOrUpdate( + String resourceGroupName, + String partnerNamespaceName, + String eventChannelName, + EventChannelInner eventChannelInfo); + + /** + * Asynchronously creates a new event channel with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @param eventChannelInfo EventChannel information. + * @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 event Channel. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String partnerNamespaceName, + String eventChannelName, + EventChannelInner eventChannelInfo, + Context context); + + /** + * Delete existing event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String partnerNamespaceName, String eventChannelName); + + /** + * Delete existing event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String partnerNamespaceName, String eventChannelName, Context context); + + /** + * Delete existing event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String partnerNamespaceName, String eventChannelName); + + /** + * Delete existing event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String partnerNamespaceName, String eventChannelName, Context context); + + /** + * List all the event channels in a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 result of the List Event Channels operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPartnerNamespace(String resourceGroupName, String partnerNamespaceName); + + /** + * List all the event channels in a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Event Channels operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPartnerNamespace( + String resourceGroupName, String partnerNamespaceName, String filter, Integer top, Context context); +} 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 20e684f70955b..6587e4e987fa3 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 @@ -59,6 +59,13 @@ public interface EventGridManagementClient { */ DomainTopicsClient getDomainTopics(); + /** + * Gets the EventChannelsClient object to access its operations. + * + * @return the EventChannelsClient object. + */ + EventChannelsClient getEventChannels(); + /** * Gets the EventSubscriptionsClient object to access its operations. * @@ -66,6 +73,20 @@ public interface EventGridManagementClient { */ EventSubscriptionsClient getEventSubscriptions(); + /** + * Gets the SystemTopicEventSubscriptionsClient object to access its operations. + * + * @return the SystemTopicEventSubscriptionsClient object. + */ + SystemTopicEventSubscriptionsClient getSystemTopicEventSubscriptions(); + + /** + * Gets the PartnerTopicEventSubscriptionsClient object to access its operations. + * + * @return the PartnerTopicEventSubscriptionsClient object. + */ + PartnerTopicEventSubscriptionsClient getPartnerTopicEventSubscriptions(); + /** * Gets the OperationsClient object to access its operations. * @@ -74,11 +95,25 @@ public interface EventGridManagementClient { OperationsClient getOperations(); /** - * Gets the TopicsClient object to access its operations. + * Gets the PartnerNamespacesClient object to access its operations. * - * @return the TopicsClient object. + * @return the PartnerNamespacesClient object. */ - TopicsClient getTopics(); + PartnerNamespacesClient getPartnerNamespaces(); + + /** + * Gets the PartnerRegistrationsClient object to access its operations. + * + * @return the PartnerRegistrationsClient object. + */ + PartnerRegistrationsClient getPartnerRegistrations(); + + /** + * Gets the PartnerTopicsClient object to access its operations. + * + * @return the PartnerTopicsClient object. + */ + PartnerTopicsClient getPartnerTopics(); /** * Gets the PrivateEndpointConnectionsClient object to access its operations. @@ -94,6 +129,27 @@ public interface EventGridManagementClient { */ PrivateLinkResourcesClient getPrivateLinkResources(); + /** + * Gets the SystemTopicsClient object to access its operations. + * + * @return the SystemTopicsClient object. + */ + SystemTopicsClient getSystemTopics(); + + /** + * Gets the TopicsClient object to access its operations. + * + * @return the TopicsClient object. + */ + TopicsClient getTopics(); + + /** + * 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/EventSubscriptionsClient.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/EventSubscriptionsClient.java index ea8f74e3a9865..08313ffe430b7 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/EventSubscriptionsClient.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/EventSubscriptionsClient.java @@ -11,6 +11,7 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.eventgrid.fluent.models.DeliveryAttributeListResultInner; import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionFullUrlInner; import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner; import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters; @@ -745,4 +746,46 @@ PagedIterable listByDomainTopic( @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByDomainTopic( String resourceGroupName, String domainName, String topicName, String filter, Integer top, Context context); + + /** + * Get all delivery attributes for an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top + * level resource belonging to a resource provider namespace, or an EventGrid topic. 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 a resource, and + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + * for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @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 all delivery attributes for an event subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeliveryAttributeListResultInner getDeliveryAttributes(String scope, String eventSubscriptionName); + + /** + * Get all delivery attributes for an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top + * level resource belonging to a resource provider namespace, or an EventGrid topic. 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 a resource, and + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + * for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @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 all delivery attributes for an event subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDeliveryAttributesWithResponse( + String scope, String eventSubscriptionName, Context context); } 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 0000000000000..49da41e827f0e --- /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/PartnerNamespacesClient.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/PartnerNamespacesClient.java new file mode 100644 index 0000000000000..94b0cb2c7899b --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/PartnerNamespacesClient.java @@ -0,0 +1,369 @@ +// 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.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.eventgrid.fluent.models.PartnerNamespaceInner; +import com.azure.resourcemanager.eventgrid.fluent.models.PartnerNamespaceSharedAccessKeysInner; +import com.azure.resourcemanager.eventgrid.models.PartnerNamespaceRegenerateKeyRequest; +import com.azure.resourcemanager.eventgrid.models.PartnerNamespaceUpdateParameters; + +/** An instance of this class provides access to all the operations defined in PartnerNamespacesClient. */ +public interface PartnerNamespacesClient { + /** + * Get properties of a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 properties of a partner namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PartnerNamespaceInner getByResourceGroup(String resourceGroupName, String partnerNamespaceName); + + /** + * Get properties of a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 properties of a partner namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String partnerNamespaceName, Context context); + + /** + * Asynchronously creates a new partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceInfo PartnerNamespace information. + * @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 eventGrid Partner Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PartnerNamespaceInner> beginCreateOrUpdate( + String resourceGroupName, String partnerNamespaceName, PartnerNamespaceInner partnerNamespaceInfo); + + /** + * Asynchronously creates a new partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceInfo PartnerNamespace information. + * @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 eventGrid Partner Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PartnerNamespaceInner> beginCreateOrUpdate( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceInner partnerNamespaceInfo, + Context context); + + /** + * Asynchronously creates a new partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceInfo PartnerNamespace information. + * @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 eventGrid Partner Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PartnerNamespaceInner createOrUpdate( + String resourceGroupName, String partnerNamespaceName, PartnerNamespaceInner partnerNamespaceInfo); + + /** + * Asynchronously creates a new partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceInfo PartnerNamespace information. + * @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 eventGrid Partner Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PartnerNamespaceInner createOrUpdate( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceInner partnerNamespaceInfo, + Context context); + + /** + * Delete existing partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String partnerNamespaceName); + + /** + * Delete existing partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String partnerNamespaceName, Context context); + + /** + * Delete existing partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String partnerNamespaceName); + + /** + * Delete existing partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String partnerNamespaceName, Context context); + + /** + * Asynchronously updates a partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceUpdateParameters Partner namespace update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PartnerNamespaceInner> beginUpdate( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceUpdateParameters partnerNamespaceUpdateParameters); + + /** + * Asynchronously updates a partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceUpdateParameters Partner namespace update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PartnerNamespaceInner> beginUpdate( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceUpdateParameters partnerNamespaceUpdateParameters, + Context context); + + /** + * Asynchronously updates a partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceUpdateParameters Partner namespace update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PartnerNamespaceInner update( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceUpdateParameters partnerNamespaceUpdateParameters); + + /** + * Asynchronously updates a partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceUpdateParameters Partner namespace update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PartnerNamespaceInner update( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceUpdateParameters partnerNamespaceUpdateParameters, + Context context); + + /** + * List all the partner namespaces under an Azure subscription. + * + * @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 result of the List Partner Namespaces operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List all the partner namespaces under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Namespaces operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Integer top, Context context); + + /** + * List all the partner namespaces under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 result of the List Partner Namespaces operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all the partner namespaces under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Namespaces operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, String filter, Integer top, Context context); + + /** + * List the two keys used to publish to a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 shared access keys of the partner namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PartnerNamespaceSharedAccessKeysInner listSharedAccessKeys(String resourceGroupName, String partnerNamespaceName); + + /** + * List the two keys used to publish to a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 shared access keys of the partner namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listSharedAccessKeysWithResponse( + String resourceGroupName, String partnerNamespaceName, Context context); + + /** + * Regenerate a shared access key for a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param regenerateKeyRequest Request body to regenerate key. + * @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 shared access keys of the partner namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PartnerNamespaceSharedAccessKeysInner regenerateKey( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceRegenerateKeyRequest regenerateKeyRequest); + + /** + * Regenerate a shared access key for a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param regenerateKeyRequest Request body to regenerate key. + * @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 shared access keys of the partner namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateKeyWithResponse( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceRegenerateKeyRequest regenerateKeyRequest, + Context context); +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/PartnerRegistrationsClient.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/PartnerRegistrationsClient.java new file mode 100644 index 0000000000000..19f8295662507 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/PartnerRegistrationsClient.java @@ -0,0 +1,204 @@ +// 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.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventgrid.fluent.models.PartnerRegistrationInner; +import com.azure.resourcemanager.eventgrid.models.PartnerRegistrationUpdateParameters; + +/** An instance of this class provides access to all the operations defined in PartnerRegistrationsClient. */ +public interface PartnerRegistrationsClient { + /** + * Gets a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @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 a partner registration with the specified parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PartnerRegistrationInner getByResourceGroup(String resourceGroupName, String partnerRegistrationName); + + /** + * Gets a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @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 a partner registration with the specified parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String partnerRegistrationName, Context context); + + /** + * Creates a new partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @param partnerRegistrationInfo PartnerRegistration information. + * @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 information about a partner registration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PartnerRegistrationInner createOrUpdate( + String resourceGroupName, String partnerRegistrationName, PartnerRegistrationInner partnerRegistrationInfo); + + /** + * Creates a new partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @param partnerRegistrationInfo PartnerRegistration information. + * @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 information about a partner registration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String partnerRegistrationName, + PartnerRegistrationInner partnerRegistrationInfo, + Context context); + + /** + * Deletes a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String partnerRegistrationName); + + /** + * Deletes a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String partnerRegistrationName, Context context); + + /** + * Updates a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @param partnerRegistrationUpdateParameters Partner registration update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PartnerRegistrationInner update( + String resourceGroupName, + String partnerRegistrationName, + PartnerRegistrationUpdateParameters partnerRegistrationUpdateParameters); + + /** + * Updates a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @param partnerRegistrationUpdateParameters Partner registration update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String partnerRegistrationName, + PartnerRegistrationUpdateParameters partnerRegistrationUpdateParameters, + Context context); + + /** + * List all the partner registrations under an Azure subscription. + * + * @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 result of the List Partner Registrations operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List all the partner registrations under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Registrations operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Integer top, Context context); + + /** + * List all the partner registrations under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 result of the List Partner Registrations operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all the partner registrations under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Registrations operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, String filter, Integer top, Context context); +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/PartnerTopicEventSubscriptionsClient.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/PartnerTopicEventSubscriptionsClient.java new file mode 100644 index 0000000000000..153c03b1ddd41 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/PartnerTopicEventSubscriptionsClient.java @@ -0,0 +1,388 @@ +// 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.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.eventgrid.fluent.models.DeliveryAttributeListResultInner; +import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionFullUrlInner; +import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner; +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters; + +/** An instance of this class provides access to all the operations defined in PartnerTopicEventSubscriptionsClient. */ +public interface PartnerTopicEventSubscriptionsClient { + /** + * Get an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be found. Event subscription names must be between + * 3 and 100 characters in length and use alphanumeric letters only. + * @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 an event subscription of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EventSubscriptionInner get(String resourceGroupName, String partnerTopicName, String eventSubscriptionName); + + /** + * Get an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be found. Event subscription names must be between + * 3 and 100 characters in length and use alphanumeric letters only. + * @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 an event subscription of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context); + + /** + * Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. + * Existing event subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, EventSubscriptionInner> beginCreateOrUpdate( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo); + + /** + * Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. + * Existing event subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, EventSubscriptionInner> beginCreateOrUpdate( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo, + Context context); + + /** + * Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. + * Existing event subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EventSubscriptionInner createOrUpdate( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo); + + /** + * Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. + * Existing event subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EventSubscriptionInner createOrUpdate( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo, + Context context); + + /** + * Delete an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName); + + /** + * Delete an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context); + + /** + * Delete an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String partnerTopicName, String eventSubscriptionName); + + /** + * Delete an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context); + + /** + * Update event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, EventSubscriptionInner> beginUpdate( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters); + + /** + * Update event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, EventSubscriptionInner> beginUpdate( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, + Context context); + + /** + * Update event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EventSubscriptionInner update( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters); + + /** + * Update event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EventSubscriptionInner update( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, + Context context); + + /** + * Get the full endpoint URL for an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 full endpoint URL for an event subscription of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EventSubscriptionFullUrlInner getFullUrl( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName); + + /** + * Get the full endpoint URL for an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 full endpoint URL for an event subscription of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getFullUrlWithResponse( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context); + + /** + * List event subscriptions that belong to a specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 result of the List EventSubscriptions operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPartnerTopic(String resourceGroupName, String partnerTopicName); + + /** + * List event subscriptions that belong to a specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List EventSubscriptions operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPartnerTopic( + String resourceGroupName, String partnerTopicName, String filter, Integer top, Context context); + + /** + * Get all delivery attributes for an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 all delivery attributes for an event subscription of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeliveryAttributeListResultInner getDeliveryAttributes( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName); + + /** + * Get all delivery attributes for an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 all delivery attributes for an event subscription of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDeliveryAttributesWithResponse( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context); +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/PartnerTopicsClient.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/PartnerTopicsClient.java new file mode 100644 index 0000000000000..5cfb018bf3dfa --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/PartnerTopicsClient.java @@ -0,0 +1,252 @@ +// 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.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.eventgrid.fluent.models.PartnerTopicInner; +import com.azure.resourcemanager.eventgrid.models.PartnerTopicUpdateParameters; + +/** An instance of this class provides access to all the operations defined in PartnerTopicsClient. */ +public interface PartnerTopicsClient { + /** + * Get properties of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 properties of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PartnerTopicInner getByResourceGroup(String resourceGroupName, String partnerTopicName); + + /** + * Get properties of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 properties of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String partnerTopicName, Context context); + + /** + * Delete existing partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String partnerTopicName); + + /** + * Delete existing partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String partnerTopicName, Context context); + + /** + * Delete existing partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String partnerTopicName); + + /** + * Delete existing partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String partnerTopicName, Context context); + + /** + * Asynchronously updates a partner topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param partnerTopicUpdateParameters PartnerTopic update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PartnerTopicInner update( + String resourceGroupName, String partnerTopicName, PartnerTopicUpdateParameters partnerTopicUpdateParameters); + + /** + * Asynchronously updates a partner topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param partnerTopicUpdateParameters PartnerTopic update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String partnerTopicName, + PartnerTopicUpdateParameters partnerTopicUpdateParameters, + Context context); + + /** + * List all the partner topics under an Azure subscription. + * + * @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 result of the List Partner Topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List all the partner topics under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Integer top, Context context); + + /** + * List all the partner topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 result of the List Partner Topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all the partner topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, String filter, Integer top, Context context); + + /** + * Activate a newly created partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 eventGrid Partner Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PartnerTopicInner activate(String resourceGroupName, String partnerTopicName); + + /** + * Activate a newly created partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 eventGrid Partner Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response activateWithResponse( + String resourceGroupName, String partnerTopicName, Context context); + + /** + * Deactivate specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 eventGrid Partner Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PartnerTopicInner deactivate(String resourceGroupName, String partnerTopicName); + + /** + * Deactivate specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 eventGrid Partner Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deactivateWithResponse( + String resourceGroupName, String partnerTopicName, Context context); +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/PrivateEndpointConnectionsClient.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/PrivateEndpointConnectionsClient.java index 5290f5aca91ee..aba2d14a4d018 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/PrivateEndpointConnectionsClient.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/PrivateEndpointConnectionsClient.java @@ -17,16 +17,18 @@ /** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ public interface PrivateEndpointConnectionsClient { /** - * Get a specific private endpoint connection under a topic or domain. + * Get a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @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 a specific private endpoint connection under a topic or domain. + * @return a specific private endpoint connection under a topic, domain, or partner namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) PrivateEndpointConnectionInner get( @@ -36,17 +38,19 @@ PrivateEndpointConnectionInner get( String privateEndpointConnectionName); /** - * Get a specific private endpoint connection under a topic or domain. + * Get a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @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 a specific private endpoint connection under a topic or domain. + * @return a specific private endpoint connection under a topic, domain, or partner namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( @@ -57,11 +61,13 @@ Response getWithResponse( Context context); /** - * Update a specific private endpoint connection under a topic or domain. + * Update a specific private endpoint connection under a topic, domain or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param privateEndpointConnection The private endpoint connection object to update. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -78,11 +84,13 @@ SyncPoller, PrivateEndpointConnection PrivateEndpointConnectionInner privateEndpointConnection); /** - * Update a specific private endpoint connection under a topic or domain. + * Update a specific private endpoint connection under a topic, domain or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param privateEndpointConnection The private endpoint connection object to update. * @param context The context to associate with this operation. @@ -101,11 +109,13 @@ SyncPoller, PrivateEndpointConnection Context context); /** - * Update a specific private endpoint connection under a topic or domain. + * Update a specific private endpoint connection under a topic, domain or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param privateEndpointConnection The private endpoint connection object to update. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -122,11 +132,13 @@ PrivateEndpointConnectionInner update( PrivateEndpointConnectionInner privateEndpointConnection); /** - * Update a specific private endpoint connection under a topic or domain. + * Update a specific private endpoint connection under a topic, domain or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param privateEndpointConnection The private endpoint connection object to update. * @param context The context to associate with this operation. @@ -145,11 +157,13 @@ PrivateEndpointConnectionInner update( Context context); /** - * Delete a specific private endpoint connection under a topic or domain. + * Delete a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -164,11 +178,13 @@ SyncPoller, Void> beginDelete( String privateEndpointConnectionName); /** - * Delete a specific private endpoint connection under a topic or domain. + * Delete a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -185,11 +201,13 @@ SyncPoller, Void> beginDelete( Context context); /** - * Delete a specific private endpoint connection under a topic or domain. + * Delete a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -203,11 +221,13 @@ void delete( String privateEndpointConnectionName); /** - * Delete a specific private endpoint connection under a topic or domain. + * Delete a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -223,26 +243,30 @@ void delete( Context context); /** - * Get all private endpoint connections under a topic or domain. + * Get all private endpoint connections under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @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 all private endpoint connections under a topic or domain. + * @return all private endpoint connections under a topic, domain, or partner namespace. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResource( String resourceGroupName, PrivateEndpointConnectionsParentType parentType, String parentName); /** - * Get all private endpoint connections under a topic or domain. + * Get all private endpoint connections under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the * 'name' property only and with limited number of OData operations. These operations are: the 'contains' * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). @@ -255,7 +279,7 @@ PagedIterable listByResource( * @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 all private endpoint connections under a topic or domain. + * @return all private endpoint connections under a topic, domain, or partner namespace. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResource( diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/PrivateLinkResourcesClient.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/PrivateLinkResourcesClient.java index 4c4194990383b..981f54ced396b 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/PrivateLinkResourcesClient.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/PrivateLinkResourcesClient.java @@ -17,8 +17,10 @@ public interface PrivateLinkResourcesClient { * Get properties of a private link resource. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateLinkResourceName The name of private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -33,8 +35,10 @@ PrivateLinkResourceInner get( * Get properties of a private link resource. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateLinkResourceName The name of private link resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -51,11 +55,13 @@ Response getWithResponse( Context context); /** - * List all the private link resources under a topic or domain. + * List all the private link resources under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @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. @@ -66,11 +72,13 @@ PagedIterable listByResource( String resourceGroupName, String parentType, String parentName); /** - * List all the private link resources under a topic or domain. + * List all the private link resources under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the * 'name' property only and with limited number of OData operations. These operations are: the 'contains' * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/SystemTopicEventSubscriptionsClient.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/SystemTopicEventSubscriptionsClient.java new file mode 100644 index 0000000000000..d262c1711b10a --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/SystemTopicEventSubscriptionsClient.java @@ -0,0 +1,388 @@ +// 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.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.eventgrid.fluent.models.DeliveryAttributeListResultInner; +import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionFullUrlInner; +import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner; +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters; + +/** An instance of this class provides access to all the operations defined in SystemTopicEventSubscriptionsClient. */ +public interface SystemTopicEventSubscriptionsClient { + /** + * Get an event subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 an event subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EventSubscriptionInner get(String resourceGroupName, String systemTopicName, String eventSubscriptionName); + + /** + * Get an event subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 an event subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context); + + /** + * Asynchronously creates or updates an event subscription with the specified parameters. Existing event + * subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, EventSubscriptionInner> beginCreateOrUpdate( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo); + + /** + * Asynchronously creates or updates an event subscription with the specified parameters. Existing event + * subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, EventSubscriptionInner> beginCreateOrUpdate( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo, + Context context); + + /** + * Asynchronously creates or updates an event subscription with the specified parameters. Existing event + * subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EventSubscriptionInner createOrUpdate( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo); + + /** + * Asynchronously creates or updates an event subscription with the specified parameters. Existing event + * subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EventSubscriptionInner createOrUpdate( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo, + Context context); + + /** + * Delete an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String systemTopicName, String eventSubscriptionName); + + /** + * Delete an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context); + + /** + * Delete an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String systemTopicName, String eventSubscriptionName); + + /** + * Delete an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context); + + /** + * Update event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, EventSubscriptionInner> beginUpdate( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters); + + /** + * Update event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, EventSubscriptionInner> beginUpdate( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, + Context context); + + /** + * Update event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EventSubscriptionInner update( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters); + + /** + * Update event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EventSubscriptionInner update( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, + Context context); + + /** + * Get the full endpoint URL for an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 full endpoint URL for an event subscription of a system topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EventSubscriptionFullUrlInner getFullUrl( + String resourceGroupName, String systemTopicName, String eventSubscriptionName); + + /** + * Get the full endpoint URL for an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 full endpoint URL for an event subscription of a system topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getFullUrlWithResponse( + String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context); + + /** + * List event subscriptions that belong to a specific system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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 result of the List EventSubscriptions operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySystemTopic(String resourceGroupName, String systemTopicName); + + /** + * List event subscriptions that belong to a specific system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List EventSubscriptions operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySystemTopic( + String resourceGroupName, String systemTopicName, String filter, Integer top, Context context); + + /** + * Get all delivery attributes for an event subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 all delivery attributes for an event subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeliveryAttributeListResultInner getDeliveryAttributes( + String resourceGroupName, String systemTopicName, String eventSubscriptionName); + + /** + * Get all delivery attributes for an event subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 all delivery attributes for an event subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDeliveryAttributesWithResponse( + String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context); +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/SystemTopicsClient.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/SystemTopicsClient.java new file mode 100644 index 0000000000000..bd32ce30c7f17 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/SystemTopicsClient.java @@ -0,0 +1,291 @@ +// 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.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.eventgrid.fluent.models.SystemTopicInner; +import com.azure.resourcemanager.eventgrid.models.SystemTopicUpdateParameters; + +/** An instance of this class provides access to all the operations defined in SystemTopicsClient. */ +public interface SystemTopicsClient { + /** + * Get properties of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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 properties of a system topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SystemTopicInner getByResourceGroup(String resourceGroupName, String systemTopicName); + + /** + * Get properties of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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 properties of a system topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String systemTopicName, Context context); + + /** + * Asynchronously creates a new system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicInfo System Topic information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SystemTopicInner> beginCreateOrUpdate( + String resourceGroupName, String systemTopicName, SystemTopicInner systemTopicInfo); + + /** + * Asynchronously creates a new system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicInfo System Topic information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SystemTopicInner> beginCreateOrUpdate( + String resourceGroupName, String systemTopicName, SystemTopicInner systemTopicInfo, Context context); + + /** + * Asynchronously creates a new system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicInfo System Topic information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SystemTopicInner createOrUpdate(String resourceGroupName, String systemTopicName, SystemTopicInner systemTopicInfo); + + /** + * Asynchronously creates a new system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicInfo System Topic information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SystemTopicInner createOrUpdate( + String resourceGroupName, String systemTopicName, SystemTopicInner systemTopicInfo, Context context); + + /** + * Delete existing system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String systemTopicName); + + /** + * Delete existing system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String systemTopicName, Context context); + + /** + * Delete existing system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String systemTopicName); + + /** + * Delete existing system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String systemTopicName, Context context); + + /** + * Asynchronously updates a system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicUpdateParameters SystemTopic update information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SystemTopicInner> beginUpdate( + String resourceGroupName, String systemTopicName, SystemTopicUpdateParameters systemTopicUpdateParameters); + + /** + * Asynchronously updates a system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicUpdateParameters SystemTopic update information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SystemTopicInner> beginUpdate( + String resourceGroupName, + String systemTopicName, + SystemTopicUpdateParameters systemTopicUpdateParameters, + Context context); + + /** + * Asynchronously updates a system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicUpdateParameters SystemTopic update information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SystemTopicInner update( + String resourceGroupName, String systemTopicName, SystemTopicUpdateParameters systemTopicUpdateParameters); + + /** + * Asynchronously updates a system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicUpdateParameters SystemTopic update information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SystemTopicInner update( + String resourceGroupName, + String systemTopicName, + SystemTopicUpdateParameters systemTopicUpdateParameters, + Context context); + + /** + * List all the system topics under an Azure subscription. + * + * @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 result of the List System topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List all the system topics under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List System topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Integer top, Context context); + + /** + * List all the system topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 result of the List System topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all the system topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List System topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup( + String resourceGroupName, String filter, Integer top, Context context); +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/DeliveryAttributeListResultInner.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/DeliveryAttributeListResultInner.java new file mode 100644 index 0000000000000..d52a5c5c7a478 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/DeliveryAttributeListResultInner.java @@ -0,0 +1,55 @@ +// 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.azure.resourcemanager.eventgrid.models.DeliveryAttributeMapping; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Result of the Get delivery attributes operation. */ +@Fluent +public final class DeliveryAttributeListResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryAttributeListResultInner.class); + + /* + * A collection of DeliveryAttributeMapping + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: A collection of DeliveryAttributeMapping. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of DeliveryAttributeMapping. + * + * @param value the value value to set. + * @return the DeliveryAttributeListResultInner object itself. + */ + public DeliveryAttributeListResultInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/DomainInner.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/DomainInner.java index a6789d7892ffa..08a6cc55f92ef 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/DomainInner.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/DomainInner.java @@ -10,10 +10,12 @@ import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.eventgrid.models.DomainProvisioningState; +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; import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; +import com.azure.resourcemanager.eventgrid.models.ResourceSku; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -26,7 +28,19 @@ public class DomainInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(DomainInner.class); /* - * The system metadata relating to Domain resource. + * The Sku pricing tier for the Event Grid Domain resource. + */ + @JsonProperty(value = "sku") + private ResourceSku sku; + + /* + * Identity information for the Event Grid Domain resource. + */ + @JsonProperty(value = "identity") + private IdentityInfo identity; + + /* + * The system metadata relating to the Event Grid Domain resource. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; @@ -38,20 +52,21 @@ public class DomainInner extends Resource { private List privateEndpointConnections; /* - * Provisioning state of the domain. + * Provisioning state of the Event Grid Domain Resource. */ @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) private DomainProvisioningState provisioningState; /* - * Endpoint for the domain. + * Endpoint for the Event Grid Domain Resource which is used for publishing + * the events. */ @JsonProperty(value = "properties.endpoint", access = JsonProperty.Access.WRITE_ONLY) private String endpoint; /* * This determines the format that Event Grid should expect for incoming - * events published to the domain. + * events published to the Event Grid Domain Resource. */ @JsonProperty(value = "properties.inputSchema") private InputSchema inputSchema; @@ -64,7 +79,7 @@ public class DomainInner extends Resource { private InputSchemaMapping inputSchemaMapping; /* - * Metric resource id for the domain. + * Metric resource id for the Event Grid Domain Resource. */ @JsonProperty(value = "properties.metricResourceId", access = JsonProperty.Access.WRITE_ONLY) private String metricResourceId; @@ -86,8 +101,104 @@ public class DomainInner extends Resource { @JsonProperty(value = "properties.inboundIpRules") private List inboundIpRules; + /* + * This boolean is used to enable or disable local auth. Default value is + * false. When the property is set to true, only AAD token will be used to + * authenticate if user is allowed to publish to the domain. + */ + @JsonProperty(value = "properties.disableLocalAuth") + private Boolean disableLocalAuth; + + /* + * This Boolean is used to specify the creation mechanism for 'all' the + * Event Grid Domain Topics associated with this Event Grid Domain + * resource. + * In this context, creation of domain topic can be auto-managed (when + * true) or self-managed (when false). The default value for this property + * is true. + * When this property is null or set to true, Event Grid is responsible of + * automatically creating the domain topic when the first event + * subscription is + * created at the scope of the domain topic. If this property is set to + * false, then creating the first event subscription will require creating + * a domain topic + * by the user. The self-management mode can be used if the user wants full + * control of when the domain topic is created, while auto-managed mode + * provides the + * flexibility to perform less operations and manage fewer resources by the + * user. Also, note that in auto-managed creation mode, user is allowed to + * create the + * domain topic on demand if needed. + */ + @JsonProperty(value = "properties.autoCreateTopicWithFirstSubscription") + private Boolean autoCreateTopicWithFirstSubscription; + + /* + * This Boolean is used to specify the deletion mechanism for 'all' the + * Event Grid Domain Topics associated with this Event Grid Domain + * resource. + * In this context, deletion of domain topic can be auto-managed (when + * true) or self-managed (when false). The default value for this property + * is true. + * When this property is set to true, Event Grid is responsible of + * automatically deleting the domain topic when the last event subscription + * at the scope + * of the domain topic is deleted. If this property is set to false, then + * the user needs to manually delete the domain topic when it is no longer + * needed + * (e.g., when last event subscription is deleted and the resource needs to + * be cleaned up). The self-management mode can be used if the user wants + * full + * control of when the domain topic needs to be deleted, while auto-managed + * mode provides the flexibility to perform less operations and manage + * fewer + * resources by the user. + */ + @JsonProperty(value = "properties.autoDeleteTopicWithLastSubscription") + private Boolean autoDeleteTopicWithLastSubscription; + + /** + * Get the sku property: The Sku pricing tier for the Event Grid Domain resource. + * + * @return the sku value. + */ + public ResourceSku sku() { + return this.sku; + } + + /** + * Set the sku property: The Sku pricing tier for the Event Grid Domain resource. + * + * @param sku the sku value to set. + * @return the DomainInner object itself. + */ + public DomainInner withSku(ResourceSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the identity property: Identity information for the Event Grid Domain resource. + * + * @return the identity value. + */ + public IdentityInfo identity() { + return this.identity; + } + + /** + * Set the identity property: Identity information for the Event Grid Domain resource. + * + * @param identity the identity value to set. + * @return the DomainInner object itself. + */ + public DomainInner withIdentity(IdentityInfo identity) { + this.identity = identity; + return this; + } + /** - * Get the systemData property: The system metadata relating to Domain resource. + * Get the systemData property: The system metadata relating to the Event Grid Domain resource. * * @return the systemData value. */ @@ -105,7 +216,7 @@ public List privateEndpointConnections() { } /** - * Get the provisioningState property: Provisioning state of the domain. + * Get the provisioningState property: Provisioning state of the Event Grid Domain Resource. * * @return the provisioningState value. */ @@ -114,7 +225,7 @@ public DomainProvisioningState provisioningState() { } /** - * Get the endpoint property: Endpoint for the domain. + * Get the endpoint property: Endpoint for the Event Grid Domain Resource which is used for publishing the events. * * @return the endpoint value. */ @@ -124,7 +235,7 @@ public String endpoint() { /** * Get the inputSchema property: This determines the format that Event Grid should expect for incoming events - * published to the domain. + * published to the Event Grid Domain Resource. * * @return the inputSchema value. */ @@ -134,7 +245,7 @@ public InputSchema inputSchema() { /** * Set the inputSchema property: This determines the format that Event Grid should expect for incoming events - * published to the domain. + * published to the Event Grid Domain Resource. * * @param inputSchema the inputSchema value to set. * @return the DomainInner object itself. @@ -167,7 +278,7 @@ public DomainInner withInputSchemaMapping(InputSchemaMapping inputSchemaMapping) } /** - * Get the metricResourceId property: Metric resource id for the domain. + * Get the metricResourceId property: Metric resource id for the Event Grid Domain Resource. * * @return the metricResourceId value. */ @@ -221,6 +332,102 @@ public DomainInner withInboundIpRules(List inboundIpRules) { return this; } + /** + * Get the disableLocalAuth property: This boolean is used to enable or disable local auth. Default value is false. + * When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to + * the domain. + * + * @return the disableLocalAuth value. + */ + public Boolean disableLocalAuth() { + return this.disableLocalAuth; + } + + /** + * Set the disableLocalAuth property: This boolean is used to enable or disable local auth. Default value is false. + * When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to + * the domain. + * + * @param disableLocalAuth the disableLocalAuth value to set. + * @return the DomainInner object itself. + */ + public DomainInner withDisableLocalAuth(Boolean disableLocalAuth) { + this.disableLocalAuth = disableLocalAuth; + return this; + } + + /** + * Get the autoCreateTopicWithFirstSubscription property: This Boolean is used to specify the creation mechanism for + * 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this context, creation of + * domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is + * true. When this property is null or set to true, Event Grid is responsible of automatically creating the domain + * topic when the first event subscription is created at the scope of the domain topic. If this property is set to + * false, then creating the first event subscription will require creating a domain topic by the user. The + * self-management mode can be used if the user wants full control of when the domain topic is created, while + * auto-managed mode provides the flexibility to perform less operations and manage fewer resources by the user. + * Also, note that in auto-managed creation mode, user is allowed to create the domain topic on demand if needed. + * + * @return the autoCreateTopicWithFirstSubscription value. + */ + public Boolean autoCreateTopicWithFirstSubscription() { + return this.autoCreateTopicWithFirstSubscription; + } + + /** + * Set the autoCreateTopicWithFirstSubscription property: This Boolean is used to specify the creation mechanism for + * 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this context, creation of + * domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is + * true. When this property is null or set to true, Event Grid is responsible of automatically creating the domain + * topic when the first event subscription is created at the scope of the domain topic. If this property is set to + * false, then creating the first event subscription will require creating a domain topic by the user. The + * self-management mode can be used if the user wants full control of when the domain topic is created, while + * auto-managed mode provides the flexibility to perform less operations and manage fewer resources by the user. + * Also, note that in auto-managed creation mode, user is allowed to create the domain topic on demand if needed. + * + * @param autoCreateTopicWithFirstSubscription the autoCreateTopicWithFirstSubscription value to set. + * @return the DomainInner object itself. + */ + public DomainInner withAutoCreateTopicWithFirstSubscription(Boolean autoCreateTopicWithFirstSubscription) { + this.autoCreateTopicWithFirstSubscription = autoCreateTopicWithFirstSubscription; + return this; + } + + /** + * Get the autoDeleteTopicWithLastSubscription property: This Boolean is used to specify the deletion mechanism for + * 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this context, deletion of + * domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is + * true. When this property is set to true, Event Grid is responsible of automatically deleting the domain topic + * when the last event subscription at the scope of the domain topic is deleted. If this property is set to false, + * then the user needs to manually delete the domain topic when it is no longer needed (e.g., when last event + * subscription is deleted and the resource needs to be cleaned up). The self-management mode can be used if the + * user wants full control of when the domain topic needs to be deleted, while auto-managed mode provides the + * flexibility to perform less operations and manage fewer resources by the user. + * + * @return the autoDeleteTopicWithLastSubscription value. + */ + public Boolean autoDeleteTopicWithLastSubscription() { + return this.autoDeleteTopicWithLastSubscription; + } + + /** + * Set the autoDeleteTopicWithLastSubscription property: This Boolean is used to specify the deletion mechanism for + * 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this context, deletion of + * domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is + * true. When this property is set to true, Event Grid is responsible of automatically deleting the domain topic + * when the last event subscription at the scope of the domain topic is deleted. If this property is set to false, + * then the user needs to manually delete the domain topic when it is no longer needed (e.g., when last event + * subscription is deleted and the resource needs to be cleaned up). The self-management mode can be used if the + * user wants full control of when the domain topic needs to be deleted, while auto-managed mode provides the + * flexibility to perform less operations and manage fewer resources by the user. + * + * @param autoDeleteTopicWithLastSubscription the autoDeleteTopicWithLastSubscription value to set. + * @return the DomainInner object itself. + */ + public DomainInner withAutoDeleteTopicWithLastSubscription(Boolean autoDeleteTopicWithLastSubscription) { + this.autoDeleteTopicWithLastSubscription = autoDeleteTopicWithLastSubscription; + return this; + } + /** {@inheritDoc} */ @Override public DomainInner withLocation(String location) { @@ -241,6 +448,12 @@ public DomainInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (sku() != null) { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } if (privateEndpointConnections() != null) { privateEndpointConnections().forEach(e -> e.validate()); } diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/EventChannelInner.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/EventChannelInner.java new file mode 100644 index 0000000000000..f90a4c6bff511 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/EventChannelInner.java @@ -0,0 +1,235 @@ +// 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.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.eventgrid.models.EventChannelDestination; +import com.azure.resourcemanager.eventgrid.models.EventChannelFilter; +import com.azure.resourcemanager.eventgrid.models.EventChannelProvisioningState; +import com.azure.resourcemanager.eventgrid.models.EventChannelSource; +import com.azure.resourcemanager.eventgrid.models.PartnerTopicReadinessState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Event Channel. */ +@JsonFlatten +@Fluent +public class EventChannelInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventChannelInner.class); + + /* + * The system metadata relating to Event Channel resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Source of the event channel. This represents a unique resource in the + * partner's resource model. + */ + @JsonProperty(value = "properties.source") + private EventChannelSource source; + + /* + * Represents the destination of an event channel. + */ + @JsonProperty(value = "properties.destination") + private EventChannelDestination destination; + + /* + * Provisioning state of the event channel. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private EventChannelProvisioningState provisioningState; + + /* + * The readiness state of the corresponding partner topic. + */ + @JsonProperty(value = "properties.partnerTopicReadinessState", access = JsonProperty.Access.WRITE_ONLY) + private PartnerTopicReadinessState partnerTopicReadinessState; + + /* + * Expiration time of the event channel. If this timer expires while the + * corresponding partner topic is never activated, + * the event channel and corresponding partner topic are deleted. + */ + @JsonProperty(value = "properties.expirationTimeIfNotActivatedUtc") + private OffsetDateTime expirationTimeIfNotActivatedUtc; + + /* + * Information about the filter for the event channel. + */ + @JsonProperty(value = "properties.filter") + private EventChannelFilter filter; + + /* + * Friendly description about the topic. This can be set by the + * publisher/partner to show custom description for the customer partner + * topic. + * This will be helpful to remove any ambiguity of the origin of creation + * of the partner topic for the customer. + */ + @JsonProperty(value = "properties.partnerTopicFriendlyDescription") + private String partnerTopicFriendlyDescription; + + /** + * Get the systemData property: The system metadata relating to Event Channel resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the source property: Source of the event channel. This represents a unique resource in the partner's resource + * model. + * + * @return the source value. + */ + public EventChannelSource source() { + return this.source; + } + + /** + * Set the source property: Source of the event channel. This represents a unique resource in the partner's resource + * model. + * + * @param source the source value to set. + * @return the EventChannelInner object itself. + */ + public EventChannelInner withSource(EventChannelSource source) { + this.source = source; + return this; + } + + /** + * Get the destination property: Represents the destination of an event channel. + * + * @return the destination value. + */ + public EventChannelDestination destination() { + return this.destination; + } + + /** + * Set the destination property: Represents the destination of an event channel. + * + * @param destination the destination value to set. + * @return the EventChannelInner object itself. + */ + public EventChannelInner withDestination(EventChannelDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the event channel. + * + * @return the provisioningState value. + */ + public EventChannelProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the partnerTopicReadinessState property: The readiness state of the corresponding partner topic. + * + * @return the partnerTopicReadinessState value. + */ + public PartnerTopicReadinessState partnerTopicReadinessState() { + return this.partnerTopicReadinessState; + } + + /** + * Get the expirationTimeIfNotActivatedUtc property: Expiration time of the event channel. If this timer expires + * while the corresponding partner topic is never activated, the event channel and corresponding partner topic are + * deleted. + * + * @return the expirationTimeIfNotActivatedUtc value. + */ + public OffsetDateTime expirationTimeIfNotActivatedUtc() { + return this.expirationTimeIfNotActivatedUtc; + } + + /** + * Set the expirationTimeIfNotActivatedUtc property: Expiration time of the event channel. If this timer expires + * while the corresponding partner topic is never activated, the event channel and corresponding partner topic are + * deleted. + * + * @param expirationTimeIfNotActivatedUtc the expirationTimeIfNotActivatedUtc value to set. + * @return the EventChannelInner object itself. + */ + public EventChannelInner withExpirationTimeIfNotActivatedUtc(OffsetDateTime expirationTimeIfNotActivatedUtc) { + this.expirationTimeIfNotActivatedUtc = expirationTimeIfNotActivatedUtc; + return this; + } + + /** + * Get the filter property: Information about the filter for the event channel. + * + * @return the filter value. + */ + public EventChannelFilter filter() { + return this.filter; + } + + /** + * Set the filter property: Information about the filter for the event channel. + * + * @param filter the filter value to set. + * @return the EventChannelInner object itself. + */ + public EventChannelInner withFilter(EventChannelFilter filter) { + this.filter = filter; + return this; + } + + /** + * Get the partnerTopicFriendlyDescription property: Friendly description about the topic. This can be set by the + * publisher/partner to show custom description for the customer partner topic. This will be helpful to remove any + * ambiguity of the origin of creation of the partner topic for the customer. + * + * @return the partnerTopicFriendlyDescription value. + */ + public String partnerTopicFriendlyDescription() { + return this.partnerTopicFriendlyDescription; + } + + /** + * Set the partnerTopicFriendlyDescription property: Friendly description about the topic. This can be set by the + * publisher/partner to show custom description for the customer partner topic. This will be helpful to remove any + * ambiguity of the origin of creation of the partner topic for the customer. + * + * @param partnerTopicFriendlyDescription the partnerTopicFriendlyDescription value to set. + * @return the EventChannelInner object itself. + */ + public EventChannelInner withPartnerTopicFriendlyDescription(String partnerTopicFriendlyDescription) { + this.partnerTopicFriendlyDescription = partnerTopicFriendlyDescription; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() != null) { + source().validate(); + } + if (destination() != null) { + destination().validate(); + } + if (filter() != null) { + filter().validate(); + } + } +} 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 8e3d8223713d8..0850862cd1ea9 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 @@ -10,6 +10,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; @@ -47,10 +49,22 @@ public class EventSubscriptionInner extends ProxyResource { /* * 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 = "properties.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 = "properties.deliveryWithResourceIdentity") + private DeliveryWithResourceIdentity deliveryWithResourceIdentity; + /* * Information about the filter for the event subscription. */ @@ -83,11 +97,26 @@ public class EventSubscriptionInner extends ProxyResource { private RetryPolicy retryPolicy; /* - * The DeadLetter destination of the event subscription. + * 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 Azure Event Grid's identity to acquire the authentication tokens + * being used during delivery / dead-lettering. */ @JsonProperty(value = "properties.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 = "properties.deadLetterWithResourceIdentity") + private DeadLetterWithResourceIdentity deadLetterWithResourceIdentity; + /** * Get the systemData property: The system metadata relating to Event Subscription resource. * @@ -117,7 +146,8 @@ public EventSubscriptionProvisioningState provisioningState() { /** * Get the destination property: Information about the destination where events have to be delivered for the event - * subscription. + * subscription. Uses Azure Event Grid's identity to acquire the authentication tokens being used during delivery / + * dead-lettering. * * @return the destination value. */ @@ -127,7 +157,8 @@ public EventSubscriptionDestination destination() { /** * Set the destination property: Information about the destination where events have to be delivered for the event - * subscription. + * 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 EventSubscriptionInner object itself. @@ -137,6 +168,31 @@ 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.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) { + this.deliveryWithResourceIdentity = deliveryWithResourceIdentity; + return this; + } + /** * Get the filter property: Information about the filter for the event subscription. * @@ -240,7 +296,9 @@ public EventSubscriptionInner withRetryPolicy(RetryPolicy retryPolicy) { } /** - * Get the deadLetterDestination property: The DeadLetter destination of the event subscription. + * Get the deadLetterDestination 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 Azure Event Grid's identity + * to acquire the authentication tokens being used during delivery / dead-lettering. * * @return the deadLetterDestination value. */ @@ -249,7 +307,9 @@ public DeadLetterDestination deadLetterDestination() { } /** - * Set the deadLetterDestination property: The DeadLetter destination of the event subscription. + * Set the deadLetterDestination 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 Azure Event Grid's identity + * to acquire the authentication tokens being used during delivery / dead-lettering. * * @param deadLetterDestination the deadLetterDestination value to set. * @return the EventSubscriptionInner object itself. @@ -259,6 +319,33 @@ 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.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) { + this.deadLetterWithResourceIdentity = deadLetterWithResourceIdentity; + return this; + } + /** * Validates the instance. * @@ -268,6 +355,9 @@ public void validate() { if (destination() != null) { destination().validate(); } + if (deliveryWithResourceIdentity() != null) { + deliveryWithResourceIdentity().validate(); + } if (filter() != null) { filter().validate(); } @@ -277,5 +367,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 0000000000000..ac9f5bdbe27f0 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/ExtensionTopicInner.java @@ -0,0 +1,79 @@ +// 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.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +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. */ +@JsonFlatten +@Fluent +public class ExtensionTopicInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtensionTopicInner.class); + + /* + * Description of the extension topic. + */ + @JsonProperty(value = "properties.description") + private String description; + + /* + * System topic resource id which is mapped to the source. + */ + @JsonProperty(value = "properties.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 ExtensionTopicInner object itself. + */ + public ExtensionTopicInner 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 ExtensionTopicInner object itself. + */ + public ExtensionTopicInner 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/OperationInner.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/OperationInner.java index c834a95f0038e..3f6937b156d2f 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/OperationInner.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/OperationInner.java @@ -33,6 +33,13 @@ public final class OperationInner { @JsonProperty(value = "origin") private String origin; + /* + * This Boolean is used to determine if the operation is a data plane + * action or not. + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + /* * Properties of the operation */ @@ -99,6 +106,26 @@ public OperationInner withOrigin(String origin) { return this; } + /** + * Get the isDataAction property: This Boolean is used to determine if the operation is a data plane action or not. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: This Boolean is used to determine if the operation is a data plane action or not. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationInner object itself. + */ + public OperationInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + /** * Get the properties property: Properties of the operation. * diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/PartnerNamespaceInner.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/PartnerNamespaceInner.java new file mode 100644 index 0000000000000..1bbbb5bc79820 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/PartnerNamespaceInner.java @@ -0,0 +1,242 @@ +// 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.annotation.JsonFlatten; +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.InboundIpRule; +import com.azure.resourcemanager.eventgrid.models.PartnerNamespaceProvisioningState; +import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** EventGrid Partner Namespace. */ +@JsonFlatten +@Fluent +public class PartnerNamespaceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PartnerNamespaceInner.class); + + /* + * The system metadata relating to Partner Namespace resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * The privateEndpointConnections property. + */ + @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /* + * Provisioning state of the partner namespace. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PartnerNamespaceProvisioningState provisioningState; + + /* + * The fully qualified ARM Id of the partner registration that should be + * associated with this partner namespace. This takes the following format: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}. + */ + @JsonProperty(value = "properties.partnerRegistrationFullyQualifiedId") + private String partnerRegistrationFullyQualifiedId; + + /* + * Endpoint for the partner namespace. + */ + @JsonProperty(value = "properties.endpoint", access = JsonProperty.Access.WRITE_ONLY) + private String endpoint; + + /* + * This determines if traffic is allowed over public network. By default it + * is enabled. + * You can further restrict to specific IPs by configuring + */ + @JsonProperty(value = "properties.publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * This can be used to restrict traffic from specific IPs instead of all + * IPs. Note: These are considered only if PublicNetworkAccess is enabled. + */ + @JsonProperty(value = "properties.inboundIpRules") + private List inboundIpRules; + + /* + * This boolean is used to enable or disable local auth. Default value is + * false. When the property is set to true, only AAD token will be used to + * authenticate if user is allowed to publish to the partner namespace. + */ + @JsonProperty(value = "properties.disableLocalAuth") + private Boolean disableLocalAuth; + + /** + * Get the systemData property: The system metadata relating to Partner Namespace resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the privateEndpointConnections property: The privateEndpointConnections property. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get the provisioningState property: Provisioning state of the partner namespace. + * + * @return the provisioningState value. + */ + public PartnerNamespaceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the partnerRegistrationFullyQualifiedId property: The fully qualified ARM Id of the partner registration that + * should be associated with this partner namespace. This takes the following format: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}. + * + * @return the partnerRegistrationFullyQualifiedId value. + */ + public String partnerRegistrationFullyQualifiedId() { + return this.partnerRegistrationFullyQualifiedId; + } + + /** + * Set the partnerRegistrationFullyQualifiedId property: The fully qualified ARM Id of the partner registration that + * should be associated with this partner namespace. This takes the following format: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}. + * + * @param partnerRegistrationFullyQualifiedId the partnerRegistrationFullyQualifiedId value to set. + * @return the PartnerNamespaceInner object itself. + */ + public PartnerNamespaceInner withPartnerRegistrationFullyQualifiedId(String partnerRegistrationFullyQualifiedId) { + this.partnerRegistrationFullyQualifiedId = partnerRegistrationFullyQualifiedId; + return this; + } + + /** + * Get the endpoint property: Endpoint for the partner namespace. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Get the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is + * enabled. You can further restrict to specific IPs by configuring <seealso + * cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.PartnerNamespaceProperties.InboundIpRules" + * />. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is + * enabled. You can further restrict to specific IPs by configuring <seealso + * cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.PartnerNamespaceProperties.InboundIpRules" + * />. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the PartnerNamespaceInner object itself. + */ + public PartnerNamespaceInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the inboundIpRules property: This can be used to restrict traffic from specific IPs instead of all IPs. Note: + * These are considered only if PublicNetworkAccess is enabled. + * + * @return the inboundIpRules value. + */ + public List inboundIpRules() { + return this.inboundIpRules; + } + + /** + * Set the inboundIpRules property: This can be used to restrict traffic from specific IPs instead of all IPs. Note: + * These are considered only if PublicNetworkAccess is enabled. + * + * @param inboundIpRules the inboundIpRules value to set. + * @return the PartnerNamespaceInner object itself. + */ + public PartnerNamespaceInner withInboundIpRules(List inboundIpRules) { + this.inboundIpRules = inboundIpRules; + return this; + } + + /** + * Get the disableLocalAuth property: This boolean is used to enable or disable local auth. Default value is false. + * When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to + * the partner namespace. + * + * @return the disableLocalAuth value. + */ + public Boolean disableLocalAuth() { + return this.disableLocalAuth; + } + + /** + * Set the disableLocalAuth property: This boolean is used to enable or disable local auth. Default value is false. + * When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to + * the partner namespace. + * + * @param disableLocalAuth the disableLocalAuth value to set. + * @return the PartnerNamespaceInner object itself. + */ + public PartnerNamespaceInner withDisableLocalAuth(Boolean disableLocalAuth) { + this.disableLocalAuth = disableLocalAuth; + return this; + } + + /** {@inheritDoc} */ + @Override + public PartnerNamespaceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public PartnerNamespaceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + if (inboundIpRules() != null) { + inboundIpRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/PartnerNamespaceSharedAccessKeysInner.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/PartnerNamespaceSharedAccessKeysInner.java new file mode 100644 index 0000000000000..e9b2ff0c26788 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/PartnerNamespaceSharedAccessKeysInner.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; + +/** Shared access keys of the partner namespace. */ +@Fluent +public final class PartnerNamespaceSharedAccessKeysInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PartnerNamespaceSharedAccessKeysInner.class); + + /* + * Shared access key1 for the partner namespace. + */ + @JsonProperty(value = "key1") + private String key1; + + /* + * Shared access key2 for the partner namespace. + */ + @JsonProperty(value = "key2") + private String key2; + + /** + * Get the key1 property: Shared access key1 for the partner namespace. + * + * @return the key1 value. + */ + public String key1() { + return this.key1; + } + + /** + * Set the key1 property: Shared access key1 for the partner namespace. + * + * @param key1 the key1 value to set. + * @return the PartnerNamespaceSharedAccessKeysInner object itself. + */ + public PartnerNamespaceSharedAccessKeysInner withKey1(String key1) { + this.key1 = key1; + return this; + } + + /** + * Get the key2 property: Shared access key2 for the partner namespace. + * + * @return the key2 value. + */ + public String key2() { + return this.key2; + } + + /** + * Set the key2 property: Shared access key2 for the partner namespace. + * + * @param key2 the key2 value to set. + * @return the PartnerNamespaceSharedAccessKeysInner object itself. + */ + public PartnerNamespaceSharedAccessKeysInner withKey2(String key2) { + this.key2 = key2; + 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/PartnerRegistrationInner.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/PartnerRegistrationInner.java new file mode 100644 index 0000000000000..dee8234a62bfa --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/PartnerRegistrationInner.java @@ -0,0 +1,429 @@ +// 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.annotation.JsonFlatten; +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.PartnerRegistrationProvisioningState; +import com.azure.resourcemanager.eventgrid.models.PartnerRegistrationVisibilityState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Information about a partner registration. */ +@JsonFlatten +@Fluent +public class PartnerRegistrationInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PartnerRegistrationInner.class); + + /* + * The system metadata relating to Partner Registration resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Provisioning state of the partner registration. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PartnerRegistrationProvisioningState provisioningState; + + /* + * Official name of the partner name. For example: "Contoso". + */ + @JsonProperty(value = "properties.partnerName") + private String partnerName; + + /* + * Name of the partner resource type. + */ + @JsonProperty(value = "properties.partnerResourceTypeName") + private String partnerResourceTypeName; + + /* + * Display name of the partner resource type. + */ + @JsonProperty(value = "properties.partnerResourceTypeDisplayName") + private String partnerResourceTypeDisplayName; + + /* + * Short description of the partner resource type. The length of this + * description should not exceed 256 characters. + */ + @JsonProperty(value = "properties.partnerResourceTypeDescription") + private String partnerResourceTypeDescription; + + /* + * Long description for the custom scenarios and integration to be + * displayed in the portal if needed. + * Length of this description should not exceed 2048 characters. + */ + @JsonProperty(value = "properties.longDescription") + private String longDescription; + + /* + * The customer service number of the publisher. The expected phone format + * should start with a '+' sign + * followed by the country code. The remaining digits are then followed. + * Only digits and spaces are allowed and its + * length cannot exceed 16 digits including country code. Examples of valid + * phone numbers are: +1 515 123 4567 and + * +966 7 5115 2471. Examples of invalid phone numbers are: +1 (515) + * 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 1234 43 + */ + @JsonProperty(value = "properties.partnerCustomerServiceNumber") + private String partnerCustomerServiceNumber; + + /* + * The extension of the customer service number of the publisher. Only + * digits are allowed and number of digits should not exceed 10. + */ + @JsonProperty(value = "properties.partnerCustomerServiceExtension") + private String partnerCustomerServiceExtension; + + /* + * The extension of the customer service URI of the publisher. + */ + @JsonProperty(value = "properties.customerServiceUri") + private String customerServiceUri; + + /* + * URI of the partner website that can be used by Azure customers to setup + * Event Grid + * integration on an event source. + */ + @JsonProperty(value = "properties.setupUri") + private String setupUri; + + /* + * URI of the logo. + */ + @JsonProperty(value = "properties.logoUri") + private String logoUri; + + /* + * Visibility state of the partner registration. + */ + @JsonProperty(value = "properties.visibilityState") + private PartnerRegistrationVisibilityState visibilityState; + + /* + * List of Azure subscription Ids that are authorized to create a partner + * namespace + * associated with this partner registration. This is an optional property. + * Creating + * partner namespaces is always permitted under the same Azure subscription + * as the one used + * for creating the partner registration. + */ + @JsonProperty(value = "properties.authorizedAzureSubscriptionIds") + private List authorizedAzureSubscriptionIds; + + /** + * Get the systemData property: The system metadata relating to Partner Registration resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the provisioningState property: Provisioning state of the partner registration. + * + * @return the provisioningState value. + */ + public PartnerRegistrationProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the partnerName property: Official name of the partner name. For example: "Contoso". + * + * @return the partnerName value. + */ + public String partnerName() { + return this.partnerName; + } + + /** + * Set the partnerName property: Official name of the partner name. For example: "Contoso". + * + * @param partnerName the partnerName value to set. + * @return the PartnerRegistrationInner object itself. + */ + public PartnerRegistrationInner withPartnerName(String partnerName) { + this.partnerName = partnerName; + return this; + } + + /** + * Get the partnerResourceTypeName property: Name of the partner resource type. + * + * @return the partnerResourceTypeName value. + */ + public String partnerResourceTypeName() { + return this.partnerResourceTypeName; + } + + /** + * Set the partnerResourceTypeName property: Name of the partner resource type. + * + * @param partnerResourceTypeName the partnerResourceTypeName value to set. + * @return the PartnerRegistrationInner object itself. + */ + public PartnerRegistrationInner withPartnerResourceTypeName(String partnerResourceTypeName) { + this.partnerResourceTypeName = partnerResourceTypeName; + return this; + } + + /** + * Get the partnerResourceTypeDisplayName property: Display name of the partner resource type. + * + * @return the partnerResourceTypeDisplayName value. + */ + public String partnerResourceTypeDisplayName() { + return this.partnerResourceTypeDisplayName; + } + + /** + * Set the partnerResourceTypeDisplayName property: Display name of the partner resource type. + * + * @param partnerResourceTypeDisplayName the partnerResourceTypeDisplayName value to set. + * @return the PartnerRegistrationInner object itself. + */ + public PartnerRegistrationInner withPartnerResourceTypeDisplayName(String partnerResourceTypeDisplayName) { + this.partnerResourceTypeDisplayName = partnerResourceTypeDisplayName; + return this; + } + + /** + * Get the partnerResourceTypeDescription property: Short description of the partner resource type. The length of + * this description should not exceed 256 characters. + * + * @return the partnerResourceTypeDescription value. + */ + public String partnerResourceTypeDescription() { + return this.partnerResourceTypeDescription; + } + + /** + * Set the partnerResourceTypeDescription property: Short description of the partner resource type. The length of + * this description should not exceed 256 characters. + * + * @param partnerResourceTypeDescription the partnerResourceTypeDescription value to set. + * @return the PartnerRegistrationInner object itself. + */ + public PartnerRegistrationInner withPartnerResourceTypeDescription(String partnerResourceTypeDescription) { + this.partnerResourceTypeDescription = partnerResourceTypeDescription; + return this; + } + + /** + * Get the longDescription property: Long description for the custom scenarios and integration to be displayed in + * the portal if needed. Length of this description should not exceed 2048 characters. + * + * @return the longDescription value. + */ + public String longDescription() { + return this.longDescription; + } + + /** + * Set the longDescription property: Long description for the custom scenarios and integration to be displayed in + * the portal if needed. Length of this description should not exceed 2048 characters. + * + * @param longDescription the longDescription value to set. + * @return the PartnerRegistrationInner object itself. + */ + public PartnerRegistrationInner withLongDescription(String longDescription) { + this.longDescription = longDescription; + return this; + } + + /** + * Get the partnerCustomerServiceNumber property: The customer service number of the publisher. The expected phone + * format should start with a '+' sign followed by the country code. The remaining digits are then followed. Only + * digits and spaces are allowed and its length cannot exceed 16 digits including country code. Examples of valid + * phone numbers are: +1 515 123 4567 and +966 7 5115 2471. Examples of invalid phone numbers are: +1 (515) + * 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 1234 43. + * + * @return the partnerCustomerServiceNumber value. + */ + public String partnerCustomerServiceNumber() { + return this.partnerCustomerServiceNumber; + } + + /** + * Set the partnerCustomerServiceNumber property: The customer service number of the publisher. The expected phone + * format should start with a '+' sign followed by the country code. The remaining digits are then followed. Only + * digits and spaces are allowed and its length cannot exceed 16 digits including country code. Examples of valid + * phone numbers are: +1 515 123 4567 and +966 7 5115 2471. Examples of invalid phone numbers are: +1 (515) + * 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 1234 43. + * + * @param partnerCustomerServiceNumber the partnerCustomerServiceNumber value to set. + * @return the PartnerRegistrationInner object itself. + */ + public PartnerRegistrationInner withPartnerCustomerServiceNumber(String partnerCustomerServiceNumber) { + this.partnerCustomerServiceNumber = partnerCustomerServiceNumber; + return this; + } + + /** + * Get the partnerCustomerServiceExtension property: The extension of the customer service number of the publisher. + * Only digits are allowed and number of digits should not exceed 10. + * + * @return the partnerCustomerServiceExtension value. + */ + public String partnerCustomerServiceExtension() { + return this.partnerCustomerServiceExtension; + } + + /** + * Set the partnerCustomerServiceExtension property: The extension of the customer service number of the publisher. + * Only digits are allowed and number of digits should not exceed 10. + * + * @param partnerCustomerServiceExtension the partnerCustomerServiceExtension value to set. + * @return the PartnerRegistrationInner object itself. + */ + public PartnerRegistrationInner withPartnerCustomerServiceExtension(String partnerCustomerServiceExtension) { + this.partnerCustomerServiceExtension = partnerCustomerServiceExtension; + return this; + } + + /** + * Get the customerServiceUri property: The extension of the customer service URI of the publisher. + * + * @return the customerServiceUri value. + */ + public String customerServiceUri() { + return this.customerServiceUri; + } + + /** + * Set the customerServiceUri property: The extension of the customer service URI of the publisher. + * + * @param customerServiceUri the customerServiceUri value to set. + * @return the PartnerRegistrationInner object itself. + */ + public PartnerRegistrationInner withCustomerServiceUri(String customerServiceUri) { + this.customerServiceUri = customerServiceUri; + return this; + } + + /** + * Get the setupUri property: URI of the partner website that can be used by Azure customers to setup Event Grid + * integration on an event source. + * + * @return the setupUri value. + */ + public String setupUri() { + return this.setupUri; + } + + /** + * Set the setupUri property: URI of the partner website that can be used by Azure customers to setup Event Grid + * integration on an event source. + * + * @param setupUri the setupUri value to set. + * @return the PartnerRegistrationInner object itself. + */ + public PartnerRegistrationInner withSetupUri(String setupUri) { + this.setupUri = setupUri; + return this; + } + + /** + * Get the logoUri property: URI of the logo. + * + * @return the logoUri value. + */ + public String logoUri() { + return this.logoUri; + } + + /** + * Set the logoUri property: URI of the logo. + * + * @param logoUri the logoUri value to set. + * @return the PartnerRegistrationInner object itself. + */ + public PartnerRegistrationInner withLogoUri(String logoUri) { + this.logoUri = logoUri; + return this; + } + + /** + * Get the visibilityState property: Visibility state of the partner registration. + * + * @return the visibilityState value. + */ + public PartnerRegistrationVisibilityState visibilityState() { + return this.visibilityState; + } + + /** + * Set the visibilityState property: Visibility state of the partner registration. + * + * @param visibilityState the visibilityState value to set. + * @return the PartnerRegistrationInner object itself. + */ + public PartnerRegistrationInner withVisibilityState(PartnerRegistrationVisibilityState visibilityState) { + this.visibilityState = visibilityState; + return this; + } + + /** + * Get the authorizedAzureSubscriptionIds property: List of Azure subscription Ids that are authorized to create a + * partner namespace associated with this partner registration. This is an optional property. Creating partner + * namespaces is always permitted under the same Azure subscription as the one used for creating the partner + * registration. + * + * @return the authorizedAzureSubscriptionIds value. + */ + public List authorizedAzureSubscriptionIds() { + return this.authorizedAzureSubscriptionIds; + } + + /** + * Set the authorizedAzureSubscriptionIds property: List of Azure subscription Ids that are authorized to create a + * partner namespace associated with this partner registration. This is an optional property. Creating partner + * namespaces is always permitted under the same Azure subscription as the one used for creating the partner + * registration. + * + * @param authorizedAzureSubscriptionIds the authorizedAzureSubscriptionIds value to set. + * @return the PartnerRegistrationInner object itself. + */ + public PartnerRegistrationInner withAuthorizedAzureSubscriptionIds(List authorizedAzureSubscriptionIds) { + this.authorizedAzureSubscriptionIds = authorizedAzureSubscriptionIds; + return this; + } + + /** {@inheritDoc} */ + @Override + public PartnerRegistrationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public PartnerRegistrationInner withTags(Map tags) { + super.withTags(tags); + 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/PartnerTopicInner.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/PartnerTopicInner.java new file mode 100644 index 0000000000000..471688f446369 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/PartnerTopicInner.java @@ -0,0 +1,223 @@ +// 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.annotation.JsonFlatten; +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.PartnerTopicActivationState; +import com.azure.resourcemanager.eventgrid.models.PartnerTopicProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** EventGrid Partner Topic. */ +@JsonFlatten +@Fluent +public class PartnerTopicInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PartnerTopicInner.class); + + /* + * The system metadata relating to Partner Topic resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Identity information for the Partner Topic resource. + */ + @JsonProperty(value = "identity") + private IdentityInfo identity; + + /* + * Source associated with this partner topic. This represents a unique + * partner resource. + */ + @JsonProperty(value = "properties.source") + private String source; + + /* + * Expiration time of the partner topic. If this timer expires while the + * partner topic is still never activated, + * the partner topic and corresponding event channel are deleted. + */ + @JsonProperty(value = "properties.expirationTimeIfNotActivatedUtc") + private OffsetDateTime expirationTimeIfNotActivatedUtc; + + /* + * Provisioning state of the partner topic. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PartnerTopicProvisioningState provisioningState; + + /* + * Activation state of the partner topic. + */ + @JsonProperty(value = "properties.activationState") + private PartnerTopicActivationState activationState; + + /* + * Friendly description about the topic. This can be set by the + * publisher/partner to show custom description for the customer partner + * topic. + * This will be helpful to remove any ambiguity of the origin of creation + * of the partner topic for the customer. + */ + @JsonProperty(value = "properties.partnerTopicFriendlyDescription") + private String partnerTopicFriendlyDescription; + + /** + * Get the systemData property: The system metadata relating to Partner Topic resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the identity property: Identity information for the Partner Topic resource. + * + * @return the identity value. + */ + public IdentityInfo identity() { + return this.identity; + } + + /** + * Set the identity property: Identity information for the Partner Topic resource. + * + * @param identity the identity value to set. + * @return the PartnerTopicInner object itself. + */ + public PartnerTopicInner withIdentity(IdentityInfo identity) { + this.identity = identity; + return this; + } + + /** + * Get the source property: Source associated with this partner topic. This represents a unique partner resource. + * + * @return the source value. + */ + public String source() { + return this.source; + } + + /** + * Set the source property: Source associated with this partner topic. This represents a unique partner resource. + * + * @param source the source value to set. + * @return the PartnerTopicInner object itself. + */ + public PartnerTopicInner withSource(String source) { + this.source = source; + return this; + } + + /** + * Get the expirationTimeIfNotActivatedUtc property: Expiration time of the partner topic. If this timer expires + * while the partner topic is still never activated, the partner topic and corresponding event channel are deleted. + * + * @return the expirationTimeIfNotActivatedUtc value. + */ + public OffsetDateTime expirationTimeIfNotActivatedUtc() { + return this.expirationTimeIfNotActivatedUtc; + } + + /** + * Set the expirationTimeIfNotActivatedUtc property: Expiration time of the partner topic. If this timer expires + * while the partner topic is still never activated, the partner topic and corresponding event channel are deleted. + * + * @param expirationTimeIfNotActivatedUtc the expirationTimeIfNotActivatedUtc value to set. + * @return the PartnerTopicInner object itself. + */ + public PartnerTopicInner withExpirationTimeIfNotActivatedUtc(OffsetDateTime expirationTimeIfNotActivatedUtc) { + this.expirationTimeIfNotActivatedUtc = expirationTimeIfNotActivatedUtc; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the partner topic. + * + * @return the provisioningState value. + */ + public PartnerTopicProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the activationState property: Activation state of the partner topic. + * + * @return the activationState value. + */ + public PartnerTopicActivationState activationState() { + return this.activationState; + } + + /** + * Set the activationState property: Activation state of the partner topic. + * + * @param activationState the activationState value to set. + * @return the PartnerTopicInner object itself. + */ + public PartnerTopicInner withActivationState(PartnerTopicActivationState activationState) { + this.activationState = activationState; + return this; + } + + /** + * Get the partnerTopicFriendlyDescription property: Friendly description about the topic. This can be set by the + * publisher/partner to show custom description for the customer partner topic. This will be helpful to remove any + * ambiguity of the origin of creation of the partner topic for the customer. + * + * @return the partnerTopicFriendlyDescription value. + */ + public String partnerTopicFriendlyDescription() { + return this.partnerTopicFriendlyDescription; + } + + /** + * Set the partnerTopicFriendlyDescription property: Friendly description about the topic. This can be set by the + * publisher/partner to show custom description for the customer partner topic. This will be helpful to remove any + * ambiguity of the origin of creation of the partner topic for the customer. + * + * @param partnerTopicFriendlyDescription the partnerTopicFriendlyDescription value to set. + * @return the PartnerTopicInner object itself. + */ + public PartnerTopicInner withPartnerTopicFriendlyDescription(String partnerTopicFriendlyDescription) { + this.partnerTopicFriendlyDescription = partnerTopicFriendlyDescription; + return this; + } + + /** {@inheritDoc} */ + @Override + public PartnerTopicInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public PartnerTopicInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/SystemTopicInner.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/SystemTopicInner.java new file mode 100644 index 0000000000000..68934a58ddc47 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/SystemTopicInner.java @@ -0,0 +1,171 @@ +// 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.annotation.JsonFlatten; +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.ResourceProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** EventGrid System Topic. */ +@JsonFlatten +@Fluent +public class SystemTopicInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SystemTopicInner.class); + + /* + * The system metadata relating to System Topic resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /* + * Identity information for the resource. + */ + @JsonProperty(value = "identity") + private IdentityInfo identity; + + /* + * Provisioning state of the system topic. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ResourceProvisioningState provisioningState; + + /* + * Source for the system topic. + */ + @JsonProperty(value = "properties.source") + private String source; + + /* + * TopicType for the system topic. + */ + @JsonProperty(value = "properties.topicType") + private String topicType; + + /* + * Metric resource id for the system topic. + */ + @JsonProperty(value = "properties.metricResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String metricResourceId; + + /** + * Get the systemData property: The system metadata relating to System Topic resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * 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 SystemTopicInner object itself. + */ + public SystemTopicInner withIdentity(IdentityInfo identity) { + this.identity = identity; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the system topic. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the source property: Source for the system topic. + * + * @return the source value. + */ + public String source() { + return this.source; + } + + /** + * Set the source property: Source for the system topic. + * + * @param source the source value to set. + * @return the SystemTopicInner object itself. + */ + public SystemTopicInner withSource(String source) { + this.source = source; + return this; + } + + /** + * Get the topicType property: TopicType for the system topic. + * + * @return the topicType value. + */ + public String topicType() { + return this.topicType; + } + + /** + * Set the topicType property: TopicType for the system topic. + * + * @param topicType the topicType value to set. + * @return the SystemTopicInner object itself. + */ + public SystemTopicInner withTopicType(String topicType) { + this.topicType = topicType; + return this; + } + + /** + * Get the metricResourceId property: Metric resource id for the system topic. + * + * @return the metricResourceId value. + */ + public String metricResourceId() { + return this.metricResourceId; + } + + /** {@inheritDoc} */ + @Override + public SystemTopicInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SystemTopicInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().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 39f6d0864eb71..509f9d84387e4 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 @@ -9,10 +9,14 @@ 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.ExtendedLocation; +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; import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; +import com.azure.resourcemanager.eventgrid.models.ResourceKind; +import com.azure.resourcemanager.eventgrid.models.ResourceSku; import com.azure.resourcemanager.eventgrid.models.TopicProvisioningState; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -25,6 +29,30 @@ public class TopicInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(TopicInner.class); + /* + * The Sku pricing tier for the topic. + */ + @JsonProperty(value = "sku") + private ResourceSku sku; + + /* + * Identity information for the resource. + */ + @JsonProperty(value = "identity") + private IdentityInfo identity; + + /* + * Kind of the resource. + */ + @JsonProperty(value = "kind") + private ResourceKind kind; + + /* + * Extended location of the resource. + */ + @JsonProperty(value = "extendedLocation") + private ExtendedLocation extendedLocation; + /* * The system metadata relating to Topic resource. */ @@ -88,6 +116,94 @@ public class TopicInner extends Resource { @JsonProperty(value = "properties.inboundIpRules") private List inboundIpRules; + /* + * This boolean is used to enable or disable local auth. Default value is + * false. When the property is set to true, only AAD token will be used to + * authenticate if user is allowed to publish to the topic. + */ + @JsonProperty(value = "properties.disableLocalAuth") + private Boolean disableLocalAuth; + + /** + * Get the sku property: The Sku pricing tier for the topic. + * + * @return the sku value. + */ + public ResourceSku sku() { + return this.sku; + } + + /** + * Set the sku property: The Sku pricing tier for the topic. + * + * @param sku the sku value to set. + * @return the TopicInner object itself. + */ + public TopicInner withSku(ResourceSku sku) { + this.sku = sku; + return this; + } + + /** + * 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 kind property: Kind of the resource. + * + * @return the kind value. + */ + public ResourceKind kind() { + return this.kind; + } + + /** + * Set the kind property: Kind of the resource. + * + * @param kind the kind value to set. + * @return the TopicInner object itself. + */ + public TopicInner withKind(ResourceKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the extendedLocation property: Extended location of the resource. + * + * @return the extendedLocation value. + */ + public ExtendedLocation extendedLocation() { + return this.extendedLocation; + } + + /** + * Set the extendedLocation property: Extended location of the resource. + * + * @param extendedLocation the extendedLocation value to set. + * @return the TopicInner object itself. + */ + public TopicInner withExtendedLocation(ExtendedLocation extendedLocation) { + this.extendedLocation = extendedLocation; + return this; + } + /** * Get the systemData property: The system metadata relating to Topic resource. * @@ -225,6 +341,30 @@ public TopicInner withInboundIpRules(List inboundIpRules) { return this; } + /** + * Get the disableLocalAuth property: This boolean is used to enable or disable local auth. Default value is false. + * When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to + * the topic. + * + * @return the disableLocalAuth value. + */ + public Boolean disableLocalAuth() { + return this.disableLocalAuth; + } + + /** + * Set the disableLocalAuth property: This boolean is used to enable or disable local auth. Default value is false. + * When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to + * the topic. + * + * @param disableLocalAuth the disableLocalAuth value to set. + * @return the TopicInner object itself. + */ + public TopicInner withDisableLocalAuth(Boolean disableLocalAuth) { + this.disableLocalAuth = disableLocalAuth; + return this; + } + /** {@inheritDoc} */ @Override public TopicInner withLocation(String location) { @@ -245,6 +385,15 @@ public TopicInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (sku() != null) { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (extendedLocation() != null) { + extendedLocation().validate(); + } if (privateEndpointConnections() != null) { privateEndpointConnections().forEach(e -> e.validate()); } diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/TopicTypeInfoInner.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/TopicTypeInfoInner.java index 2c47fb5cc7925..bec9d15a43969 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/TopicTypeInfoInner.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/fluent/models/TopicTypeInfoInner.java @@ -9,6 +9,7 @@ import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.eventgrid.models.ResourceRegionType; +import com.azure.resourcemanager.eventgrid.models.TopicTypePropertiesSupportedScopesForSourceItem; import com.azure.resourcemanager.eventgrid.models.TopicTypeProvisioningState; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -62,6 +63,12 @@ public class TopicTypeInfoInner extends ProxyResource { @JsonProperty(value = "properties.sourceResourceFormat") private String sourceResourceFormat; + /* + * Supported source scopes. + */ + @JsonProperty(value = "properties.supportedScopesForSource") + private List supportedScopesForSource; + /** * Get the provider property: Namespace of the provider of the topic type. * @@ -202,6 +209,27 @@ public TopicTypeInfoInner withSourceResourceFormat(String sourceResourceFormat) return this; } + /** + * Get the supportedScopesForSource property: Supported source scopes. + * + * @return the supportedScopesForSource value. + */ + public List supportedScopesForSource() { + return this.supportedScopesForSource; + } + + /** + * Set the supportedScopesForSource property: Supported source scopes. + * + * @param supportedScopesForSource the supportedScopesForSource value to set. + * @return the TopicTypeInfoInner object itself. + */ + public TopicTypeInfoInner withSupportedScopesForSource( + List supportedScopesForSource) { + this.supportedScopesForSource = supportedScopesForSource; + return this; + } + /** * Validates the instance. * diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/DeliveryAttributeListResultImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/DeliveryAttributeListResultImpl.java new file mode 100644 index 0000000000000..7d3e04860133f --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/DeliveryAttributeListResultImpl.java @@ -0,0 +1,41 @@ +// 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.resourcemanager.eventgrid.fluent.models.DeliveryAttributeListResultInner; +import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeListResult; +import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeMapping; +import java.util.Collections; +import java.util.List; + +public final class DeliveryAttributeListResultImpl implements DeliveryAttributeListResult { + private DeliveryAttributeListResultInner innerObject; + + private final com.azure.resourcemanager.eventgrid.EventGridManager serviceManager; + + DeliveryAttributeListResultImpl( + DeliveryAttributeListResultInner innerObject, + com.azure.resourcemanager.eventgrid.EventGridManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DeliveryAttributeListResultInner 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/DomainImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/DomainImpl.java index f8d34eb52ab2d..d8e544de82853 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/DomainImpl.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/DomainImpl.java @@ -15,11 +15,13 @@ import com.azure.resourcemanager.eventgrid.models.DomainRegenerateKeyRequest; import com.azure.resourcemanager.eventgrid.models.DomainSharedAccessKeys; import com.azure.resourcemanager.eventgrid.models.DomainUpdateParameters; +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; import com.azure.resourcemanager.eventgrid.models.PrivateEndpointConnection; import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; +import com.azure.resourcemanager.eventgrid.models.ResourceSku; import java.util.Collections; import java.util.List; import java.util.Map; @@ -55,6 +57,14 @@ public Map tags() { } } + public ResourceSku sku() { + return this.innerModel().sku(); + } + + public IdentityInfo identity() { + return this.innerModel().identity(); + } + public SystemData systemData() { return this.innerModel().systemData(); } @@ -106,6 +116,18 @@ public List inboundIpRules() { } } + public Boolean disableLocalAuth() { + return this.innerModel().disableLocalAuth(); + } + + public Boolean autoCreateTopicWithFirstSubscription() { + return this.innerModel().autoCreateTopicWithFirstSubscription(); + } + + public Boolean autoDeleteTopicWithLastSubscription() { + return this.innerModel().autoDeleteTopicWithLastSubscription(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -246,6 +268,26 @@ public DomainImpl withTags(Map tags) { } } + public DomainImpl withSku(ResourceSku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateDomainUpdateParameters.withSku(sku); + return this; + } + } + + public DomainImpl withIdentity(IdentityInfo identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateDomainUpdateParameters.withIdentity(identity); + return this; + } + } + public DomainImpl withInputSchema(InputSchema inputSchema) { this.innerModel().withInputSchema(inputSchema); return this; @@ -276,6 +318,40 @@ public DomainImpl withInboundIpRules(List inboundIpRules) { } } + public DomainImpl withDisableLocalAuth(Boolean disableLocalAuth) { + if (isInCreateMode()) { + this.innerModel().withDisableLocalAuth(disableLocalAuth); + return this; + } else { + this.updateDomainUpdateParameters.withDisableLocalAuth(disableLocalAuth); + return this; + } + } + + public DomainImpl withAutoCreateTopicWithFirstSubscription(Boolean autoCreateTopicWithFirstSubscription) { + if (isInCreateMode()) { + this.innerModel().withAutoCreateTopicWithFirstSubscription(autoCreateTopicWithFirstSubscription); + return this; + } else { + this + .updateDomainUpdateParameters + .withAutoCreateTopicWithFirstSubscription(autoCreateTopicWithFirstSubscription); + return this; + } + } + + public DomainImpl withAutoDeleteTopicWithLastSubscription(Boolean autoDeleteTopicWithLastSubscription) { + if (isInCreateMode()) { + this.innerModel().withAutoDeleteTopicWithLastSubscription(autoDeleteTopicWithLastSubscription); + return this; + } else { + this + .updateDomainUpdateParameters + .withAutoDeleteTopicWithLastSubscription(autoDeleteTopicWithLastSubscription); + 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/EventChannelImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventChannelImpl.java new file mode 100644 index 0000000000000..dcb410c72bd27 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventChannelImpl.java @@ -0,0 +1,194 @@ +// 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.core.util.Context; +import com.azure.resourcemanager.eventgrid.fluent.models.EventChannelInner; +import com.azure.resourcemanager.eventgrid.models.EventChannel; +import com.azure.resourcemanager.eventgrid.models.EventChannelDestination; +import com.azure.resourcemanager.eventgrid.models.EventChannelFilter; +import com.azure.resourcemanager.eventgrid.models.EventChannelProvisioningState; +import com.azure.resourcemanager.eventgrid.models.EventChannelSource; +import com.azure.resourcemanager.eventgrid.models.PartnerTopicReadinessState; +import java.time.OffsetDateTime; + +public final class EventChannelImpl implements EventChannel, EventChannel.Definition, EventChannel.Update { + private EventChannelInner innerObject; + + private final com.azure.resourcemanager.eventgrid.EventGridManager 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 EventChannelSource source() { + return this.innerModel().source(); + } + + public EventChannelDestination destination() { + return this.innerModel().destination(); + } + + public EventChannelProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PartnerTopicReadinessState partnerTopicReadinessState() { + return this.innerModel().partnerTopicReadinessState(); + } + + public OffsetDateTime expirationTimeIfNotActivatedUtc() { + return this.innerModel().expirationTimeIfNotActivatedUtc(); + } + + public EventChannelFilter filter() { + return this.innerModel().filter(); + } + + public String partnerTopicFriendlyDescription() { + return this.innerModel().partnerTopicFriendlyDescription(); + } + + public EventChannelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.eventgrid.EventGridManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String partnerNamespaceName; + + private String eventChannelName; + + public EventChannelImpl withExistingPartnerNamespace(String resourceGroupName, String partnerNamespaceName) { + this.resourceGroupName = resourceGroupName; + this.partnerNamespaceName = partnerNamespaceName; + return this; + } + + public EventChannel create() { + this.innerObject = + serviceManager + .serviceClient() + .getEventChannels() + .createOrUpdateWithResponse( + resourceGroupName, partnerNamespaceName, eventChannelName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public EventChannel create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getEventChannels() + .createOrUpdateWithResponse( + resourceGroupName, partnerNamespaceName, eventChannelName, this.innerModel(), context) + .getValue(); + return this; + } + + EventChannelImpl(String name, com.azure.resourcemanager.eventgrid.EventGridManager serviceManager) { + this.innerObject = new EventChannelInner(); + this.serviceManager = serviceManager; + this.eventChannelName = name; + } + + public EventChannelImpl update() { + return this; + } + + public EventChannel apply() { + this.innerObject = + serviceManager + .serviceClient() + .getEventChannels() + .createOrUpdateWithResponse( + resourceGroupName, partnerNamespaceName, eventChannelName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public EventChannel apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getEventChannels() + .createOrUpdateWithResponse( + resourceGroupName, partnerNamespaceName, eventChannelName, this.innerModel(), context) + .getValue(); + return this; + } + + EventChannelImpl( + EventChannelInner innerObject, com.azure.resourcemanager.eventgrid.EventGridManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.partnerNamespaceName = Utils.getValueFromIdByName(innerObject.id(), "partnerNamespaces"); + this.eventChannelName = Utils.getValueFromIdByName(innerObject.id(), "eventChannels"); + } + + public EventChannel refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getEventChannels() + .getWithResponse(resourceGroupName, partnerNamespaceName, eventChannelName, Context.NONE) + .getValue(); + return this; + } + + public EventChannel refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getEventChannels() + .getWithResponse(resourceGroupName, partnerNamespaceName, eventChannelName, context) + .getValue(); + return this; + } + + public EventChannelImpl withSource(EventChannelSource source) { + this.innerModel().withSource(source); + return this; + } + + public EventChannelImpl withDestination(EventChannelDestination destination) { + this.innerModel().withDestination(destination); + return this; + } + + public EventChannelImpl withExpirationTimeIfNotActivatedUtc(OffsetDateTime expirationTimeIfNotActivatedUtc) { + this.innerModel().withExpirationTimeIfNotActivatedUtc(expirationTimeIfNotActivatedUtc); + return this; + } + + public EventChannelImpl withFilter(EventChannelFilter filter) { + this.innerModel().withFilter(filter); + return this; + } + + public EventChannelImpl withPartnerTopicFriendlyDescription(String partnerTopicFriendlyDescription) { + this.innerModel().withPartnerTopicFriendlyDescription(partnerTopicFriendlyDescription); + return this; + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventChannelsClientImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventChannelsClientImpl.java new file mode 100644 index 0000000000000..4777a20734439 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventChannelsClientImpl.java @@ -0,0 +1,1096 @@ +// 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.BodyParam; +import com.azure.core.annotation.Delete; +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.Put; +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.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.eventgrid.fluent.EventChannelsClient; +import com.azure.resourcemanager.eventgrid.fluent.models.EventChannelInner; +import com.azure.resourcemanager.eventgrid.models.EventChannelsListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in EventChannelsClient. */ +public final class EventChannelsClientImpl implements EventChannelsClient { + private final ClientLogger logger = new ClientLogger(EventChannelsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final EventChannelsService service; + + /** The service client containing this operation class. */ + private final EventGridManagementClientImpl client; + + /** + * Initializes an instance of EventChannelsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EventChannelsClientImpl(EventGridManagementClientImpl client) { + this.service = + RestProxy.create(EventChannelsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EventGridManagementClientEventChannels to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EventGridManagementC") + private interface EventChannelsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerNamespaceName") String partnerNamespaceName, + @PathParam("eventChannelName") String eventChannelName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerNamespaceName") String partnerNamespaceName, + @PathParam("eventChannelName") String eventChannelName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") EventChannelInner eventChannelInfo, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerNamespaceName") String partnerNamespaceName, + @PathParam("eventChannelName") String eventChannelName, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerNamespaces/{partnerNamespaceName}/eventChannels") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPartnerNamespace( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerNamespaceName") String partnerNamespaceName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPartnerNamespaceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get properties of an event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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 properties of an event channel. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String partnerNamespaceName, String eventChannelName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerNamespaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerNamespaceName is required and cannot be null.")); + } + if (eventChannelName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventChannelName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerNamespaceName, + eventChannelName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get properties of an event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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 properties of an event channel. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String partnerNamespaceName, String eventChannelName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerNamespaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerNamespaceName is required and cannot be null.")); + } + if (eventChannelName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventChannelName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerNamespaceName, + eventChannelName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get properties of an event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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 properties of an event channel. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String partnerNamespaceName, String eventChannelName) { + return getWithResponseAsync(resourceGroupName, partnerNamespaceName, eventChannelName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get properties of an event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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 properties of an event channel. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EventChannelInner get(String resourceGroupName, String partnerNamespaceName, String eventChannelName) { + return getAsync(resourceGroupName, partnerNamespaceName, eventChannelName).block(); + } + + /** + * Get properties of an event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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 properties of an event channel. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String partnerNamespaceName, String eventChannelName, Context context) { + return getWithResponseAsync(resourceGroupName, partnerNamespaceName, eventChannelName, context).block(); + } + + /** + * Asynchronously creates a new event channel with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @param eventChannelInfo EventChannel information. + * @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 event Channel. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String partnerNamespaceName, + String eventChannelName, + EventChannelInner eventChannelInfo) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerNamespaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerNamespaceName is required and cannot be null.")); + } + if (eventChannelName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventChannelName is required and cannot be null.")); + } + if (eventChannelInfo == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventChannelInfo is required and cannot be null.")); + } else { + eventChannelInfo.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerNamespaceName, + eventChannelName, + this.client.getApiVersion(), + eventChannelInfo, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Asynchronously creates a new event channel with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @param eventChannelInfo EventChannel information. + * @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 event Channel. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String partnerNamespaceName, + String eventChannelName, + EventChannelInner eventChannelInfo, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerNamespaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerNamespaceName is required and cannot be null.")); + } + if (eventChannelName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventChannelName is required and cannot be null.")); + } + if (eventChannelInfo == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventChannelInfo is required and cannot be null.")); + } else { + eventChannelInfo.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerNamespaceName, + eventChannelName, + this.client.getApiVersion(), + eventChannelInfo, + accept, + context); + } + + /** + * Asynchronously creates a new event channel with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @param eventChannelInfo EventChannel information. + * @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 event Channel. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String partnerNamespaceName, + String eventChannelName, + EventChannelInner eventChannelInfo) { + return createOrUpdateWithResponseAsync( + resourceGroupName, partnerNamespaceName, eventChannelName, eventChannelInfo) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Asynchronously creates a new event channel with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @param eventChannelInfo EventChannel information. + * @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 event Channel. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EventChannelInner createOrUpdate( + String resourceGroupName, + String partnerNamespaceName, + String eventChannelName, + EventChannelInner eventChannelInfo) { + return createOrUpdateAsync(resourceGroupName, partnerNamespaceName, eventChannelName, eventChannelInfo).block(); + } + + /** + * Asynchronously creates a new event channel with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @param eventChannelInfo EventChannel information. + * @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 event Channel. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String partnerNamespaceName, + String eventChannelName, + EventChannelInner eventChannelInfo, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, partnerNamespaceName, eventChannelName, eventChannelInfo, context) + .block(); + } + + /** + * Delete existing event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String partnerNamespaceName, String eventChannelName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerNamespaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerNamespaceName is required and cannot be null.")); + } + if (eventChannelName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventChannelName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerNamespaceName, + eventChannelName, + this.client.getApiVersion(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete existing event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String partnerNamespaceName, String eventChannelName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerNamespaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerNamespaceName is required and cannot be null.")); + } + if (eventChannelName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventChannelName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerNamespaceName, + eventChannelName, + this.client.getApiVersion(), + context); + } + + /** + * Delete existing event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String partnerNamespaceName, String eventChannelName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, partnerNamespaceName, eventChannelName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete existing event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String partnerNamespaceName, String eventChannelName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, partnerNamespaceName, eventChannelName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete existing event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String partnerNamespaceName, String eventChannelName) { + return beginDeleteAsync(resourceGroupName, partnerNamespaceName, eventChannelName).getSyncPoller(); + } + + /** + * Delete existing event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String partnerNamespaceName, String eventChannelName, Context context) { + return beginDeleteAsync(resourceGroupName, partnerNamespaceName, eventChannelName, context).getSyncPoller(); + } + + /** + * Delete existing event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String partnerNamespaceName, String eventChannelName) { + return beginDeleteAsync(resourceGroupName, partnerNamespaceName, eventChannelName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete existing event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String partnerNamespaceName, String eventChannelName, Context context) { + return beginDeleteAsync(resourceGroupName, partnerNamespaceName, eventChannelName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete existing event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String partnerNamespaceName, String eventChannelName) { + deleteAsync(resourceGroupName, partnerNamespaceName, eventChannelName).block(); + } + + /** + * Delete existing event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String partnerNamespaceName, String eventChannelName, Context context) { + deleteAsync(resourceGroupName, partnerNamespaceName, eventChannelName, context).block(); + } + + /** + * List all the event channels in a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Event Channels operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPartnerNamespaceSinglePageAsync( + String resourceGroupName, String partnerNamespaceName, String filter, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerNamespaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerNamespaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByPartnerNamespace( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerNamespaceName, + this.client.getApiVersion(), + filter, + top, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all the event channels in a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Event Channels operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPartnerNamespaceSinglePageAsync( + String resourceGroupName, String partnerNamespaceName, String filter, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerNamespaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerNamespaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPartnerNamespace( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerNamespaceName, + this.client.getApiVersion(), + filter, + top, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all the event channels in a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Event Channels operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPartnerNamespaceAsync( + String resourceGroupName, String partnerNamespaceName, String filter, Integer top) { + return new PagedFlux<>( + () -> listByPartnerNamespaceSinglePageAsync(resourceGroupName, partnerNamespaceName, filter, top), + nextLink -> listByPartnerNamespaceNextSinglePageAsync(nextLink)); + } + + /** + * List all the event channels in a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 result of the List Event Channels operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPartnerNamespaceAsync( + String resourceGroupName, String partnerNamespaceName) { + final String filter = null; + final Integer top = null; + return new PagedFlux<>( + () -> listByPartnerNamespaceSinglePageAsync(resourceGroupName, partnerNamespaceName, filter, top), + nextLink -> listByPartnerNamespaceNextSinglePageAsync(nextLink)); + } + + /** + * List all the event channels in a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Event Channels operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPartnerNamespaceAsync( + String resourceGroupName, String partnerNamespaceName, String filter, Integer top, Context context) { + return new PagedFlux<>( + () -> listByPartnerNamespaceSinglePageAsync(resourceGroupName, partnerNamespaceName, filter, top, context), + nextLink -> listByPartnerNamespaceNextSinglePageAsync(nextLink, context)); + } + + /** + * List all the event channels in a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 result of the List Event Channels operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPartnerNamespace( + String resourceGroupName, String partnerNamespaceName) { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listByPartnerNamespaceAsync(resourceGroupName, partnerNamespaceName, filter, top)); + } + + /** + * List all the event channels in a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Event Channels operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPartnerNamespace( + String resourceGroupName, String partnerNamespaceName, String filter, Integer top, Context context) { + return new PagedIterable<>( + listByPartnerNamespaceAsync(resourceGroupName, partnerNamespaceName, filter, top, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 result of the List Event Channels operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPartnerNamespaceNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByPartnerNamespaceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 result of the List Event Channels operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPartnerNamespaceNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPartnerNamespaceNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventChannelsImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventChannelsImpl.java new file mode 100644 index 0000000000000..0691a98141b26 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventChannelsImpl.java @@ -0,0 +1,200 @@ +// 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.PagedIterable; +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.EventChannelsClient; +import com.azure.resourcemanager.eventgrid.fluent.models.EventChannelInner; +import com.azure.resourcemanager.eventgrid.models.EventChannel; +import com.azure.resourcemanager.eventgrid.models.EventChannels; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class EventChannelsImpl implements EventChannels { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventChannelsImpl.class); + + private final EventChannelsClient innerClient; + + private final com.azure.resourcemanager.eventgrid.EventGridManager serviceManager; + + public EventChannelsImpl( + EventChannelsClient innerClient, com.azure.resourcemanager.eventgrid.EventGridManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public EventChannel get(String resourceGroupName, String partnerNamespaceName, String eventChannelName) { + EventChannelInner inner = this.serviceClient().get(resourceGroupName, partnerNamespaceName, eventChannelName); + if (inner != null) { + return new EventChannelImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String partnerNamespaceName, String eventChannelName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, partnerNamespaceName, eventChannelName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EventChannelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String partnerNamespaceName, String eventChannelName) { + this.serviceClient().delete(resourceGroupName, partnerNamespaceName, eventChannelName); + } + + public void delete( + String resourceGroupName, String partnerNamespaceName, String eventChannelName, Context context) { + this.serviceClient().delete(resourceGroupName, partnerNamespaceName, eventChannelName, context); + } + + public PagedIterable listByPartnerNamespace(String resourceGroupName, String partnerNamespaceName) { + PagedIterable inner = + this.serviceClient().listByPartnerNamespace(resourceGroupName, partnerNamespaceName); + return Utils.mapPage(inner, inner1 -> new EventChannelImpl(inner1, this.manager())); + } + + public PagedIterable listByPartnerNamespace( + String resourceGroupName, String partnerNamespaceName, String filter, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().listByPartnerNamespace(resourceGroupName, partnerNamespaceName, filter, top, context); + return Utils.mapPage(inner, inner1 -> new EventChannelImpl(inner1, this.manager())); + } + + public EventChannel getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String partnerNamespaceName = Utils.getValueFromIdByName(id, "partnerNamespaces"); + if (partnerNamespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'partnerNamespaces'.", id))); + } + String eventChannelName = Utils.getValueFromIdByName(id, "eventChannels"); + if (eventChannelName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'eventChannels'.", id))); + } + return this.getWithResponse(resourceGroupName, partnerNamespaceName, eventChannelName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String partnerNamespaceName = Utils.getValueFromIdByName(id, "partnerNamespaces"); + if (partnerNamespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'partnerNamespaces'.", id))); + } + String eventChannelName = Utils.getValueFromIdByName(id, "eventChannels"); + if (eventChannelName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'eventChannels'.", id))); + } + return this.getWithResponse(resourceGroupName, partnerNamespaceName, eventChannelName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String partnerNamespaceName = Utils.getValueFromIdByName(id, "partnerNamespaces"); + if (partnerNamespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'partnerNamespaces'.", id))); + } + String eventChannelName = Utils.getValueFromIdByName(id, "eventChannels"); + if (eventChannelName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'eventChannels'.", id))); + } + this.delete(resourceGroupName, partnerNamespaceName, eventChannelName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String partnerNamespaceName = Utils.getValueFromIdByName(id, "partnerNamespaces"); + if (partnerNamespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'partnerNamespaces'.", id))); + } + String eventChannelName = Utils.getValueFromIdByName(id, "eventChannels"); + if (eventChannelName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'eventChannels'.", id))); + } + this.delete(resourceGroupName, partnerNamespaceName, eventChannelName, context); + } + + private EventChannelsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.eventgrid.EventGridManager manager() { + return this.serviceManager; + } + + public EventChannelImpl define(String name) { + return new EventChannelImpl(name, this.manager()); + } +} 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 70695d22e1b2b..44f9253c52e1b 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 @@ -23,11 +23,19 @@ import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.eventgrid.fluent.DomainTopicsClient; import com.azure.resourcemanager.eventgrid.fluent.DomainsClient; +import com.azure.resourcemanager.eventgrid.fluent.EventChannelsClient; 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.PartnerNamespacesClient; +import com.azure.resourcemanager.eventgrid.fluent.PartnerRegistrationsClient; +import com.azure.resourcemanager.eventgrid.fluent.PartnerTopicEventSubscriptionsClient; +import com.azure.resourcemanager.eventgrid.fluent.PartnerTopicsClient; import com.azure.resourcemanager.eventgrid.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.eventgrid.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.eventgrid.fluent.SystemTopicEventSubscriptionsClient; +import com.azure.resourcemanager.eventgrid.fluent.SystemTopicsClient; import com.azure.resourcemanager.eventgrid.fluent.TopicTypesClient; import com.azure.resourcemanager.eventgrid.fluent.TopicsClient; import java.io.IOException; @@ -145,6 +153,18 @@ public DomainTopicsClient getDomainTopics() { return this.domainTopics; } + /** The EventChannelsClient object to access its operations. */ + private final EventChannelsClient eventChannels; + + /** + * Gets the EventChannelsClient object to access its operations. + * + * @return the EventChannelsClient object. + */ + public EventChannelsClient getEventChannels() { + return this.eventChannels; + } + /** The EventSubscriptionsClient object to access its operations. */ private final EventSubscriptionsClient eventSubscriptions; @@ -157,6 +177,30 @@ public EventSubscriptionsClient getEventSubscriptions() { return this.eventSubscriptions; } + /** The SystemTopicEventSubscriptionsClient object to access its operations. */ + private final SystemTopicEventSubscriptionsClient systemTopicEventSubscriptions; + + /** + * Gets the SystemTopicEventSubscriptionsClient object to access its operations. + * + * @return the SystemTopicEventSubscriptionsClient object. + */ + public SystemTopicEventSubscriptionsClient getSystemTopicEventSubscriptions() { + return this.systemTopicEventSubscriptions; + } + + /** The PartnerTopicEventSubscriptionsClient object to access its operations. */ + private final PartnerTopicEventSubscriptionsClient partnerTopicEventSubscriptions; + + /** + * Gets the PartnerTopicEventSubscriptionsClient object to access its operations. + * + * @return the PartnerTopicEventSubscriptionsClient object. + */ + public PartnerTopicEventSubscriptionsClient getPartnerTopicEventSubscriptions() { + return this.partnerTopicEventSubscriptions; + } + /** The OperationsClient object to access its operations. */ private final OperationsClient operations; @@ -169,16 +213,40 @@ public OperationsClient getOperations() { return this.operations; } - /** The TopicsClient object to access its operations. */ - private final TopicsClient topics; + /** The PartnerNamespacesClient object to access its operations. */ + private final PartnerNamespacesClient partnerNamespaces; /** - * Gets the TopicsClient object to access its operations. + * Gets the PartnerNamespacesClient object to access its operations. * - * @return the TopicsClient object. + * @return the PartnerNamespacesClient object. */ - public TopicsClient getTopics() { - return this.topics; + public PartnerNamespacesClient getPartnerNamespaces() { + return this.partnerNamespaces; + } + + /** The PartnerRegistrationsClient object to access its operations. */ + private final PartnerRegistrationsClient partnerRegistrations; + + /** + * Gets the PartnerRegistrationsClient object to access its operations. + * + * @return the PartnerRegistrationsClient object. + */ + public PartnerRegistrationsClient getPartnerRegistrations() { + return this.partnerRegistrations; + } + + /** The PartnerTopicsClient object to access its operations. */ + private final PartnerTopicsClient partnerTopics; + + /** + * Gets the PartnerTopicsClient object to access its operations. + * + * @return the PartnerTopicsClient object. + */ + public PartnerTopicsClient getPartnerTopics() { + return this.partnerTopics; } /** The PrivateEndpointConnectionsClient object to access its operations. */ @@ -205,6 +273,42 @@ public PrivateLinkResourcesClient getPrivateLinkResources() { return this.privateLinkResources; } + /** The SystemTopicsClient object to access its operations. */ + private final SystemTopicsClient systemTopics; + + /** + * Gets the SystemTopicsClient object to access its operations. + * + * @return the SystemTopicsClient object. + */ + public SystemTopicsClient getSystemTopics() { + return this.systemTopics; + } + + /** The TopicsClient object to access its operations. */ + private final TopicsClient topics; + + /** + * Gets the TopicsClient object to access its operations. + * + * @return the TopicsClient object. + */ + public TopicsClient getTopics() { + return this.topics; + } + + /** 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; @@ -240,14 +344,22 @@ public TopicTypesClient getTopicTypes() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2020-06-01"; + this.apiVersion = "2021-06-01-preview"; this.domains = new DomainsClientImpl(this); this.domainTopics = new DomainTopicsClientImpl(this); + this.eventChannels = new EventChannelsClientImpl(this); this.eventSubscriptions = new EventSubscriptionsClientImpl(this); + this.systemTopicEventSubscriptions = new SystemTopicEventSubscriptionsClientImpl(this); + this.partnerTopicEventSubscriptions = new PartnerTopicEventSubscriptionsClientImpl(this); this.operations = new OperationsClientImpl(this); - this.topics = new TopicsClientImpl(this); + this.partnerNamespaces = new PartnerNamespacesClientImpl(this); + this.partnerRegistrations = new PartnerRegistrationsClientImpl(this); + this.partnerTopics = new PartnerTopicsClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.systemTopics = new SystemTopicsClientImpl(this); + this.topics = new TopicsClientImpl(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 2818991461e19..8b141b6ed28cb 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,6 +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; @@ -55,6 +58,10 @@ public EventSubscriptionDestination destination() { return this.innerModel().destination(); } + public DeliveryWithResourceIdentity deliveryWithResourceIdentity() { + return this.innerModel().deliveryWithResourceIdentity(); + } + public EventSubscriptionFilter filter() { return this.innerModel().filter(); } @@ -84,6 +91,10 @@ public DeadLetterDestination deadLetterDestination() { return this.innerModel().deadLetterDestination(); } + public DeadLetterWithResourceIdentity deadLetterWithResourceIdentity() { + return this.innerModel().deadLetterWithResourceIdentity(); + } + public EventSubscriptionInner innerModel() { return this.innerObject; } @@ -196,6 +207,16 @@ public Response getFullUrlWithResponse(Context context return serviceManager.eventSubscriptions().getFullUrlWithResponse(scope, eventSubscriptionName, context); } + public DeliveryAttributeListResult getDeliveryAttributes() { + return serviceManager.eventSubscriptions().getDeliveryAttributes(scope, eventSubscriptionName); + } + + public Response getDeliveryAttributesWithResponse(Context context) { + return serviceManager + .eventSubscriptions() + .getDeliveryAttributesWithResponse(scope, eventSubscriptionName, context); + } + public EventSubscriptionImpl withDestination(EventSubscriptionDestination destination) { if (isInCreateMode()) { this.innerModel().withDestination(destination); @@ -206,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); @@ -266,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/EventSubscriptionsClientImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventSubscriptionsClientImpl.java index 560801820537d..95b9b7c19ae54 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventSubscriptionsClientImpl.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventSubscriptionsClientImpl.java @@ -35,6 +35,7 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.eventgrid.fluent.EventSubscriptionsClient; +import com.azure.resourcemanager.eventgrid.fluent.models.DeliveryAttributeListResultInner; import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionFullUrlInner; import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner; import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters; @@ -297,6 +298,18 @@ Mono> listByDomainTopic( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post("/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDeliveryAttributes( + @HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, + @PathParam("eventSubscriptionName") String eventSubscriptionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -4210,6 +4223,172 @@ public PagedIterable listByDomainTopic( listByDomainTopicAsync(resourceGroupName, domainName, topicName, filter, top, context)); } + /** + * Get all delivery attributes for an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top + * level resource belonging to a resource provider namespace, or an EventGrid topic. 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 a resource, and + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + * for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @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 all delivery attributes for an event subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDeliveryAttributesWithResponseAsync( + String scope, String eventSubscriptionName) { + 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.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getDeliveryAttributes( + this.client.getEndpoint(), + scope, + eventSubscriptionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all delivery attributes for an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top + * level resource belonging to a resource provider namespace, or an EventGrid topic. 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 a resource, and + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + * for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @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 all delivery attributes for an event subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDeliveryAttributesWithResponseAsync( + String scope, String eventSubscriptionName, 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.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getDeliveryAttributes( + this.client.getEndpoint(), scope, eventSubscriptionName, this.client.getApiVersion(), accept, context); + } + + /** + * Get all delivery attributes for an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top + * level resource belonging to a resource provider namespace, or an EventGrid topic. 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 a resource, and + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + * for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @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 all delivery attributes for an event subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDeliveryAttributesAsync( + String scope, String eventSubscriptionName) { + return getDeliveryAttributesWithResponseAsync(scope, eventSubscriptionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get all delivery attributes for an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top + * level resource belonging to a resource provider namespace, or an EventGrid topic. 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 a resource, and + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + * for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @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 all delivery attributes for an event subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeliveryAttributeListResultInner getDeliveryAttributes(String scope, String eventSubscriptionName) { + return getDeliveryAttributesAsync(scope, eventSubscriptionName).block(); + } + + /** + * Get all delivery attributes for an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top + * level resource belonging to a resource provider namespace, or an EventGrid topic. 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 a resource, and + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + * for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @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 all delivery attributes for an event subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeliveryAttributesWithResponse( + String scope, String eventSubscriptionName, Context context) { + return getDeliveryAttributesWithResponseAsync(scope, eventSubscriptionName, context).block(); + } + /** * Get the next page of items. * diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventSubscriptionsImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventSubscriptionsImpl.java index a9b5934c36a8d..8ead64ccd47df 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventSubscriptionsImpl.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/EventSubscriptionsImpl.java @@ -10,8 +10,10 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.eventgrid.fluent.EventSubscriptionsClient; +import com.azure.resourcemanager.eventgrid.fluent.models.DeliveryAttributeListResultInner; import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionFullUrlInner; import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner; +import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeListResult; import com.azure.resourcemanager.eventgrid.models.EventSubscription; import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFullUrl; import com.azure.resourcemanager.eventgrid.models.EventSubscriptions; @@ -229,6 +231,31 @@ public PagedIterable listByDomainTopic( return Utils.mapPage(inner, inner1 -> new EventSubscriptionImpl(inner1, this.manager())); } + public DeliveryAttributeListResult getDeliveryAttributes(String scope, String eventSubscriptionName) { + DeliveryAttributeListResultInner inner = + this.serviceClient().getDeliveryAttributes(scope, eventSubscriptionName); + if (inner != null) { + return new DeliveryAttributeListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getDeliveryAttributesWithResponse( + String scope, String eventSubscriptionName, Context context) { + Response inner = + this.serviceClient().getDeliveryAttributesWithResponse(scope, eventSubscriptionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeliveryAttributeListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + public EventSubscription getById(String id) { String scope = Utils 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 0000000000000..2df278d08898f --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/ExtensionTopicImpl.java @@ -0,0 +1,48 @@ +// 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.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 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 0000000000000..ed08707601a3a --- /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 0000000000000..653a268053811 --- /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/OperationImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/OperationImpl.java index f2138c1b4780e..2073d27d6ffa5 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/OperationImpl.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/OperationImpl.java @@ -30,6 +30,10 @@ public String origin() { return this.innerModel().origin(); } + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + public Object properties() { return this.innerModel().properties(); } diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerNamespaceImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerNamespaceImpl.java new file mode 100644 index 0000000000000..23cb6935485b1 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerNamespaceImpl.java @@ -0,0 +1,287 @@ +// 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.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventgrid.fluent.models.PartnerNamespaceInner; +import com.azure.resourcemanager.eventgrid.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.eventgrid.models.InboundIpRule; +import com.azure.resourcemanager.eventgrid.models.PartnerNamespace; +import com.azure.resourcemanager.eventgrid.models.PartnerNamespaceProvisioningState; +import com.azure.resourcemanager.eventgrid.models.PartnerNamespaceRegenerateKeyRequest; +import com.azure.resourcemanager.eventgrid.models.PartnerNamespaceSharedAccessKeys; +import com.azure.resourcemanager.eventgrid.models.PartnerNamespaceUpdateParameters; +import com.azure.resourcemanager.eventgrid.models.PrivateEndpointConnection; +import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class PartnerNamespaceImpl + implements PartnerNamespace, PartnerNamespace.Definition, PartnerNamespace.Update { + private PartnerNamespaceInner innerObject; + + private final com.azure.resourcemanager.eventgrid.EventGridManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public PartnerNamespaceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String partnerRegistrationFullyQualifiedId() { + return this.innerModel().partnerRegistrationFullyQualifiedId(); + } + + public String endpoint() { + return this.innerModel().endpoint(); + } + + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public List inboundIpRules() { + List inner = this.innerModel().inboundIpRules(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean disableLocalAuth() { + return this.innerModel().disableLocalAuth(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public PartnerNamespaceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.eventgrid.EventGridManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String partnerNamespaceName; + + private PartnerNamespaceUpdateParameters updatePartnerNamespaceUpdateParameters; + + public PartnerNamespaceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public PartnerNamespace create() { + this.innerObject = + serviceManager + .serviceClient() + .getPartnerNamespaces() + .createOrUpdate(resourceGroupName, partnerNamespaceName, this.innerModel(), Context.NONE); + return this; + } + + public PartnerNamespace create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPartnerNamespaces() + .createOrUpdate(resourceGroupName, partnerNamespaceName, this.innerModel(), context); + return this; + } + + PartnerNamespaceImpl(String name, com.azure.resourcemanager.eventgrid.EventGridManager serviceManager) { + this.innerObject = new PartnerNamespaceInner(); + this.serviceManager = serviceManager; + this.partnerNamespaceName = name; + } + + public PartnerNamespaceImpl update() { + this.updatePartnerNamespaceUpdateParameters = new PartnerNamespaceUpdateParameters(); + return this; + } + + public PartnerNamespace apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPartnerNamespaces() + .update(resourceGroupName, partnerNamespaceName, updatePartnerNamespaceUpdateParameters, Context.NONE); + return this; + } + + public PartnerNamespace apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPartnerNamespaces() + .update(resourceGroupName, partnerNamespaceName, updatePartnerNamespaceUpdateParameters, context); + return this; + } + + PartnerNamespaceImpl( + PartnerNamespaceInner innerObject, com.azure.resourcemanager.eventgrid.EventGridManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.partnerNamespaceName = Utils.getValueFromIdByName(innerObject.id(), "partnerNamespaces"); + } + + public PartnerNamespace refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPartnerNamespaces() + .getByResourceGroupWithResponse(resourceGroupName, partnerNamespaceName, Context.NONE) + .getValue(); + return this; + } + + public PartnerNamespace refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPartnerNamespaces() + .getByResourceGroupWithResponse(resourceGroupName, partnerNamespaceName, context) + .getValue(); + return this; + } + + public PartnerNamespaceSharedAccessKeys listSharedAccessKeys() { + return serviceManager.partnerNamespaces().listSharedAccessKeys(resourceGroupName, partnerNamespaceName); + } + + public Response listSharedAccessKeysWithResponse(Context context) { + return serviceManager + .partnerNamespaces() + .listSharedAccessKeysWithResponse(resourceGroupName, partnerNamespaceName, context); + } + + public PartnerNamespaceSharedAccessKeys regenerateKey(PartnerNamespaceRegenerateKeyRequest regenerateKeyRequest) { + return serviceManager + .partnerNamespaces() + .regenerateKey(resourceGroupName, partnerNamespaceName, regenerateKeyRequest); + } + + public Response regenerateKeyWithResponse( + PartnerNamespaceRegenerateKeyRequest regenerateKeyRequest, Context context) { + return serviceManager + .partnerNamespaces() + .regenerateKeyWithResponse(resourceGroupName, partnerNamespaceName, regenerateKeyRequest, context); + } + + public PartnerNamespaceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public PartnerNamespaceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public PartnerNamespaceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updatePartnerNamespaceUpdateParameters.withTags(tags); + return this; + } + } + + public PartnerNamespaceImpl withPartnerRegistrationFullyQualifiedId(String partnerRegistrationFullyQualifiedId) { + this.innerModel().withPartnerRegistrationFullyQualifiedId(partnerRegistrationFullyQualifiedId); + return this; + } + + public PartnerNamespaceImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (isInCreateMode()) { + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); + return this; + } else { + this.updatePartnerNamespaceUpdateParameters.withPublicNetworkAccess(publicNetworkAccess); + return this; + } + } + + public PartnerNamespaceImpl withInboundIpRules(List inboundIpRules) { + if (isInCreateMode()) { + this.innerModel().withInboundIpRules(inboundIpRules); + return this; + } else { + this.updatePartnerNamespaceUpdateParameters.withInboundIpRules(inboundIpRules); + return this; + } + } + + public PartnerNamespaceImpl withDisableLocalAuth(Boolean disableLocalAuth) { + if (isInCreateMode()) { + this.innerModel().withDisableLocalAuth(disableLocalAuth); + return this; + } else { + this.updatePartnerNamespaceUpdateParameters.withDisableLocalAuth(disableLocalAuth); + 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/PartnerNamespaceSharedAccessKeysImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerNamespaceSharedAccessKeysImpl.java new file mode 100644 index 0000000000000..acdb6eb4281cd --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerNamespaceSharedAccessKeysImpl.java @@ -0,0 +1,37 @@ +// 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.resourcemanager.eventgrid.fluent.models.PartnerNamespaceSharedAccessKeysInner; +import com.azure.resourcemanager.eventgrid.models.PartnerNamespaceSharedAccessKeys; + +public final class PartnerNamespaceSharedAccessKeysImpl implements PartnerNamespaceSharedAccessKeys { + private PartnerNamespaceSharedAccessKeysInner innerObject; + + private final com.azure.resourcemanager.eventgrid.EventGridManager serviceManager; + + PartnerNamespaceSharedAccessKeysImpl( + PartnerNamespaceSharedAccessKeysInner innerObject, + com.azure.resourcemanager.eventgrid.EventGridManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String key1() { + return this.innerModel().key1(); + } + + public String key2() { + return this.innerModel().key2(); + } + + public PartnerNamespaceSharedAccessKeysInner 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/PartnerNamespacesClientImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerNamespacesClientImpl.java new file mode 100644 index 0000000000000..5ea1f6f26d08b --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerNamespacesClientImpl.java @@ -0,0 +1,2105 @@ +// 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.BodyParam; +import com.azure.core.annotation.Delete; +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.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +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.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.eventgrid.fluent.PartnerNamespacesClient; +import com.azure.resourcemanager.eventgrid.fluent.models.PartnerNamespaceInner; +import com.azure.resourcemanager.eventgrid.fluent.models.PartnerNamespaceSharedAccessKeysInner; +import com.azure.resourcemanager.eventgrid.models.PartnerNamespaceRegenerateKeyRequest; +import com.azure.resourcemanager.eventgrid.models.PartnerNamespaceUpdateParameters; +import com.azure.resourcemanager.eventgrid.models.PartnerNamespacesListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PartnerNamespacesClient. */ +public final class PartnerNamespacesClientImpl implements PartnerNamespacesClient { + private final ClientLogger logger = new ClientLogger(PartnerNamespacesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PartnerNamespacesService service; + + /** The service client containing this operation class. */ + private final EventGridManagementClientImpl client; + + /** + * Initializes an instance of PartnerNamespacesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PartnerNamespacesClientImpl(EventGridManagementClientImpl client) { + this.service = + RestProxy.create(PartnerNamespacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EventGridManagementClientPartnerNamespaces to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EventGridManagementC") + private interface PartnerNamespacesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerNamespaces/{partnerNamespaceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerNamespaceName") String partnerNamespaceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerNamespaces/{partnerNamespaceName}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerNamespaceName") String partnerNamespaceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PartnerNamespaceInner partnerNamespaceInfo, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerNamespaces/{partnerNamespaceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerNamespaceName") String partnerNamespaceName, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerNamespaces/{partnerNamespaceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerNamespaceName") String partnerNamespaceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PartnerNamespaceUpdateParameters partnerNamespaceUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/partnerNamespaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerNamespaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerNamespaces/{partnerNamespaceName}/listKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSharedAccessKeys( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerNamespaceName") String partnerNamespaceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerNamespaces/{partnerNamespaceName}/regenerateKey") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateKey( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerNamespaceName") String partnerNamespaceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PartnerNamespaceRegenerateKeyRequest regenerateKeyRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get properties of a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 properties of a partner namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String partnerNamespaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerNamespaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerNamespaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerNamespaceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get properties of a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 properties of a partner namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String partnerNamespaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerNamespaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerNamespaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerNamespaceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get properties of a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 properties of a partner namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String partnerNamespaceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, partnerNamespaceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get properties of a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 properties of a partner namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PartnerNamespaceInner getByResourceGroup(String resourceGroupName, String partnerNamespaceName) { + return getByResourceGroupAsync(resourceGroupName, partnerNamespaceName).block(); + } + + /** + * Get properties of a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 properties of a partner namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String partnerNamespaceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, partnerNamespaceName, context).block(); + } + + /** + * Asynchronously creates a new partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceInfo PartnerNamespace information. + * @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 eventGrid Partner Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String partnerNamespaceName, PartnerNamespaceInner partnerNamespaceInfo) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerNamespaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerNamespaceName is required and cannot be null.")); + } + if (partnerNamespaceInfo == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerNamespaceInfo is required and cannot be null.")); + } else { + partnerNamespaceInfo.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerNamespaceName, + this.client.getApiVersion(), + partnerNamespaceInfo, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Asynchronously creates a new partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceInfo PartnerNamespace information. + * @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 eventGrid Partner Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceInner partnerNamespaceInfo, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerNamespaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerNamespaceName is required and cannot be null.")); + } + if (partnerNamespaceInfo == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerNamespaceInfo is required and cannot be null.")); + } else { + partnerNamespaceInfo.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerNamespaceName, + this.client.getApiVersion(), + partnerNamespaceInfo, + accept, + context); + } + + /** + * Asynchronously creates a new partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceInfo PartnerNamespace information. + * @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 eventGrid Partner Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PartnerNamespaceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String partnerNamespaceName, PartnerNamespaceInner partnerNamespaceInfo) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, partnerNamespaceName, partnerNamespaceInfo); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PartnerNamespaceInner.class, + PartnerNamespaceInner.class, + Context.NONE); + } + + /** + * Asynchronously creates a new partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceInfo PartnerNamespace information. + * @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 eventGrid Partner Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PartnerNamespaceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceInner partnerNamespaceInfo, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, partnerNamespaceName, partnerNamespaceInfo, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PartnerNamespaceInner.class, PartnerNamespaceInner.class, context); + } + + /** + * Asynchronously creates a new partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceInfo PartnerNamespace information. + * @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 eventGrid Partner Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PartnerNamespaceInner> beginCreateOrUpdate( + String resourceGroupName, String partnerNamespaceName, PartnerNamespaceInner partnerNamespaceInfo) { + return beginCreateOrUpdateAsync(resourceGroupName, partnerNamespaceName, partnerNamespaceInfo).getSyncPoller(); + } + + /** + * Asynchronously creates a new partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceInfo PartnerNamespace information. + * @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 eventGrid Partner Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PartnerNamespaceInner> beginCreateOrUpdate( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceInner partnerNamespaceInfo, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, partnerNamespaceName, partnerNamespaceInfo, context) + .getSyncPoller(); + } + + /** + * Asynchronously creates a new partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceInfo PartnerNamespace information. + * @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 eventGrid Partner Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String partnerNamespaceName, PartnerNamespaceInner partnerNamespaceInfo) { + return beginCreateOrUpdateAsync(resourceGroupName, partnerNamespaceName, partnerNamespaceInfo) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Asynchronously creates a new partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceInfo PartnerNamespace information. + * @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 eventGrid Partner Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceInner partnerNamespaceInfo, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, partnerNamespaceName, partnerNamespaceInfo, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Asynchronously creates a new partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceInfo PartnerNamespace information. + * @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 eventGrid Partner Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PartnerNamespaceInner createOrUpdate( + String resourceGroupName, String partnerNamespaceName, PartnerNamespaceInner partnerNamespaceInfo) { + return createOrUpdateAsync(resourceGroupName, partnerNamespaceName, partnerNamespaceInfo).block(); + } + + /** + * Asynchronously creates a new partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceInfo PartnerNamespace information. + * @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 eventGrid Partner Namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PartnerNamespaceInner createOrUpdate( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceInner partnerNamespaceInfo, + Context context) { + return createOrUpdateAsync(resourceGroupName, partnerNamespaceName, partnerNamespaceInfo, context).block(); + } + + /** + * Delete existing partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String partnerNamespaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerNamespaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerNamespaceName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerNamespaceName, + this.client.getApiVersion(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete existing partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String partnerNamespaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerNamespaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerNamespaceName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerNamespaceName, + this.client.getApiVersion(), + context); + } + + /** + * Delete existing partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String partnerNamespaceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, partnerNamespaceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete existing partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String partnerNamespaceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, partnerNamespaceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete existing partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String partnerNamespaceName) { + return beginDeleteAsync(resourceGroupName, partnerNamespaceName).getSyncPoller(); + } + + /** + * Delete existing partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String partnerNamespaceName, Context context) { + return beginDeleteAsync(resourceGroupName, partnerNamespaceName, context).getSyncPoller(); + } + + /** + * Delete existing partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String partnerNamespaceName) { + return beginDeleteAsync(resourceGroupName, partnerNamespaceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete existing partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String partnerNamespaceName, Context context) { + return beginDeleteAsync(resourceGroupName, partnerNamespaceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete existing partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String partnerNamespaceName) { + deleteAsync(resourceGroupName, partnerNamespaceName).block(); + } + + /** + * Delete existing partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String partnerNamespaceName, Context context) { + deleteAsync(resourceGroupName, partnerNamespaceName, context).block(); + } + + /** + * Asynchronously updates a partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceUpdateParameters Partner namespace update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceUpdateParameters partnerNamespaceUpdateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerNamespaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerNamespaceName is required and cannot be null.")); + } + if (partnerNamespaceUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter partnerNamespaceUpdateParameters is required and cannot be null.")); + } else { + partnerNamespaceUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerNamespaceName, + this.client.getApiVersion(), + partnerNamespaceUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Asynchronously updates a partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceUpdateParameters Partner namespace update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceUpdateParameters partnerNamespaceUpdateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerNamespaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerNamespaceName is required and cannot be null.")); + } + if (partnerNamespaceUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter partnerNamespaceUpdateParameters is required and cannot be null.")); + } else { + partnerNamespaceUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerNamespaceName, + this.client.getApiVersion(), + partnerNamespaceUpdateParameters, + accept, + context); + } + + /** + * Asynchronously updates a partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceUpdateParameters Partner namespace update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PartnerNamespaceInner> beginUpdateAsync( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceUpdateParameters partnerNamespaceUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, partnerNamespaceName, partnerNamespaceUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PartnerNamespaceInner.class, + PartnerNamespaceInner.class, + Context.NONE); + } + + /** + * Asynchronously updates a partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceUpdateParameters Partner namespace update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PartnerNamespaceInner> beginUpdateAsync( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceUpdateParameters partnerNamespaceUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, partnerNamespaceName, partnerNamespaceUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), PartnerNamespaceInner.class, PartnerNamespaceInner.class, context); + } + + /** + * Asynchronously updates a partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceUpdateParameters Partner namespace update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PartnerNamespaceInner> beginUpdate( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceUpdateParameters partnerNamespaceUpdateParameters) { + return beginUpdateAsync(resourceGroupName, partnerNamespaceName, partnerNamespaceUpdateParameters) + .getSyncPoller(); + } + + /** + * Asynchronously updates a partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceUpdateParameters Partner namespace update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PartnerNamespaceInner> beginUpdate( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceUpdateParameters partnerNamespaceUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, partnerNamespaceName, partnerNamespaceUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Asynchronously updates a partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceUpdateParameters Partner namespace update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceUpdateParameters partnerNamespaceUpdateParameters) { + return beginUpdateAsync(resourceGroupName, partnerNamespaceName, partnerNamespaceUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Asynchronously updates a partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceUpdateParameters Partner namespace update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceUpdateParameters partnerNamespaceUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, partnerNamespaceName, partnerNamespaceUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Asynchronously updates a partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceUpdateParameters Partner namespace update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PartnerNamespaceInner update( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceUpdateParameters partnerNamespaceUpdateParameters) { + return updateAsync(resourceGroupName, partnerNamespaceName, partnerNamespaceUpdateParameters).block(); + } + + /** + * Asynchronously updates a partner namespace with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param partnerNamespaceUpdateParameters Partner namespace update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PartnerNamespaceInner update( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceUpdateParameters partnerNamespaceUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, partnerNamespaceName, partnerNamespaceUpdateParameters, context).block(); + } + + /** + * List all the partner namespaces under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Namespaces operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + filter, + top, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all the partner namespaces under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Namespaces operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String filter, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + filter, + top, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all the partner namespaces under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Namespaces operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Integer top) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, top), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List all the partner namespaces under an Azure subscription. + * + * @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 result of the List Partner Namespaces operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + final Integer top = null; + return new PagedFlux<>( + () -> listSinglePageAsync(filter, top), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List all the partner namespaces under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Namespaces operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Integer top, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, top, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List all the partner namespaces under an Azure subscription. + * + * @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 result of the List Partner Namespaces operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listAsync(filter, top)); + } + + /** + * List all the partner namespaces under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Namespaces operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Integer top, Context context) { + return new PagedIterable<>(listAsync(filter, top, context)); + } + + /** + * List all the partner namespaces under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Namespaces operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String filter, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + filter, + top, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all the partner namespaces under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Namespaces operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String filter, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + filter, + top, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all the partner namespaces under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Namespaces operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String filter, Integer top) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List all the partner namespaces under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 result of the List Partner Namespaces operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String filter = null; + final Integer top = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List all the partner namespaces under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Namespaces operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String filter, Integer top, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List all the partner namespaces under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 result of the List Partner Namespaces operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, top)); + } + + /** + * List all the partner namespaces under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Namespaces operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String filter, Integer top, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, top, context)); + } + + /** + * List the two keys used to publish to a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 shared access keys of the partner namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSharedAccessKeysWithResponseAsync( + String resourceGroupName, String partnerNamespaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerNamespaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerNamespaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSharedAccessKeys( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerNamespaceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the two keys used to publish to a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 shared access keys of the partner namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSharedAccessKeysWithResponseAsync( + String resourceGroupName, String partnerNamespaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerNamespaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerNamespaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSharedAccessKeys( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerNamespaceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * List the two keys used to publish to a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 shared access keys of the partner namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSharedAccessKeysAsync( + String resourceGroupName, String partnerNamespaceName) { + return listSharedAccessKeysWithResponseAsync(resourceGroupName, partnerNamespaceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * List the two keys used to publish to a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 shared access keys of the partner namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PartnerNamespaceSharedAccessKeysInner listSharedAccessKeys( + String resourceGroupName, String partnerNamespaceName) { + return listSharedAccessKeysAsync(resourceGroupName, partnerNamespaceName).block(); + } + + /** + * List the two keys used to publish to a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 shared access keys of the partner namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSharedAccessKeysWithResponse( + String resourceGroupName, String partnerNamespaceName, Context context) { + return listSharedAccessKeysWithResponseAsync(resourceGroupName, partnerNamespaceName, context).block(); + } + + /** + * Regenerate a shared access key for a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param regenerateKeyRequest Request body to regenerate key. + * @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 shared access keys of the partner namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeyWithResponseAsync( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceRegenerateKeyRequest regenerateKeyRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerNamespaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerNamespaceName is required and cannot be null.")); + } + if (regenerateKeyRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter regenerateKeyRequest is required and cannot be null.")); + } else { + regenerateKeyRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .regenerateKey( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerNamespaceName, + this.client.getApiVersion(), + regenerateKeyRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Regenerate a shared access key for a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param regenerateKeyRequest Request body to regenerate key. + * @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 shared access keys of the partner namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateKeyWithResponseAsync( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceRegenerateKeyRequest regenerateKeyRequest, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerNamespaceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerNamespaceName is required and cannot be null.")); + } + if (regenerateKeyRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter regenerateKeyRequest is required and cannot be null.")); + } else { + regenerateKeyRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .regenerateKey( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerNamespaceName, + this.client.getApiVersion(), + regenerateKeyRequest, + accept, + context); + } + + /** + * Regenerate a shared access key for a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param regenerateKeyRequest Request body to regenerate key. + * @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 shared access keys of the partner namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateKeyAsync( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceRegenerateKeyRequest regenerateKeyRequest) { + return regenerateKeyWithResponseAsync(resourceGroupName, partnerNamespaceName, regenerateKeyRequest) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Regenerate a shared access key for a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param regenerateKeyRequest Request body to regenerate key. + * @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 shared access keys of the partner namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PartnerNamespaceSharedAccessKeysInner regenerateKey( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceRegenerateKeyRequest regenerateKeyRequest) { + return regenerateKeyAsync(resourceGroupName, partnerNamespaceName, regenerateKeyRequest).block(); + } + + /** + * Regenerate a shared access key for a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param regenerateKeyRequest Request body to regenerate key. + * @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 shared access keys of the partner namespace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateKeyWithResponse( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceRegenerateKeyRequest regenerateKeyRequest, + Context context) { + return regenerateKeyWithResponseAsync(resourceGroupName, partnerNamespaceName, regenerateKeyRequest, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 result of the List Partner Namespaces operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 result of the List Partner Namespaces operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 result of the List Partner Namespaces operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 result of the List Partner Namespaces operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerNamespacesImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerNamespacesImpl.java new file mode 100644 index 0000000000000..461a040ac0071 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerNamespacesImpl.java @@ -0,0 +1,242 @@ +// 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.PagedIterable; +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.PartnerNamespacesClient; +import com.azure.resourcemanager.eventgrid.fluent.models.PartnerNamespaceInner; +import com.azure.resourcemanager.eventgrid.fluent.models.PartnerNamespaceSharedAccessKeysInner; +import com.azure.resourcemanager.eventgrid.models.PartnerNamespace; +import com.azure.resourcemanager.eventgrid.models.PartnerNamespaceRegenerateKeyRequest; +import com.azure.resourcemanager.eventgrid.models.PartnerNamespaceSharedAccessKeys; +import com.azure.resourcemanager.eventgrid.models.PartnerNamespaces; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PartnerNamespacesImpl implements PartnerNamespaces { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PartnerNamespacesImpl.class); + + private final PartnerNamespacesClient innerClient; + + private final com.azure.resourcemanager.eventgrid.EventGridManager serviceManager; + + public PartnerNamespacesImpl( + PartnerNamespacesClient innerClient, com.azure.resourcemanager.eventgrid.EventGridManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PartnerNamespace getByResourceGroup(String resourceGroupName, String partnerNamespaceName) { + PartnerNamespaceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, partnerNamespaceName); + if (inner != null) { + return new PartnerNamespaceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String partnerNamespaceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, partnerNamespaceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PartnerNamespaceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String partnerNamespaceName) { + this.serviceClient().delete(resourceGroupName, partnerNamespaceName); + } + + public void delete(String resourceGroupName, String partnerNamespaceName, Context context) { + this.serviceClient().delete(resourceGroupName, partnerNamespaceName, context); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new PartnerNamespaceImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, Integer top, Context context) { + PagedIterable inner = this.serviceClient().list(filter, top, context); + return Utils.mapPage(inner, inner1 -> new PartnerNamespaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PartnerNamespaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, String filter, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, filter, top, context); + return Utils.mapPage(inner, inner1 -> new PartnerNamespaceImpl(inner1, this.manager())); + } + + public PartnerNamespaceSharedAccessKeys listSharedAccessKeys( + String resourceGroupName, String partnerNamespaceName) { + PartnerNamespaceSharedAccessKeysInner inner = + this.serviceClient().listSharedAccessKeys(resourceGroupName, partnerNamespaceName); + if (inner != null) { + return new PartnerNamespaceSharedAccessKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listSharedAccessKeysWithResponse( + String resourceGroupName, String partnerNamespaceName, Context context) { + Response inner = + this.serviceClient().listSharedAccessKeysWithResponse(resourceGroupName, partnerNamespaceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PartnerNamespaceSharedAccessKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PartnerNamespaceSharedAccessKeys regenerateKey( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceRegenerateKeyRequest regenerateKeyRequest) { + PartnerNamespaceSharedAccessKeysInner inner = + this.serviceClient().regenerateKey(resourceGroupName, partnerNamespaceName, regenerateKeyRequest); + if (inner != null) { + return new PartnerNamespaceSharedAccessKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response regenerateKeyWithResponse( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceRegenerateKeyRequest regenerateKeyRequest, + Context context) { + Response inner = + this + .serviceClient() + .regenerateKeyWithResponse(resourceGroupName, partnerNamespaceName, regenerateKeyRequest, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PartnerNamespaceSharedAccessKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PartnerNamespace getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String partnerNamespaceName = Utils.getValueFromIdByName(id, "partnerNamespaces"); + if (partnerNamespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'partnerNamespaces'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, partnerNamespaceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String partnerNamespaceName = Utils.getValueFromIdByName(id, "partnerNamespaces"); + if (partnerNamespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'partnerNamespaces'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, partnerNamespaceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String partnerNamespaceName = Utils.getValueFromIdByName(id, "partnerNamespaces"); + if (partnerNamespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'partnerNamespaces'.", id))); + } + this.delete(resourceGroupName, partnerNamespaceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String partnerNamespaceName = Utils.getValueFromIdByName(id, "partnerNamespaces"); + if (partnerNamespaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'partnerNamespaces'.", id))); + } + this.delete(resourceGroupName, partnerNamespaceName, context); + } + + private PartnerNamespacesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.eventgrid.EventGridManager manager() { + return this.serviceManager; + } + + public PartnerNamespaceImpl define(String name) { + return new PartnerNamespaceImpl(name, this.manager()); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerRegistrationImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerRegistrationImpl.java new file mode 100644 index 0000000000000..4eb0db1bc5dea --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerRegistrationImpl.java @@ -0,0 +1,334 @@ +// 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.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventgrid.fluent.models.PartnerRegistrationInner; +import com.azure.resourcemanager.eventgrid.models.PartnerRegistration; +import com.azure.resourcemanager.eventgrid.models.PartnerRegistrationProvisioningState; +import com.azure.resourcemanager.eventgrid.models.PartnerRegistrationUpdateParameters; +import com.azure.resourcemanager.eventgrid.models.PartnerRegistrationVisibilityState; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class PartnerRegistrationImpl + implements PartnerRegistration, PartnerRegistration.Definition, PartnerRegistration.Update { + private PartnerRegistrationInner innerObject; + + private final com.azure.resourcemanager.eventgrid.EventGridManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PartnerRegistrationProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String partnerName() { + return this.innerModel().partnerName(); + } + + public String partnerResourceTypeName() { + return this.innerModel().partnerResourceTypeName(); + } + + public String partnerResourceTypeDisplayName() { + return this.innerModel().partnerResourceTypeDisplayName(); + } + + public String partnerResourceTypeDescription() { + return this.innerModel().partnerResourceTypeDescription(); + } + + public String longDescription() { + return this.innerModel().longDescription(); + } + + public String partnerCustomerServiceNumber() { + return this.innerModel().partnerCustomerServiceNumber(); + } + + public String partnerCustomerServiceExtension() { + return this.innerModel().partnerCustomerServiceExtension(); + } + + public String customerServiceUri() { + return this.innerModel().customerServiceUri(); + } + + public String setupUri() { + return this.innerModel().setupUri(); + } + + public String logoUri() { + return this.innerModel().logoUri(); + } + + public PartnerRegistrationVisibilityState visibilityState() { + return this.innerModel().visibilityState(); + } + + public List authorizedAzureSubscriptionIds() { + List inner = this.innerModel().authorizedAzureSubscriptionIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public PartnerRegistrationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.eventgrid.EventGridManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String partnerRegistrationName; + + private PartnerRegistrationUpdateParameters updatePartnerRegistrationUpdateParameters; + + public PartnerRegistrationImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public PartnerRegistration create() { + this.innerObject = + serviceManager + .serviceClient() + .getPartnerRegistrations() + .createOrUpdateWithResponse(resourceGroupName, partnerRegistrationName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public PartnerRegistration create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPartnerRegistrations() + .createOrUpdateWithResponse(resourceGroupName, partnerRegistrationName, this.innerModel(), context) + .getValue(); + return this; + } + + PartnerRegistrationImpl(String name, com.azure.resourcemanager.eventgrid.EventGridManager serviceManager) { + this.innerObject = new PartnerRegistrationInner(); + this.serviceManager = serviceManager; + this.partnerRegistrationName = name; + } + + public PartnerRegistrationImpl update() { + this.updatePartnerRegistrationUpdateParameters = new PartnerRegistrationUpdateParameters(); + return this; + } + + public PartnerRegistration apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPartnerRegistrations() + .updateWithResponse( + resourceGroupName, partnerRegistrationName, updatePartnerRegistrationUpdateParameters, Context.NONE) + .getValue(); + return this; + } + + public PartnerRegistration apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPartnerRegistrations() + .updateWithResponse( + resourceGroupName, partnerRegistrationName, updatePartnerRegistrationUpdateParameters, context) + .getValue(); + return this; + } + + PartnerRegistrationImpl( + PartnerRegistrationInner innerObject, com.azure.resourcemanager.eventgrid.EventGridManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.partnerRegistrationName = Utils.getValueFromIdByName(innerObject.id(), "partnerRegistrations"); + } + + public PartnerRegistration refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPartnerRegistrations() + .getByResourceGroupWithResponse(resourceGroupName, partnerRegistrationName, Context.NONE) + .getValue(); + return this; + } + + public PartnerRegistration refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPartnerRegistrations() + .getByResourceGroupWithResponse(resourceGroupName, partnerRegistrationName, context) + .getValue(); + return this; + } + + public PartnerRegistrationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public PartnerRegistrationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public PartnerRegistrationImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updatePartnerRegistrationUpdateParameters.withTags(tags); + return this; + } + } + + public PartnerRegistrationImpl withPartnerName(String partnerName) { + this.innerModel().withPartnerName(partnerName); + return this; + } + + public PartnerRegistrationImpl withPartnerResourceTypeName(String partnerResourceTypeName) { + this.innerModel().withPartnerResourceTypeName(partnerResourceTypeName); + return this; + } + + public PartnerRegistrationImpl withPartnerResourceTypeDisplayName(String partnerResourceTypeDisplayName) { + this.innerModel().withPartnerResourceTypeDisplayName(partnerResourceTypeDisplayName); + return this; + } + + public PartnerRegistrationImpl withPartnerResourceTypeDescription(String partnerResourceTypeDescription) { + this.innerModel().withPartnerResourceTypeDescription(partnerResourceTypeDescription); + return this; + } + + public PartnerRegistrationImpl withLongDescription(String longDescription) { + this.innerModel().withLongDescription(longDescription); + return this; + } + + public PartnerRegistrationImpl withPartnerCustomerServiceNumber(String partnerCustomerServiceNumber) { + this.innerModel().withPartnerCustomerServiceNumber(partnerCustomerServiceNumber); + return this; + } + + public PartnerRegistrationImpl withPartnerCustomerServiceExtension(String partnerCustomerServiceExtension) { + this.innerModel().withPartnerCustomerServiceExtension(partnerCustomerServiceExtension); + return this; + } + + public PartnerRegistrationImpl withCustomerServiceUri(String customerServiceUri) { + this.innerModel().withCustomerServiceUri(customerServiceUri); + return this; + } + + public PartnerRegistrationImpl withSetupUri(String setupUri) { + if (isInCreateMode()) { + this.innerModel().withSetupUri(setupUri); + return this; + } else { + this.updatePartnerRegistrationUpdateParameters.withSetupUri(setupUri); + return this; + } + } + + public PartnerRegistrationImpl withLogoUri(String logoUri) { + if (isInCreateMode()) { + this.innerModel().withLogoUri(logoUri); + return this; + } else { + this.updatePartnerRegistrationUpdateParameters.withLogoUri(logoUri); + return this; + } + } + + public PartnerRegistrationImpl withVisibilityState(PartnerRegistrationVisibilityState visibilityState) { + this.innerModel().withVisibilityState(visibilityState); + return this; + } + + public PartnerRegistrationImpl withAuthorizedAzureSubscriptionIds(List authorizedAzureSubscriptionIds) { + if (isInCreateMode()) { + this.innerModel().withAuthorizedAzureSubscriptionIds(authorizedAzureSubscriptionIds); + return this; + } else { + this + .updatePartnerRegistrationUpdateParameters + .withAuthorizedAzureSubscriptionIds(authorizedAzureSubscriptionIds); + return this; + } + } + + public PartnerRegistrationImpl withPartnerTopicTypeName(String partnerTopicTypeName) { + this.updatePartnerRegistrationUpdateParameters.withPartnerTopicTypeName(partnerTopicTypeName); + return this; + } + + public PartnerRegistrationImpl withPartnerTopicTypeDisplayName(String partnerTopicTypeDisplayName) { + this.updatePartnerRegistrationUpdateParameters.withPartnerTopicTypeDisplayName(partnerTopicTypeDisplayName); + return this; + } + + public PartnerRegistrationImpl withPartnerTopicTypeDescription(String partnerTopicTypeDescription) { + this.updatePartnerRegistrationUpdateParameters.withPartnerTopicTypeDescription(partnerTopicTypeDescription); + 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/PartnerRegistrationsClientImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerRegistrationsClientImpl.java new file mode 100644 index 0000000000000..453f1b4a48b1e --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerRegistrationsClientImpl.java @@ -0,0 +1,1431 @@ +// 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.BodyParam; +import com.azure.core.annotation.Delete; +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.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +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.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.PartnerRegistrationsClient; +import com.azure.resourcemanager.eventgrid.fluent.models.PartnerRegistrationInner; +import com.azure.resourcemanager.eventgrid.models.PartnerRegistrationUpdateParameters; +import com.azure.resourcemanager.eventgrid.models.PartnerRegistrationsListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PartnerRegistrationsClient. */ +public final class PartnerRegistrationsClientImpl implements PartnerRegistrationsClient { + private final ClientLogger logger = new ClientLogger(PartnerRegistrationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PartnerRegistrationsService service; + + /** The service client containing this operation class. */ + private final EventGridManagementClientImpl client; + + /** + * Initializes an instance of PartnerRegistrationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PartnerRegistrationsClientImpl(EventGridManagementClientImpl client) { + this.service = + RestProxy + .create(PartnerRegistrationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EventGridManagementClientPartnerRegistrations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EventGridManagementC") + private interface PartnerRegistrationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerRegistrations/{partnerRegistrationName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerRegistrationName") String partnerRegistrationName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerRegistrations/{partnerRegistrationName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerRegistrationName") String partnerRegistrationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PartnerRegistrationInner partnerRegistrationInfo, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerRegistrations/{partnerRegistrationName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerRegistrationName") String partnerRegistrationName, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerRegistrations/{partnerRegistrationName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerRegistrationName") String partnerRegistrationName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PartnerRegistrationUpdateParameters partnerRegistrationUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/partnerRegistrations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerRegistrations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @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 a partner registration with the specified parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String partnerRegistrationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerRegistrationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter partnerRegistrationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerRegistrationName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @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 a partner registration with the specified parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String partnerRegistrationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerRegistrationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter partnerRegistrationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerRegistrationName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @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 a partner registration with the specified parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String partnerRegistrationName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, partnerRegistrationName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @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 a partner registration with the specified parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PartnerRegistrationInner getByResourceGroup(String resourceGroupName, String partnerRegistrationName) { + return getByResourceGroupAsync(resourceGroupName, partnerRegistrationName).block(); + } + + /** + * Gets a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @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 a partner registration with the specified parameters. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String partnerRegistrationName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, partnerRegistrationName, context).block(); + } + + /** + * Creates a new partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @param partnerRegistrationInfo PartnerRegistration information. + * @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 information about a partner registration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String partnerRegistrationName, PartnerRegistrationInner partnerRegistrationInfo) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerRegistrationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter partnerRegistrationName is required and cannot be null.")); + } + if (partnerRegistrationInfo == null) { + return Mono + .error( + new IllegalArgumentException("Parameter partnerRegistrationInfo is required and cannot be null.")); + } else { + partnerRegistrationInfo.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerRegistrationName, + this.client.getApiVersion(), + partnerRegistrationInfo, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a new partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @param partnerRegistrationInfo PartnerRegistration information. + * @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 information about a partner registration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String partnerRegistrationName, + PartnerRegistrationInner partnerRegistrationInfo, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerRegistrationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter partnerRegistrationName is required and cannot be null.")); + } + if (partnerRegistrationInfo == null) { + return Mono + .error( + new IllegalArgumentException("Parameter partnerRegistrationInfo is required and cannot be null.")); + } else { + partnerRegistrationInfo.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerRegistrationName, + this.client.getApiVersion(), + partnerRegistrationInfo, + accept, + context); + } + + /** + * Creates a new partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @param partnerRegistrationInfo PartnerRegistration information. + * @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 information about a partner registration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String partnerRegistrationName, PartnerRegistrationInner partnerRegistrationInfo) { + return createOrUpdateWithResponseAsync(resourceGroupName, partnerRegistrationName, partnerRegistrationInfo) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates a new partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @param partnerRegistrationInfo PartnerRegistration information. + * @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 information about a partner registration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PartnerRegistrationInner createOrUpdate( + String resourceGroupName, String partnerRegistrationName, PartnerRegistrationInner partnerRegistrationInfo) { + return createOrUpdateAsync(resourceGroupName, partnerRegistrationName, partnerRegistrationInfo).block(); + } + + /** + * Creates a new partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @param partnerRegistrationInfo PartnerRegistration information. + * @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 information about a partner registration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String partnerRegistrationName, + PartnerRegistrationInner partnerRegistrationInfo, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, partnerRegistrationName, partnerRegistrationInfo, context) + .block(); + } + + /** + * Deletes a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String partnerRegistrationName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerRegistrationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter partnerRegistrationName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerRegistrationName, + this.client.getApiVersion(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String partnerRegistrationName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerRegistrationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter partnerRegistrationName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerRegistrationName, + this.client.getApiVersion(), + context); + } + + /** + * Deletes a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String partnerRegistrationName) { + return deleteWithResponseAsync(resourceGroupName, partnerRegistrationName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String partnerRegistrationName) { + deleteAsync(resourceGroupName, partnerRegistrationName).block(); + } + + /** + * Deletes a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String partnerRegistrationName, Context context) { + return deleteWithResponseAsync(resourceGroupName, partnerRegistrationName, context).block(); + } + + /** + * Updates a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @param partnerRegistrationUpdateParameters Partner registration update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String partnerRegistrationName, + PartnerRegistrationUpdateParameters partnerRegistrationUpdateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerRegistrationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter partnerRegistrationName is required and cannot be null.")); + } + if (partnerRegistrationUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter partnerRegistrationUpdateParameters is required and cannot be null.")); + } else { + partnerRegistrationUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerRegistrationName, + this.client.getApiVersion(), + partnerRegistrationUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @param partnerRegistrationUpdateParameters Partner registration update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String partnerRegistrationName, + PartnerRegistrationUpdateParameters partnerRegistrationUpdateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerRegistrationName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter partnerRegistrationName is required and cannot be null.")); + } + if (partnerRegistrationUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter partnerRegistrationUpdateParameters is required and cannot be null.")); + } else { + partnerRegistrationUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerRegistrationName, + this.client.getApiVersion(), + partnerRegistrationUpdateParameters, + accept, + context); + } + + /** + * Updates a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @param partnerRegistrationUpdateParameters Partner registration update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String partnerRegistrationName, + PartnerRegistrationUpdateParameters partnerRegistrationUpdateParameters) { + return updateWithResponseAsync(resourceGroupName, partnerRegistrationName, partnerRegistrationUpdateParameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @param partnerRegistrationUpdateParameters Partner registration update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PartnerRegistrationInner update( + String resourceGroupName, + String partnerRegistrationName, + PartnerRegistrationUpdateParameters partnerRegistrationUpdateParameters) { + return updateAsync(resourceGroupName, partnerRegistrationName, partnerRegistrationUpdateParameters).block(); + } + + /** + * Updates a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @param partnerRegistrationUpdateParameters Partner registration update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String partnerRegistrationName, + PartnerRegistrationUpdateParameters partnerRegistrationUpdateParameters, + Context context) { + return updateWithResponseAsync( + resourceGroupName, partnerRegistrationName, partnerRegistrationUpdateParameters, context) + .block(); + } + + /** + * List all the partner registrations under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Registrations operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + filter, + top, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all the partner registrations under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Registrations operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String filter, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + filter, + top, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all the partner registrations under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Registrations operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Integer top) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, top), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List all the partner registrations under an Azure subscription. + * + * @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 result of the List Partner Registrations operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + final Integer top = null; + return new PagedFlux<>( + () -> listSinglePageAsync(filter, top), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List all the partner registrations under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Registrations operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Integer top, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, top, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List all the partner registrations under an Azure subscription. + * + * @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 result of the List Partner Registrations operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listAsync(filter, top)); + } + + /** + * List all the partner registrations under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Registrations operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Integer top, Context context) { + return new PagedIterable<>(listAsync(filter, top, context)); + } + + /** + * List all the partner registrations under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Registrations operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String filter, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + filter, + top, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all the partner registrations under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Registrations operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String filter, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + filter, + top, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all the partner registrations under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Registrations operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String filter, Integer top) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List all the partner registrations under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 result of the List Partner Registrations operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String filter = null; + final Integer top = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List all the partner registrations under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Registrations operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String filter, Integer top, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List all the partner registrations under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 result of the List Partner Registrations operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, top)); + } + + /** + * List all the partner registrations under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Registrations operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String filter, Integer top, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, top, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 result of the List Partner Registrations operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 result of the List Partner Registrations operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 result of the List Partner Registrations operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 result of the List Partner Registrations operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerRegistrationsImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerRegistrationsImpl.java new file mode 100644 index 0000000000000..ec321df452e0e --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerRegistrationsImpl.java @@ -0,0 +1,186 @@ +// 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.PagedIterable; +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.PartnerRegistrationsClient; +import com.azure.resourcemanager.eventgrid.fluent.models.PartnerRegistrationInner; +import com.azure.resourcemanager.eventgrid.models.PartnerRegistration; +import com.azure.resourcemanager.eventgrid.models.PartnerRegistrations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PartnerRegistrationsImpl implements PartnerRegistrations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PartnerRegistrationsImpl.class); + + private final PartnerRegistrationsClient innerClient; + + private final com.azure.resourcemanager.eventgrid.EventGridManager serviceManager; + + public PartnerRegistrationsImpl( + PartnerRegistrationsClient innerClient, com.azure.resourcemanager.eventgrid.EventGridManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PartnerRegistration getByResourceGroup(String resourceGroupName, String partnerRegistrationName) { + PartnerRegistrationInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, partnerRegistrationName); + if (inner != null) { + return new PartnerRegistrationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String partnerRegistrationName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, partnerRegistrationName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PartnerRegistrationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String partnerRegistrationName) { + this.serviceClient().delete(resourceGroupName, partnerRegistrationName); + } + + public Response deleteWithResponse( + String resourceGroupName, String partnerRegistrationName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, partnerRegistrationName, context); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new PartnerRegistrationImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, Integer top, Context context) { + PagedIterable inner = this.serviceClient().list(filter, top, context); + return Utils.mapPage(inner, inner1 -> new PartnerRegistrationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PartnerRegistrationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, String filter, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, filter, top, context); + return Utils.mapPage(inner, inner1 -> new PartnerRegistrationImpl(inner1, this.manager())); + } + + public PartnerRegistration getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String partnerRegistrationName = Utils.getValueFromIdByName(id, "partnerRegistrations"); + if (partnerRegistrationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'partnerRegistrations'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, partnerRegistrationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String partnerRegistrationName = Utils.getValueFromIdByName(id, "partnerRegistrations"); + if (partnerRegistrationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'partnerRegistrations'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, partnerRegistrationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String partnerRegistrationName = Utils.getValueFromIdByName(id, "partnerRegistrations"); + if (partnerRegistrationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'partnerRegistrations'.", + id))); + } + this.deleteWithResponse(resourceGroupName, partnerRegistrationName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String partnerRegistrationName = Utils.getValueFromIdByName(id, "partnerRegistrations"); + if (partnerRegistrationName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'partnerRegistrations'.", + id))); + } + return this.deleteWithResponse(resourceGroupName, partnerRegistrationName, context); + } + + private PartnerRegistrationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.eventgrid.EventGridManager manager() { + return this.serviceManager; + } + + public PartnerRegistrationImpl define(String name) { + return new PartnerRegistrationImpl(name, this.manager()); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerTopicEventSubscriptionsClientImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerTopicEventSubscriptionsClientImpl.java new file mode 100644 index 0000000000000..e677ae9b88073 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerTopicEventSubscriptionsClientImpl.java @@ -0,0 +1,2025 @@ +// 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.BodyParam; +import com.azure.core.annotation.Delete; +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.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +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.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.eventgrid.fluent.PartnerTopicEventSubscriptionsClient; +import com.azure.resourcemanager.eventgrid.fluent.models.DeliveryAttributeListResultInner; +import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionFullUrlInner; +import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner; +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters; +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionsListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PartnerTopicEventSubscriptionsClient. */ +public final class PartnerTopicEventSubscriptionsClientImpl implements PartnerTopicEventSubscriptionsClient { + private final ClientLogger logger = new ClientLogger(PartnerTopicEventSubscriptionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PartnerTopicEventSubscriptionsService service; + + /** The service client containing this operation class. */ + private final EventGridManagementClientImpl client; + + /** + * Initializes an instance of PartnerTopicEventSubscriptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PartnerTopicEventSubscriptionsClientImpl(EventGridManagementClientImpl client) { + this.service = + RestProxy + .create( + PartnerTopicEventSubscriptionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EventGridManagementClientPartnerTopicEventSubscriptions to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EventGridManagementC") + private interface PartnerTopicEventSubscriptionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerTopicName") String partnerTopicName, + @PathParam("eventSubscriptionName") String eventSubscriptionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerTopicName") String partnerTopicName, + @PathParam("eventSubscriptionName") String eventSubscriptionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") EventSubscriptionInner eventSubscriptionInfo, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerTopicName") String partnerTopicName, + @PathParam("eventSubscriptionName") String eventSubscriptionName, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerTopicName") String partnerTopicName, + @PathParam("eventSubscriptionName") String eventSubscriptionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getFullUrl( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerTopicName") String partnerTopicName, + @PathParam("eventSubscriptionName") String eventSubscriptionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerTopics/{partnerTopicName}/eventSubscriptions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPartnerTopic( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerTopicName") String partnerTopicName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDeliveryAttributes( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerTopicName") String partnerTopicName, + @PathParam("eventSubscriptionName") String eventSubscriptionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPartnerTopicNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be found. Event subscription names must be between + * 3 and 100 characters in length and use alphanumeric letters only. + * @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 an event subscription of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be found. Event subscription names must be between + * 3 and 100 characters in length and use alphanumeric letters only. + * @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 an event subscription of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be found. Event subscription names must be between + * 3 and 100 characters in length and use alphanumeric letters only. + * @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 an event subscription of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName) { + return getWithResponseAsync(resourceGroupName, partnerTopicName, eventSubscriptionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be found. Event subscription names must be between + * 3 and 100 characters in length and use alphanumeric letters only. + * @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 an event subscription of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EventSubscriptionInner get(String resourceGroupName, String partnerTopicName, String eventSubscriptionName) { + return getAsync(resourceGroupName, partnerTopicName, eventSubscriptionName).block(); + } + + /** + * Get an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be found. Event subscription names must be between + * 3 and 100 characters in length and use alphanumeric letters only. + * @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 an event subscription of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context) { + return getWithResponseAsync(resourceGroupName, partnerTopicName, eventSubscriptionName, context).block(); + } + + /** + * Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. + * Existing event subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + if (eventSubscriptionInfo == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionInfo is required and cannot be null.")); + } else { + eventSubscriptionInfo.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + eventSubscriptionInfo, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. + * Existing event subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + if (eventSubscriptionInfo == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionInfo is required and cannot be null.")); + } else { + eventSubscriptionInfo.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + eventSubscriptionInfo, + accept, + context); + } + + /** + * Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. + * Existing event subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, EventSubscriptionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionInfo); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EventSubscriptionInner.class, + EventSubscriptionInner.class, + Context.NONE); + } + + /** + * Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. + * Existing event subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, EventSubscriptionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionInfo, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EventSubscriptionInner.class, + EventSubscriptionInner.class, + context); + } + + /** + * Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. + * Existing event subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, EventSubscriptionInner> beginCreateOrUpdate( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo) { + return beginCreateOrUpdateAsync( + resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionInfo) + .getSyncPoller(); + } + + /** + * Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. + * Existing event subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, EventSubscriptionInner> beginCreateOrUpdate( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionInfo, context) + .getSyncPoller(); + } + + /** + * Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. + * Existing event subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo) { + return beginCreateOrUpdateAsync( + resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionInfo) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. + * Existing event subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionInfo, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. + * Existing event subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EventSubscriptionInner createOrUpdate( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo) { + return createOrUpdateAsync(resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionInfo) + .block(); + } + + /** + * Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. + * Existing event subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EventSubscriptionInner createOrUpdate( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo, + Context context) { + return createOrUpdateAsync( + resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionInfo, context) + .block(); + } + + /** + * Delete an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + context); + } + + /** + * Delete an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, partnerTopicName, eventSubscriptionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, partnerTopicName, eventSubscriptionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName) { + return beginDeleteAsync(resourceGroupName, partnerTopicName, eventSubscriptionName).getSyncPoller(); + } + + /** + * Delete an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context) { + return beginDeleteAsync(resourceGroupName, partnerTopicName, eventSubscriptionName, context).getSyncPoller(); + } + + /** + * Delete an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String partnerTopicName, String eventSubscriptionName) { + return beginDeleteAsync(resourceGroupName, partnerTopicName, eventSubscriptionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context) { + return beginDeleteAsync(resourceGroupName, partnerTopicName, eventSubscriptionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String partnerTopicName, String eventSubscriptionName) { + deleteAsync(resourceGroupName, partnerTopicName, eventSubscriptionName).block(); + } + + /** + * Delete an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context) { + deleteAsync(resourceGroupName, partnerTopicName, eventSubscriptionName, context).block(); + } + + /** + * Update event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + if (eventSubscriptionUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter eventSubscriptionUpdateParameters is required and cannot be null.")); + } else { + eventSubscriptionUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + eventSubscriptionUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + if (eventSubscriptionUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter eventSubscriptionUpdateParameters is required and cannot be null.")); + } else { + eventSubscriptionUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + eventSubscriptionUpdateParameters, + accept, + context); + } + + /** + * Update event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, EventSubscriptionInner> beginUpdateAsync( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EventSubscriptionInner.class, + EventSubscriptionInner.class, + Context.NONE); + } + + /** + * Update event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, EventSubscriptionInner> beginUpdateAsync( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionUpdateParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EventSubscriptionInner.class, + EventSubscriptionInner.class, + context); + } + + /** + * Update event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, EventSubscriptionInner> beginUpdate( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + return beginUpdateAsync( + resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionUpdateParameters) + .getSyncPoller(); + } + + /** + * Update event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, EventSubscriptionInner> beginUpdate( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, + Context context) { + return beginUpdateAsync( + resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Update event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + return beginUpdateAsync( + resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, + Context context) { + return beginUpdateAsync( + resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EventSubscriptionInner update( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + return updateAsync( + resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionUpdateParameters) + .block(); + } + + /** + * Update event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EventSubscriptionInner update( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, + Context context) { + return updateAsync( + resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionUpdateParameters, context) + .block(); + } + + /** + * Get the full endpoint URL for an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 full endpoint URL for an event subscription of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getFullUrlWithResponseAsync( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getFullUrl( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the full endpoint URL for an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 full endpoint URL for an event subscription of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getFullUrlWithResponseAsync( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getFullUrl( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get the full endpoint URL for an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 full endpoint URL for an event subscription of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getFullUrlAsync( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName) { + return getFullUrlWithResponseAsync(resourceGroupName, partnerTopicName, eventSubscriptionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the full endpoint URL for an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 full endpoint URL for an event subscription of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EventSubscriptionFullUrlInner getFullUrl( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName) { + return getFullUrlAsync(resourceGroupName, partnerTopicName, eventSubscriptionName).block(); + } + + /** + * Get the full endpoint URL for an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 full endpoint URL for an event subscription of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFullUrlWithResponse( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context) { + return getFullUrlWithResponseAsync(resourceGroupName, partnerTopicName, eventSubscriptionName, context).block(); + } + + /** + * List event subscriptions that belong to a specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List EventSubscriptions operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPartnerTopicSinglePageAsync( + String resourceGroupName, String partnerTopicName, String filter, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByPartnerTopic( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + this.client.getApiVersion(), + filter, + top, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List event subscriptions that belong to a specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List EventSubscriptions operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPartnerTopicSinglePageAsync( + String resourceGroupName, String partnerTopicName, String filter, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPartnerTopic( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + this.client.getApiVersion(), + filter, + top, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List event subscriptions that belong to a specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List EventSubscriptions operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPartnerTopicAsync( + String resourceGroupName, String partnerTopicName, String filter, Integer top) { + return new PagedFlux<>( + () -> listByPartnerTopicSinglePageAsync(resourceGroupName, partnerTopicName, filter, top), + nextLink -> listByPartnerTopicNextSinglePageAsync(nextLink)); + } + + /** + * List event subscriptions that belong to a specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 result of the List EventSubscriptions operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPartnerTopicAsync( + String resourceGroupName, String partnerTopicName) { + final String filter = null; + final Integer top = null; + return new PagedFlux<>( + () -> listByPartnerTopicSinglePageAsync(resourceGroupName, partnerTopicName, filter, top), + nextLink -> listByPartnerTopicNextSinglePageAsync(nextLink)); + } + + /** + * List event subscriptions that belong to a specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List EventSubscriptions operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPartnerTopicAsync( + String resourceGroupName, String partnerTopicName, String filter, Integer top, Context context) { + return new PagedFlux<>( + () -> listByPartnerTopicSinglePageAsync(resourceGroupName, partnerTopicName, filter, top, context), + nextLink -> listByPartnerTopicNextSinglePageAsync(nextLink, context)); + } + + /** + * List event subscriptions that belong to a specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 result of the List EventSubscriptions operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPartnerTopic(String resourceGroupName, String partnerTopicName) { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listByPartnerTopicAsync(resourceGroupName, partnerTopicName, filter, top)); + } + + /** + * List event subscriptions that belong to a specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List EventSubscriptions operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPartnerTopic( + String resourceGroupName, String partnerTopicName, String filter, Integer top, Context context) { + return new PagedIterable<>(listByPartnerTopicAsync(resourceGroupName, partnerTopicName, filter, top, context)); + } + + /** + * Get all delivery attributes for an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 all delivery attributes for an event subscription of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDeliveryAttributesWithResponseAsync( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getDeliveryAttributes( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all delivery attributes for an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 all delivery attributes for an event subscription of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDeliveryAttributesWithResponseAsync( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getDeliveryAttributes( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get all delivery attributes for an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 all delivery attributes for an event subscription of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDeliveryAttributesAsync( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName) { + return getDeliveryAttributesWithResponseAsync(resourceGroupName, partnerTopicName, eventSubscriptionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get all delivery attributes for an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 all delivery attributes for an event subscription of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeliveryAttributeListResultInner getDeliveryAttributes( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName) { + return getDeliveryAttributesAsync(resourceGroupName, partnerTopicName, eventSubscriptionName).block(); + } + + /** + * Get all delivery attributes for an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 all delivery attributes for an event subscription of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeliveryAttributesWithResponse( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context) { + return getDeliveryAttributesWithResponseAsync( + resourceGroupName, partnerTopicName, eventSubscriptionName, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 result of the List EventSubscriptions operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPartnerTopicNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByPartnerTopicNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 result of the List EventSubscriptions operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPartnerTopicNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByPartnerTopicNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerTopicEventSubscriptionsImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerTopicEventSubscriptionsImpl.java new file mode 100644 index 0000000000000..0061e9c36060b --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerTopicEventSubscriptionsImpl.java @@ -0,0 +1,219 @@ +// 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.PagedIterable; +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.PartnerTopicEventSubscriptionsClient; +import com.azure.resourcemanager.eventgrid.fluent.models.DeliveryAttributeListResultInner; +import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionFullUrlInner; +import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner; +import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeListResult; +import com.azure.resourcemanager.eventgrid.models.EventSubscription; +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFullUrl; +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters; +import com.azure.resourcemanager.eventgrid.models.PartnerTopicEventSubscriptions; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PartnerTopicEventSubscriptionsImpl implements PartnerTopicEventSubscriptions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PartnerTopicEventSubscriptionsImpl.class); + + private final PartnerTopicEventSubscriptionsClient innerClient; + + private final com.azure.resourcemanager.eventgrid.EventGridManager serviceManager; + + public PartnerTopicEventSubscriptionsImpl( + PartnerTopicEventSubscriptionsClient innerClient, + com.azure.resourcemanager.eventgrid.EventGridManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public EventSubscription get(String resourceGroupName, String partnerTopicName, String eventSubscriptionName) { + EventSubscriptionInner inner = + this.serviceClient().get(resourceGroupName, partnerTopicName, eventSubscriptionName); + if (inner != null) { + return new EventSubscriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, partnerTopicName, eventSubscriptionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EventSubscriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EventSubscription createOrUpdate( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo) { + EventSubscriptionInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionInfo); + if (inner != null) { + return new EventSubscriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public EventSubscription createOrUpdate( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo, + Context context) { + EventSubscriptionInner inner = + this + .serviceClient() + .createOrUpdate( + resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionInfo, context); + if (inner != null) { + return new EventSubscriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String partnerTopicName, String eventSubscriptionName) { + this.serviceClient().delete(resourceGroupName, partnerTopicName, eventSubscriptionName); + } + + public void delete( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context) { + this.serviceClient().delete(resourceGroupName, partnerTopicName, eventSubscriptionName, context); + } + + public EventSubscription update( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + EventSubscriptionInner inner = + this + .serviceClient() + .update(resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionUpdateParameters); + if (inner != null) { + return new EventSubscriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public EventSubscription update( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, + Context context) { + EventSubscriptionInner inner = + this + .serviceClient() + .update( + resourceGroupName, + partnerTopicName, + eventSubscriptionName, + eventSubscriptionUpdateParameters, + context); + if (inner != null) { + return new EventSubscriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public EventSubscriptionFullUrl getFullUrl( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName) { + EventSubscriptionFullUrlInner inner = + this.serviceClient().getFullUrl(resourceGroupName, partnerTopicName, eventSubscriptionName); + if (inner != null) { + return new EventSubscriptionFullUrlImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getFullUrlWithResponse( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context) { + Response inner = + this + .serviceClient() + .getFullUrlWithResponse(resourceGroupName, partnerTopicName, eventSubscriptionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EventSubscriptionFullUrlImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByPartnerTopic(String resourceGroupName, String partnerTopicName) { + PagedIterable inner = + this.serviceClient().listByPartnerTopic(resourceGroupName, partnerTopicName); + return Utils.mapPage(inner, inner1 -> new EventSubscriptionImpl(inner1, this.manager())); + } + + public PagedIterable listByPartnerTopic( + String resourceGroupName, String partnerTopicName, String filter, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().listByPartnerTopic(resourceGroupName, partnerTopicName, filter, top, context); + return Utils.mapPage(inner, inner1 -> new EventSubscriptionImpl(inner1, this.manager())); + } + + public DeliveryAttributeListResult getDeliveryAttributes( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName) { + DeliveryAttributeListResultInner inner = + this.serviceClient().getDeliveryAttributes(resourceGroupName, partnerTopicName, eventSubscriptionName); + if (inner != null) { + return new DeliveryAttributeListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getDeliveryAttributesWithResponse( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context) { + Response inner = + this + .serviceClient() + .getDeliveryAttributesWithResponse(resourceGroupName, partnerTopicName, eventSubscriptionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeliveryAttributeListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private PartnerTopicEventSubscriptionsClient 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/PartnerTopicImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerTopicImpl.java new file mode 100644 index 0000000000000..1a0e9fd382ce0 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerTopicImpl.java @@ -0,0 +1,88 @@ +// 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.PartnerTopicInner; +import com.azure.resourcemanager.eventgrid.models.IdentityInfo; +import com.azure.resourcemanager.eventgrid.models.PartnerTopic; +import com.azure.resourcemanager.eventgrid.models.PartnerTopicActivationState; +import com.azure.resourcemanager.eventgrid.models.PartnerTopicProvisioningState; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; + +public final class PartnerTopicImpl implements PartnerTopic { + private PartnerTopicInner innerObject; + + private final com.azure.resourcemanager.eventgrid.EventGridManager serviceManager; + + PartnerTopicImpl( + PartnerTopicInner 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 String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public IdentityInfo identity() { + return this.innerModel().identity(); + } + + public String source() { + return this.innerModel().source(); + } + + public OffsetDateTime expirationTimeIfNotActivatedUtc() { + return this.innerModel().expirationTimeIfNotActivatedUtc(); + } + + public PartnerTopicProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PartnerTopicActivationState activationState() { + return this.innerModel().activationState(); + } + + public String partnerTopicFriendlyDescription() { + return this.innerModel().partnerTopicFriendlyDescription(); + } + + public PartnerTopicInner 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/PartnerTopicsClientImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerTopicsClientImpl.java new file mode 100644 index 0000000000000..a6a7b14ed0c0b --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerTopicsClientImpl.java @@ -0,0 +1,1641 @@ +// 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.BodyParam; +import com.azure.core.annotation.Delete; +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.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +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.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.eventgrid.fluent.PartnerTopicsClient; +import com.azure.resourcemanager.eventgrid.fluent.models.PartnerTopicInner; +import com.azure.resourcemanager.eventgrid.models.PartnerTopicUpdateParameters; +import com.azure.resourcemanager.eventgrid.models.PartnerTopicsListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PartnerTopicsClient. */ +public final class PartnerTopicsClientImpl implements PartnerTopicsClient { + private final ClientLogger logger = new ClientLogger(PartnerTopicsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PartnerTopicsService service; + + /** The service client containing this operation class. */ + private final EventGridManagementClientImpl client; + + /** + * Initializes an instance of PartnerTopicsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PartnerTopicsClientImpl(EventGridManagementClientImpl client) { + this.service = + RestProxy.create(PartnerTopicsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EventGridManagementClientPartnerTopics to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EventGridManagementC") + private interface PartnerTopicsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerTopics/{partnerTopicName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerTopicName") String partnerTopicName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerTopics/{partnerTopicName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerTopicName") String partnerTopicName, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerTopics/{partnerTopicName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerTopicName") String partnerTopicName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PartnerTopicUpdateParameters partnerTopicUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/partnerTopics") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerTopics") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerTopics/{partnerTopicName}/activate") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> activate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerTopicName") String partnerTopicName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/partnerTopics/{partnerTopicName}/deactivate") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deactivate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("partnerTopicName") String partnerTopicName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get properties of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 properties of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String partnerTopicName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get properties of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 properties of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String partnerTopicName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get properties of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 properties of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String partnerTopicName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, partnerTopicName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get properties of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 properties of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PartnerTopicInner getByResourceGroup(String resourceGroupName, String partnerTopicName) { + return getByResourceGroupAsync(resourceGroupName, partnerTopicName).block(); + } + + /** + * Get properties of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 properties of a partner topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String partnerTopicName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, partnerTopicName, context).block(); + } + + /** + * Delete existing partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String partnerTopicName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + this.client.getApiVersion(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete existing partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String partnerTopicName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + this.client.getApiVersion(), + context); + } + + /** + * Delete existing partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String partnerTopicName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, partnerTopicName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete existing partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String partnerTopicName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, partnerTopicName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete existing partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String partnerTopicName) { + return beginDeleteAsync(resourceGroupName, partnerTopicName).getSyncPoller(); + } + + /** + * Delete existing partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String partnerTopicName, Context context) { + return beginDeleteAsync(resourceGroupName, partnerTopicName, context).getSyncPoller(); + } + + /** + * Delete existing partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String partnerTopicName) { + return beginDeleteAsync(resourceGroupName, partnerTopicName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete existing partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String partnerTopicName, Context context) { + return beginDeleteAsync(resourceGroupName, partnerTopicName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete existing partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String partnerTopicName) { + deleteAsync(resourceGroupName, partnerTopicName).block(); + } + + /** + * Delete existing partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String partnerTopicName, Context context) { + deleteAsync(resourceGroupName, partnerTopicName, context).block(); + } + + /** + * Asynchronously updates a partner topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param partnerTopicUpdateParameters PartnerTopic update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String partnerTopicName, PartnerTopicUpdateParameters partnerTopicUpdateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + if (partnerTopicUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter partnerTopicUpdateParameters is required and cannot be null.")); + } else { + partnerTopicUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + this.client.getApiVersion(), + partnerTopicUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Asynchronously updates a partner topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param partnerTopicUpdateParameters PartnerTopic update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String partnerTopicName, + PartnerTopicUpdateParameters partnerTopicUpdateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + if (partnerTopicUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter partnerTopicUpdateParameters is required and cannot be null.")); + } else { + partnerTopicUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + this.client.getApiVersion(), + partnerTopicUpdateParameters, + accept, + context); + } + + /** + * Asynchronously updates a partner topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param partnerTopicUpdateParameters PartnerTopic update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String partnerTopicName, PartnerTopicUpdateParameters partnerTopicUpdateParameters) { + return updateWithResponseAsync(resourceGroupName, partnerTopicName, partnerTopicUpdateParameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Asynchronously updates a partner topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param partnerTopicUpdateParameters PartnerTopic update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PartnerTopicInner update( + String resourceGroupName, String partnerTopicName, PartnerTopicUpdateParameters partnerTopicUpdateParameters) { + return updateAsync(resourceGroupName, partnerTopicName, partnerTopicUpdateParameters).block(); + } + + /** + * Asynchronously updates a partner topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param partnerTopicUpdateParameters PartnerTopic update information. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String partnerTopicName, + PartnerTopicUpdateParameters partnerTopicUpdateParameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, partnerTopicName, partnerTopicUpdateParameters, context) + .block(); + } + + /** + * List all the partner topics under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Topics operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + filter, + top, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all the partner topics under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Topics operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + filter, + top, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all the partner topics under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Integer top) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, top), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List all the partner topics under an Azure subscription. + * + * @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 result of the List Partner Topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + final Integer top = null; + return new PagedFlux<>( + () -> listSinglePageAsync(filter, top), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List all the partner topics under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Integer top, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, top, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List all the partner topics under an Azure subscription. + * + * @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 result of the List Partner Topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listAsync(filter, top)); + } + + /** + * List all the partner topics under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Integer top, Context context) { + return new PagedIterable<>(listAsync(filter, top, context)); + } + + /** + * List all the partner topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Topics operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String filter, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + filter, + top, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all the partner topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Topics operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String filter, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + filter, + top, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all the partner topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String filter, Integer top) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List all the partner topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 result of the List Partner Topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String filter = null; + final Integer top = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List all the partner topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String filter, Integer top, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List all the partner topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 result of the List Partner Topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, top)); + } + + /** + * List all the partner topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String filter, Integer top, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, top, context)); + } + + /** + * Activate a newly created partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 eventGrid Partner Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> activateWithResponseAsync( + String resourceGroupName, String partnerTopicName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .activate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Activate a newly created partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 eventGrid Partner Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> activateWithResponseAsync( + String resourceGroupName, String partnerTopicName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .activate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Activate a newly created partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 eventGrid Partner Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono activateAsync(String resourceGroupName, String partnerTopicName) { + return activateWithResponseAsync(resourceGroupName, partnerTopicName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Activate a newly created partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 eventGrid Partner Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PartnerTopicInner activate(String resourceGroupName, String partnerTopicName) { + return activateAsync(resourceGroupName, partnerTopicName).block(); + } + + /** + * Activate a newly created partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 eventGrid Partner Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response activateWithResponse( + String resourceGroupName, String partnerTopicName, Context context) { + return activateWithResponseAsync(resourceGroupName, partnerTopicName, context).block(); + } + + /** + * Deactivate specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 eventGrid Partner Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deactivateWithResponseAsync( + String resourceGroupName, String partnerTopicName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deactivate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deactivate specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 eventGrid Partner Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deactivateWithResponseAsync( + String resourceGroupName, String partnerTopicName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (partnerTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deactivate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + partnerTopicName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deactivate specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 eventGrid Partner Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deactivateAsync(String resourceGroupName, String partnerTopicName) { + return deactivateWithResponseAsync(resourceGroupName, partnerTopicName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Deactivate specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 eventGrid Partner Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PartnerTopicInner deactivate(String resourceGroupName, String partnerTopicName) { + return deactivateAsync(resourceGroupName, partnerTopicName).block(); + } + + /** + * Deactivate specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 eventGrid Partner Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deactivateWithResponse( + String resourceGroupName, String partnerTopicName, Context context) { + return deactivateWithResponseAsync(resourceGroupName, partnerTopicName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 result of the List Partner Topics operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 result of the List Partner Topics operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 result of the List Partner Topics operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 result of the List Partner Topics operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerTopicsImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerTopicsImpl.java new file mode 100644 index 0000000000000..ca758c4424a15 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PartnerTopicsImpl.java @@ -0,0 +1,172 @@ +// 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.PagedIterable; +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.PartnerTopicsClient; +import com.azure.resourcemanager.eventgrid.fluent.models.PartnerTopicInner; +import com.azure.resourcemanager.eventgrid.models.PartnerTopic; +import com.azure.resourcemanager.eventgrid.models.PartnerTopicUpdateParameters; +import com.azure.resourcemanager.eventgrid.models.PartnerTopics; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PartnerTopicsImpl implements PartnerTopics { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PartnerTopicsImpl.class); + + private final PartnerTopicsClient innerClient; + + private final com.azure.resourcemanager.eventgrid.EventGridManager serviceManager; + + public PartnerTopicsImpl( + PartnerTopicsClient innerClient, com.azure.resourcemanager.eventgrid.EventGridManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PartnerTopic getByResourceGroup(String resourceGroupName, String partnerTopicName) { + PartnerTopicInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, partnerTopicName); + if (inner != null) { + return new PartnerTopicImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String partnerTopicName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, partnerTopicName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PartnerTopicImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String partnerTopicName) { + this.serviceClient().delete(resourceGroupName, partnerTopicName); + } + + public void delete(String resourceGroupName, String partnerTopicName, Context context) { + this.serviceClient().delete(resourceGroupName, partnerTopicName, context); + } + + public PartnerTopic update( + String resourceGroupName, String partnerTopicName, PartnerTopicUpdateParameters partnerTopicUpdateParameters) { + PartnerTopicInner inner = + this.serviceClient().update(resourceGroupName, partnerTopicName, partnerTopicUpdateParameters); + if (inner != null) { + return new PartnerTopicImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse( + String resourceGroupName, + String partnerTopicName, + PartnerTopicUpdateParameters partnerTopicUpdateParameters, + Context context) { + Response inner = + this + .serviceClient() + .updateWithResponse(resourceGroupName, partnerTopicName, partnerTopicUpdateParameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PartnerTopicImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new PartnerTopicImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, Integer top, Context context) { + PagedIterable inner = this.serviceClient().list(filter, top, context); + return Utils.mapPage(inner, inner1 -> new PartnerTopicImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PartnerTopicImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, String filter, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, filter, top, context); + return Utils.mapPage(inner, inner1 -> new PartnerTopicImpl(inner1, this.manager())); + } + + public PartnerTopic activate(String resourceGroupName, String partnerTopicName) { + PartnerTopicInner inner = this.serviceClient().activate(resourceGroupName, partnerTopicName); + if (inner != null) { + return new PartnerTopicImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response activateWithResponse( + String resourceGroupName, String partnerTopicName, Context context) { + Response inner = + this.serviceClient().activateWithResponse(resourceGroupName, partnerTopicName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PartnerTopicImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PartnerTopic deactivate(String resourceGroupName, String partnerTopicName) { + PartnerTopicInner inner = this.serviceClient().deactivate(resourceGroupName, partnerTopicName); + if (inner != null) { + return new PartnerTopicImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deactivateWithResponse( + String resourceGroupName, String partnerTopicName, Context context) { + Response inner = + this.serviceClient().deactivateWithResponse(resourceGroupName, partnerTopicName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PartnerTopicImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private PartnerTopicsClient 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/PrivateEndpointConnectionsClientImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PrivateEndpointConnectionsClientImpl.java index 18c5aad8aca11..77543d484a49b 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PrivateEndpointConnectionsClientImpl.java @@ -151,16 +151,18 @@ Mono> listByResourceNext( } /** - * Get a specific private endpoint connection under a topic or domain. + * Get a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @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 a specific private endpoint connection under a topic or domain. + * @return a specific private endpoint connection under a topic, domain, or partner namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -215,17 +217,19 @@ private Mono> getWithResponseAsync( } /** - * Get a specific private endpoint connection under a topic or domain. + * Get a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @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 a specific private endpoint connection under a topic or domain. + * @return a specific private endpoint connection under a topic, domain, or partner namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -278,16 +282,18 @@ private Mono> getWithResponseAsync( } /** - * Get a specific private endpoint connection under a topic or domain. + * Get a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @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 a specific private endpoint connection under a topic or domain. + * @return a specific private endpoint connection under a topic, domain, or partner namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( @@ -307,16 +313,18 @@ private Mono getAsync( } /** - * Get a specific private endpoint connection under a topic or domain. + * Get a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @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 a specific private endpoint connection under a topic or domain. + * @return a specific private endpoint connection under a topic, domain, or partner namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) public PrivateEndpointConnectionInner get( @@ -328,17 +336,19 @@ public PrivateEndpointConnectionInner get( } /** - * Get a specific private endpoint connection under a topic or domain. + * Get a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @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 a specific private endpoint connection under a topic or domain. + * @return a specific private endpoint connection under a topic, domain, or partner namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -352,11 +362,13 @@ public Response getWithResponse( } /** - * Update a specific private endpoint connection under a topic or domain. + * Update a specific private endpoint connection under a topic, domain or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param privateEndpointConnection The private endpoint connection object to update. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -427,11 +439,13 @@ private Mono>> updateWithResponseAsync( } /** - * Update a specific private endpoint connection under a topic or domain. + * Update a specific private endpoint connection under a topic, domain or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param privateEndpointConnection The private endpoint connection object to update. * @param context The context to associate with this operation. @@ -501,11 +515,13 @@ private Mono>> updateWithResponseAsync( } /** - * Update a specific private endpoint connection under a topic or domain. + * Update a specific private endpoint connection under a topic, domain or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param privateEndpointConnection The private endpoint connection object to update. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -534,11 +550,13 @@ private PollerFlux, PrivateEndpointCo } /** - * Update a specific private endpoint connection under a topic or domain. + * Update a specific private endpoint connection under a topic, domain or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param privateEndpointConnection The private endpoint connection object to update. * @param context The context to associate with this operation. @@ -575,11 +593,13 @@ private PollerFlux, PrivateEndpointCo } /** - * Update a specific private endpoint connection under a topic or domain. + * Update a specific private endpoint connection under a topic, domain or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param privateEndpointConnection The private endpoint connection object to update. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -600,11 +620,13 @@ public SyncPoller, PrivateEndpointCon } /** - * Update a specific private endpoint connection under a topic or domain. + * Update a specific private endpoint connection under a topic, domain or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param privateEndpointConnection The private endpoint connection object to update. * @param context The context to associate with this operation. @@ -632,11 +654,13 @@ public SyncPoller, PrivateEndpointCon } /** - * Update a specific private endpoint connection under a topic or domain. + * Update a specific private endpoint connection under a topic, domain or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param privateEndpointConnection The private endpoint connection object to update. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -658,11 +682,13 @@ private Mono updateAsync( } /** - * Update a specific private endpoint connection under a topic or domain. + * Update a specific private endpoint connection under a topic, domain or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param privateEndpointConnection The private endpoint connection object to update. * @param context The context to associate with this operation. @@ -691,11 +717,13 @@ private Mono updateAsync( } /** - * Update a specific private endpoint connection under a topic or domain. + * Update a specific private endpoint connection under a topic, domain or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param privateEndpointConnection The private endpoint connection object to update. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -716,11 +744,13 @@ public PrivateEndpointConnectionInner update( } /** - * Update a specific private endpoint connection under a topic or domain. + * Update a specific private endpoint connection under a topic, domain or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param privateEndpointConnection The private endpoint connection object to update. * @param context The context to associate with this operation. @@ -748,11 +778,13 @@ public PrivateEndpointConnectionInner update( } /** - * Delete a specific private endpoint connection under a topic or domain. + * Delete a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -810,11 +842,13 @@ private Mono>> deleteWithResponseAsync( } /** - * Delete a specific private endpoint connection under a topic or domain. + * Delete a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -871,11 +905,13 @@ private Mono>> deleteWithResponseAsync( } /** - * Delete a specific private endpoint connection under a topic or domain. + * Delete a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -896,11 +932,13 @@ private PollerFlux, Void> beginDeleteAsync( } /** - * Delete a specific private endpoint connection under a topic or domain. + * Delete a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -924,11 +962,13 @@ private PollerFlux, Void> beginDeleteAsync( } /** - * Delete a specific private endpoint connection under a topic or domain. + * Delete a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -946,11 +986,13 @@ public SyncPoller, Void> beginDelete( } /** - * Delete a specific private endpoint connection under a topic or domain. + * Delete a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -970,11 +1012,13 @@ public SyncPoller, Void> beginDelete( } /** - * Delete a specific private endpoint connection under a topic or domain. + * Delete a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -993,11 +1037,13 @@ private Mono deleteAsync( } /** - * Delete a specific private endpoint connection under a topic or domain. + * Delete a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1018,11 +1064,13 @@ private Mono deleteAsync( } /** - * Delete a specific private endpoint connection under a topic or domain. + * Delete a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1038,11 +1086,13 @@ public void delete( } /** - * Delete a specific private endpoint connection under a topic or domain. + * Delete a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1060,11 +1110,13 @@ public void delete( } /** - * Get all private endpoint connections under a topic or domain. + * Get all private endpoint connections under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the * 'name' property only and with limited number of OData operations. These operations are: the 'contains' * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). @@ -1076,7 +1128,7 @@ public void delete( * @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 all private endpoint connections under a topic or domain. + * @return all private endpoint connections under a topic, domain, or partner namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceSinglePageAsync( @@ -1136,11 +1188,13 @@ private Mono> listByResourceSingle } /** - * Get all private endpoint connections under a topic or domain. + * Get all private endpoint connections under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the * 'name' property only and with limited number of OData operations. These operations are: the 'contains' * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). @@ -1153,7 +1207,7 @@ private Mono> listByResourceSingle * @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 all private endpoint connections under a topic or domain. + * @return all private endpoint connections under a topic, domain, or partner namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceSinglePageAsync( @@ -1211,11 +1265,13 @@ private Mono> listByResourceSingle } /** - * Get all private endpoint connections under a topic or domain. + * Get all private endpoint connections under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the * 'name' property only and with limited number of OData operations. These operations are: the 'contains' * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). @@ -1227,7 +1283,7 @@ private Mono> listByResourceSingle * @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 all private endpoint connections under a topic or domain. + * @return all private endpoint connections under a topic, domain, or partner namespace. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceAsync( @@ -1242,15 +1298,17 @@ private PagedFlux listByResourceAsync( } /** - * Get all private endpoint connections under a topic or domain. + * Get all private endpoint connections under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @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 all private endpoint connections under a topic or domain. + * @return all private endpoint connections under a topic, domain, or partner namespace. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceAsync( @@ -1263,11 +1321,13 @@ private PagedFlux listByResourceAsync( } /** - * Get all private endpoint connections under a topic or domain. + * Get all private endpoint connections under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the * 'name' property only and with limited number of OData operations. These operations are: the 'contains' * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). @@ -1280,7 +1340,7 @@ private PagedFlux listByResourceAsync( * @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 all private endpoint connections under a topic or domain. + * @return all private endpoint connections under a topic, domain, or partner namespace. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceAsync( @@ -1296,15 +1356,17 @@ private PagedFlux listByResourceAsync( } /** - * Get all private endpoint connections under a topic or domain. + * Get all private endpoint connections under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @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 all private endpoint connections under a topic or domain. + * @return all private endpoint connections under a topic, domain, or partner namespace. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResource( @@ -1315,11 +1377,13 @@ public PagedIterable listByResource( } /** - * Get all private endpoint connections under a topic or domain. + * Get all private endpoint connections under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the * 'name' property only and with limited number of OData operations. These operations are: the 'contains' * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). @@ -1332,7 +1396,7 @@ public PagedIterable listByResource( * @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 all private endpoint connections under a topic or domain. + * @return all private endpoint connections under a topic, domain, or partner namespace. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResource( diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PrivateLinkResourcesClientImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PrivateLinkResourcesClientImpl.java index 32fc39d6fc412..241a05f9b68bb 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/PrivateLinkResourcesClientImpl.java @@ -110,8 +110,10 @@ Mono> listByResourceNext( * Get properties of a private link resource. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateLinkResourceName The name of private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -170,8 +172,10 @@ private Mono> getWithResponseAsync( * Get properties of a private link resource. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateLinkResourceName The name of private link resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -232,8 +236,10 @@ private Mono> getWithResponseAsync( * Get properties of a private link resource. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateLinkResourceName The name of private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -258,8 +264,10 @@ private Mono getAsync( * Get properties of a private link resource. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateLinkResourceName The name of private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -276,8 +284,10 @@ public PrivateLinkResourceInner get( * Get properties of a private link resource. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateLinkResourceName The name of private link resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -297,11 +307,13 @@ public Response getWithResponse( } /** - * List all the private link resources under a topic or domain. + * List all the private link resources under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the * 'name' property only and with limited number of OData operations. These operations are: the 'contains' * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). @@ -369,11 +381,13 @@ private Mono> listByResourceSinglePageAs } /** - * List all the private link resources under a topic or domain. + * List all the private link resources under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the * 'name' property only and with limited number of OData operations. These operations are: the 'contains' * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). @@ -439,11 +453,13 @@ private Mono> listByResourceSinglePageAs } /** - * List all the private link resources under a topic or domain. + * List all the private link resources under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the * 'name' property only and with limited number of OData operations. These operations are: the 'contains' * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). @@ -466,11 +482,13 @@ private PagedFlux listByResourceAsync( } /** - * List all the private link resources under a topic or domain. + * List all the private link resources under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @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. @@ -487,11 +505,13 @@ private PagedFlux listByResourceAsync( } /** - * List all the private link resources under a topic or domain. + * List all the private link resources under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the * 'name' property only and with limited number of OData operations. These operations are: the 'contains' * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). @@ -515,11 +535,13 @@ private PagedFlux listByResourceAsync( } /** - * List all the private link resources under a topic or domain. + * List all the private link resources under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @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. @@ -534,11 +556,13 @@ public PagedIterable listByResource( } /** - * List all the private link resources under a topic or domain. + * List all the private link resources under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the * 'name' property only and with limited number of OData operations. These operations are: the 'contains' * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/SystemTopicEventSubscriptionsClientImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/SystemTopicEventSubscriptionsClientImpl.java new file mode 100644 index 0000000000000..11d146a52676d --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/SystemTopicEventSubscriptionsClientImpl.java @@ -0,0 +1,2022 @@ +// 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.BodyParam; +import com.azure.core.annotation.Delete; +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.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +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.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.eventgrid.fluent.SystemTopicEventSubscriptionsClient; +import com.azure.resourcemanager.eventgrid.fluent.models.DeliveryAttributeListResultInner; +import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionFullUrlInner; +import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner; +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters; +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionsListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SystemTopicEventSubscriptionsClient. */ +public final class SystemTopicEventSubscriptionsClientImpl implements SystemTopicEventSubscriptionsClient { + private final ClientLogger logger = new ClientLogger(SystemTopicEventSubscriptionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SystemTopicEventSubscriptionsService service; + + /** The service client containing this operation class. */ + private final EventGridManagementClientImpl client; + + /** + * Initializes an instance of SystemTopicEventSubscriptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SystemTopicEventSubscriptionsClientImpl(EventGridManagementClientImpl client) { + this.service = + RestProxy + .create( + SystemTopicEventSubscriptionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EventGridManagementClientSystemTopicEventSubscriptions to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EventGridManagementC") + private interface SystemTopicEventSubscriptionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("systemTopicName") String systemTopicName, + @PathParam("eventSubscriptionName") String eventSubscriptionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("systemTopicName") String systemTopicName, + @PathParam("eventSubscriptionName") String eventSubscriptionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") EventSubscriptionInner eventSubscriptionInfo, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("systemTopicName") String systemTopicName, + @PathParam("eventSubscriptionName") String eventSubscriptionName, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("systemTopicName") String systemTopicName, + @PathParam("eventSubscriptionName") String eventSubscriptionName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getFullUrl( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("systemTopicName") String systemTopicName, + @PathParam("eventSubscriptionName") String eventSubscriptionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/systemTopics/{systemTopicName}/eventSubscriptions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySystemTopic( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("systemTopicName") String systemTopicName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/systemTopics/{systemTopicName}/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getDeliveryAttributes( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("systemTopicName") String systemTopicName, + @PathParam("eventSubscriptionName") String eventSubscriptionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySystemTopicNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get an event subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 an event subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String systemTopicName, String eventSubscriptionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (systemTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + systemTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an event subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 an event subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (systemTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + systemTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get an event subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 an event subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String systemTopicName, String eventSubscriptionName) { + return getWithResponseAsync(resourceGroupName, systemTopicName, eventSubscriptionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get an event subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 an event subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EventSubscriptionInner get(String resourceGroupName, String systemTopicName, String eventSubscriptionName) { + return getAsync(resourceGroupName, systemTopicName, eventSubscriptionName).block(); + } + + /** + * Get an event subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 an event subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context) { + return getWithResponseAsync(resourceGroupName, systemTopicName, eventSubscriptionName, context).block(); + } + + /** + * Asynchronously creates or updates an event subscription with the specified parameters. Existing event + * subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (systemTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + if (eventSubscriptionInfo == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionInfo is required and cannot be null.")); + } else { + eventSubscriptionInfo.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + systemTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + eventSubscriptionInfo, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Asynchronously creates or updates an event subscription with the specified parameters. Existing event + * subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (systemTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + if (eventSubscriptionInfo == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionInfo is required and cannot be null.")); + } else { + eventSubscriptionInfo.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + systemTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + eventSubscriptionInfo, + accept, + context); + } + + /** + * Asynchronously creates or updates an event subscription with the specified parameters. Existing event + * subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, EventSubscriptionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, systemTopicName, eventSubscriptionName, eventSubscriptionInfo); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EventSubscriptionInner.class, + EventSubscriptionInner.class, + Context.NONE); + } + + /** + * Asynchronously creates or updates an event subscription with the specified parameters. Existing event + * subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, EventSubscriptionInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, systemTopicName, eventSubscriptionName, eventSubscriptionInfo, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EventSubscriptionInner.class, + EventSubscriptionInner.class, + context); + } + + /** + * Asynchronously creates or updates an event subscription with the specified parameters. Existing event + * subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, EventSubscriptionInner> beginCreateOrUpdate( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo) { + return beginCreateOrUpdateAsync( + resourceGroupName, systemTopicName, eventSubscriptionName, eventSubscriptionInfo) + .getSyncPoller(); + } + + /** + * Asynchronously creates or updates an event subscription with the specified parameters. Existing event + * subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, EventSubscriptionInner> beginCreateOrUpdate( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, systemTopicName, eventSubscriptionName, eventSubscriptionInfo, context) + .getSyncPoller(); + } + + /** + * Asynchronously creates or updates an event subscription with the specified parameters. Existing event + * subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo) { + return beginCreateOrUpdateAsync( + resourceGroupName, systemTopicName, eventSubscriptionName, eventSubscriptionInfo) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Asynchronously creates or updates an event subscription with the specified parameters. Existing event + * subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, systemTopicName, eventSubscriptionName, eventSubscriptionInfo, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Asynchronously creates or updates an event subscription with the specified parameters. Existing event + * subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EventSubscriptionInner createOrUpdate( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo) { + return createOrUpdateAsync(resourceGroupName, systemTopicName, eventSubscriptionName, eventSubscriptionInfo) + .block(); + } + + /** + * Asynchronously creates or updates an event subscription with the specified parameters. Existing event + * subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EventSubscriptionInner createOrUpdate( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo, + Context context) { + return createOrUpdateAsync( + resourceGroupName, systemTopicName, eventSubscriptionName, eventSubscriptionInfo, context) + .block(); + } + + /** + * Delete an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String systemTopicName, String eventSubscriptionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (systemTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + systemTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (systemTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + systemTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + context); + } + + /** + * Delete an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String systemTopicName, String eventSubscriptionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, systemTopicName, eventSubscriptionName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, systemTopicName, eventSubscriptionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String systemTopicName, String eventSubscriptionName) { + return beginDeleteAsync(resourceGroupName, systemTopicName, eventSubscriptionName).getSyncPoller(); + } + + /** + * Delete an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context) { + return beginDeleteAsync(resourceGroupName, systemTopicName, eventSubscriptionName, context).getSyncPoller(); + } + + /** + * Delete an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String systemTopicName, String eventSubscriptionName) { + return beginDeleteAsync(resourceGroupName, systemTopicName, eventSubscriptionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context) { + return beginDeleteAsync(resourceGroupName, systemTopicName, eventSubscriptionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String systemTopicName, String eventSubscriptionName) { + deleteAsync(resourceGroupName, systemTopicName, eventSubscriptionName).block(); + } + + /** + * Delete an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context) { + deleteAsync(resourceGroupName, systemTopicName, eventSubscriptionName, context).block(); + } + + /** + * Update event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (systemTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + if (eventSubscriptionUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter eventSubscriptionUpdateParameters is required and cannot be null.")); + } else { + eventSubscriptionUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + systemTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + eventSubscriptionUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (systemTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + if (eventSubscriptionUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter eventSubscriptionUpdateParameters is required and cannot be null.")); + } else { + eventSubscriptionUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + systemTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + eventSubscriptionUpdateParameters, + accept, + context); + } + + /** + * Update event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, EventSubscriptionInner> beginUpdateAsync( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, systemTopicName, eventSubscriptionName, eventSubscriptionUpdateParameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EventSubscriptionInner.class, + EventSubscriptionInner.class, + Context.NONE); + } + + /** + * Update event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, EventSubscriptionInner> beginUpdateAsync( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, systemTopicName, eventSubscriptionName, eventSubscriptionUpdateParameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EventSubscriptionInner.class, + EventSubscriptionInner.class, + context); + } + + /** + * Update event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, EventSubscriptionInner> beginUpdate( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + return beginUpdateAsync( + resourceGroupName, systemTopicName, eventSubscriptionName, eventSubscriptionUpdateParameters) + .getSyncPoller(); + } + + /** + * Update event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, EventSubscriptionInner> beginUpdate( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, + Context context) { + return beginUpdateAsync( + resourceGroupName, systemTopicName, eventSubscriptionName, eventSubscriptionUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Update event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + return beginUpdateAsync( + resourceGroupName, systemTopicName, eventSubscriptionName, eventSubscriptionUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, + Context context) { + return beginUpdateAsync( + resourceGroupName, systemTopicName, eventSubscriptionName, eventSubscriptionUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EventSubscriptionInner update( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + return updateAsync(resourceGroupName, systemTopicName, eventSubscriptionName, eventSubscriptionUpdateParameters) + .block(); + } + + /** + * Update event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EventSubscriptionInner update( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, + Context context) { + return updateAsync( + resourceGroupName, systemTopicName, eventSubscriptionName, eventSubscriptionUpdateParameters, context) + .block(); + } + + /** + * Get the full endpoint URL for an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 full endpoint URL for an event subscription of a system topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getFullUrlWithResponseAsync( + String resourceGroupName, String systemTopicName, String eventSubscriptionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (systemTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getFullUrl( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + systemTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the full endpoint URL for an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 full endpoint URL for an event subscription of a system topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getFullUrlWithResponseAsync( + String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (systemTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getFullUrl( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + systemTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get the full endpoint URL for an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 full endpoint URL for an event subscription of a system topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getFullUrlAsync( + String resourceGroupName, String systemTopicName, String eventSubscriptionName) { + return getFullUrlWithResponseAsync(resourceGroupName, systemTopicName, eventSubscriptionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the full endpoint URL for an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 full endpoint URL for an event subscription of a system topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EventSubscriptionFullUrlInner getFullUrl( + String resourceGroupName, String systemTopicName, String eventSubscriptionName) { + return getFullUrlAsync(resourceGroupName, systemTopicName, eventSubscriptionName).block(); + } + + /** + * Get the full endpoint URL for an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 full endpoint URL for an event subscription of a system topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFullUrlWithResponse( + String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context) { + return getFullUrlWithResponseAsync(resourceGroupName, systemTopicName, eventSubscriptionName, context).block(); + } + + /** + * List event subscriptions that belong to a specific system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List EventSubscriptions operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySystemTopicSinglePageAsync( + String resourceGroupName, String systemTopicName, String filter, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (systemTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listBySystemTopic( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + systemTopicName, + this.client.getApiVersion(), + filter, + top, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List event subscriptions that belong to a specific system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List EventSubscriptions operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySystemTopicSinglePageAsync( + String resourceGroupName, String systemTopicName, String filter, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (systemTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySystemTopic( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + systemTopicName, + this.client.getApiVersion(), + filter, + top, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List event subscriptions that belong to a specific system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List EventSubscriptions operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySystemTopicAsync( + String resourceGroupName, String systemTopicName, String filter, Integer top) { + return new PagedFlux<>( + () -> listBySystemTopicSinglePageAsync(resourceGroupName, systemTopicName, filter, top), + nextLink -> listBySystemTopicNextSinglePageAsync(nextLink)); + } + + /** + * List event subscriptions that belong to a specific system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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 result of the List EventSubscriptions operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySystemTopicAsync(String resourceGroupName, String systemTopicName) { + final String filter = null; + final Integer top = null; + return new PagedFlux<>( + () -> listBySystemTopicSinglePageAsync(resourceGroupName, systemTopicName, filter, top), + nextLink -> listBySystemTopicNextSinglePageAsync(nextLink)); + } + + /** + * List event subscriptions that belong to a specific system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List EventSubscriptions operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySystemTopicAsync( + String resourceGroupName, String systemTopicName, String filter, Integer top, Context context) { + return new PagedFlux<>( + () -> listBySystemTopicSinglePageAsync(resourceGroupName, systemTopicName, filter, top, context), + nextLink -> listBySystemTopicNextSinglePageAsync(nextLink, context)); + } + + /** + * List event subscriptions that belong to a specific system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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 result of the List EventSubscriptions operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySystemTopic(String resourceGroupName, String systemTopicName) { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listBySystemTopicAsync(resourceGroupName, systemTopicName, filter, top)); + } + + /** + * List event subscriptions that belong to a specific system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List EventSubscriptions operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySystemTopic( + String resourceGroupName, String systemTopicName, String filter, Integer top, Context context) { + return new PagedIterable<>(listBySystemTopicAsync(resourceGroupName, systemTopicName, filter, top, context)); + } + + /** + * Get all delivery attributes for an event subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 all delivery attributes for an event subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDeliveryAttributesWithResponseAsync( + String resourceGroupName, String systemTopicName, String eventSubscriptionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (systemTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getDeliveryAttributes( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + systemTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all delivery attributes for an event subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 all delivery attributes for an event subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getDeliveryAttributesWithResponseAsync( + String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (systemTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicName is required and cannot be null.")); + } + if (eventSubscriptionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getDeliveryAttributes( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + systemTopicName, + eventSubscriptionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get all delivery attributes for an event subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 all delivery attributes for an event subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getDeliveryAttributesAsync( + String resourceGroupName, String systemTopicName, String eventSubscriptionName) { + return getDeliveryAttributesWithResponseAsync(resourceGroupName, systemTopicName, eventSubscriptionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get all delivery attributes for an event subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 all delivery attributes for an event subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeliveryAttributeListResultInner getDeliveryAttributes( + String resourceGroupName, String systemTopicName, String eventSubscriptionName) { + return getDeliveryAttributesAsync(resourceGroupName, systemTopicName, eventSubscriptionName).block(); + } + + /** + * Get all delivery attributes for an event subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 all delivery attributes for an event subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeliveryAttributesWithResponse( + String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context) { + return getDeliveryAttributesWithResponseAsync( + resourceGroupName, systemTopicName, eventSubscriptionName, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 result of the List EventSubscriptions operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySystemTopicNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listBySystemTopicNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 result of the List EventSubscriptions operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySystemTopicNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySystemTopicNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/SystemTopicEventSubscriptionsImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/SystemTopicEventSubscriptionsImpl.java new file mode 100644 index 0000000000000..5c13b29e3a2bb --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/SystemTopicEventSubscriptionsImpl.java @@ -0,0 +1,219 @@ +// 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.PagedIterable; +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.SystemTopicEventSubscriptionsClient; +import com.azure.resourcemanager.eventgrid.fluent.models.DeliveryAttributeListResultInner; +import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionFullUrlInner; +import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner; +import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeListResult; +import com.azure.resourcemanager.eventgrid.models.EventSubscription; +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFullUrl; +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters; +import com.azure.resourcemanager.eventgrid.models.SystemTopicEventSubscriptions; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SystemTopicEventSubscriptionsImpl implements SystemTopicEventSubscriptions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SystemTopicEventSubscriptionsImpl.class); + + private final SystemTopicEventSubscriptionsClient innerClient; + + private final com.azure.resourcemanager.eventgrid.EventGridManager serviceManager; + + public SystemTopicEventSubscriptionsImpl( + SystemTopicEventSubscriptionsClient innerClient, + com.azure.resourcemanager.eventgrid.EventGridManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public EventSubscription get(String resourceGroupName, String systemTopicName, String eventSubscriptionName) { + EventSubscriptionInner inner = + this.serviceClient().get(resourceGroupName, systemTopicName, eventSubscriptionName); + if (inner != null) { + return new EventSubscriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, systemTopicName, eventSubscriptionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EventSubscriptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EventSubscription createOrUpdate( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo) { + EventSubscriptionInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, systemTopicName, eventSubscriptionName, eventSubscriptionInfo); + if (inner != null) { + return new EventSubscriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public EventSubscription createOrUpdate( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo, + Context context) { + EventSubscriptionInner inner = + this + .serviceClient() + .createOrUpdate( + resourceGroupName, systemTopicName, eventSubscriptionName, eventSubscriptionInfo, context); + if (inner != null) { + return new EventSubscriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String systemTopicName, String eventSubscriptionName) { + this.serviceClient().delete(resourceGroupName, systemTopicName, eventSubscriptionName); + } + + public void delete( + String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context) { + this.serviceClient().delete(resourceGroupName, systemTopicName, eventSubscriptionName, context); + } + + public EventSubscription update( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) { + EventSubscriptionInner inner = + this + .serviceClient() + .update(resourceGroupName, systemTopicName, eventSubscriptionName, eventSubscriptionUpdateParameters); + if (inner != null) { + return new EventSubscriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public EventSubscription update( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, + Context context) { + EventSubscriptionInner inner = + this + .serviceClient() + .update( + resourceGroupName, + systemTopicName, + eventSubscriptionName, + eventSubscriptionUpdateParameters, + context); + if (inner != null) { + return new EventSubscriptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public EventSubscriptionFullUrl getFullUrl( + String resourceGroupName, String systemTopicName, String eventSubscriptionName) { + EventSubscriptionFullUrlInner inner = + this.serviceClient().getFullUrl(resourceGroupName, systemTopicName, eventSubscriptionName); + if (inner != null) { + return new EventSubscriptionFullUrlImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getFullUrlWithResponse( + String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context) { + Response inner = + this + .serviceClient() + .getFullUrlWithResponse(resourceGroupName, systemTopicName, eventSubscriptionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EventSubscriptionFullUrlImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listBySystemTopic(String resourceGroupName, String systemTopicName) { + PagedIterable inner = + this.serviceClient().listBySystemTopic(resourceGroupName, systemTopicName); + return Utils.mapPage(inner, inner1 -> new EventSubscriptionImpl(inner1, this.manager())); + } + + public PagedIterable listBySystemTopic( + String resourceGroupName, String systemTopicName, String filter, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().listBySystemTopic(resourceGroupName, systemTopicName, filter, top, context); + return Utils.mapPage(inner, inner1 -> new EventSubscriptionImpl(inner1, this.manager())); + } + + public DeliveryAttributeListResult getDeliveryAttributes( + String resourceGroupName, String systemTopicName, String eventSubscriptionName) { + DeliveryAttributeListResultInner inner = + this.serviceClient().getDeliveryAttributes(resourceGroupName, systemTopicName, eventSubscriptionName); + if (inner != null) { + return new DeliveryAttributeListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getDeliveryAttributesWithResponse( + String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context) { + Response inner = + this + .serviceClient() + .getDeliveryAttributesWithResponse(resourceGroupName, systemTopicName, eventSubscriptionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeliveryAttributeListResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private SystemTopicEventSubscriptionsClient 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/SystemTopicImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/SystemTopicImpl.java new file mode 100644 index 0000000000000..8094d4d6788bc --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/SystemTopicImpl.java @@ -0,0 +1,216 @@ +// 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.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventgrid.fluent.models.SystemTopicInner; +import com.azure.resourcemanager.eventgrid.models.IdentityInfo; +import com.azure.resourcemanager.eventgrid.models.ResourceProvisioningState; +import com.azure.resourcemanager.eventgrid.models.SystemTopic; +import com.azure.resourcemanager.eventgrid.models.SystemTopicUpdateParameters; +import java.util.Collections; +import java.util.Map; + +public final class SystemTopicImpl implements SystemTopic, SystemTopic.Definition, SystemTopic.Update { + private SystemTopicInner innerObject; + + private final com.azure.resourcemanager.eventgrid.EventGridManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public IdentityInfo identity() { + return this.innerModel().identity(); + } + + public ResourceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String source() { + return this.innerModel().source(); + } + + public String topicType() { + return this.innerModel().topicType(); + } + + public String metricResourceId() { + return this.innerModel().metricResourceId(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SystemTopicInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.eventgrid.EventGridManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String systemTopicName; + + private SystemTopicUpdateParameters updateSystemTopicUpdateParameters; + + public SystemTopicImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SystemTopic create() { + this.innerObject = + serviceManager + .serviceClient() + .getSystemTopics() + .createOrUpdate(resourceGroupName, systemTopicName, this.innerModel(), Context.NONE); + return this; + } + + public SystemTopic create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSystemTopics() + .createOrUpdate(resourceGroupName, systemTopicName, this.innerModel(), context); + return this; + } + + SystemTopicImpl(String name, com.azure.resourcemanager.eventgrid.EventGridManager serviceManager) { + this.innerObject = new SystemTopicInner(); + this.serviceManager = serviceManager; + this.systemTopicName = name; + } + + public SystemTopicImpl update() { + this.updateSystemTopicUpdateParameters = new SystemTopicUpdateParameters(); + return this; + } + + public SystemTopic apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSystemTopics() + .update(resourceGroupName, systemTopicName, updateSystemTopicUpdateParameters, Context.NONE); + return this; + } + + public SystemTopic apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSystemTopics() + .update(resourceGroupName, systemTopicName, updateSystemTopicUpdateParameters, context); + return this; + } + + SystemTopicImpl(SystemTopicInner innerObject, com.azure.resourcemanager.eventgrid.EventGridManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.systemTopicName = Utils.getValueFromIdByName(innerObject.id(), "systemTopics"); + } + + public SystemTopic refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSystemTopics() + .getByResourceGroupWithResponse(resourceGroupName, systemTopicName, Context.NONE) + .getValue(); + return this; + } + + public SystemTopic refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSystemTopics() + .getByResourceGroupWithResponse(resourceGroupName, systemTopicName, context) + .getValue(); + return this; + } + + public SystemTopicImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SystemTopicImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SystemTopicImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateSystemTopicUpdateParameters.withTags(tags); + return this; + } + } + + public SystemTopicImpl withIdentity(IdentityInfo identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateSystemTopicUpdateParameters.withIdentity(identity); + return this; + } + } + + public SystemTopicImpl withSource(String source) { + this.innerModel().withSource(source); + return this; + } + + public SystemTopicImpl withTopicType(String topicType) { + this.innerModel().withTopicType(topicType); + 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/SystemTopicsClientImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/SystemTopicsClientImpl.java new file mode 100644 index 0000000000000..2a10929f2df06 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/SystemTopicsClientImpl.java @@ -0,0 +1,1694 @@ +// 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.BodyParam; +import com.azure.core.annotation.Delete; +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.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +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.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.eventgrid.fluent.SystemTopicsClient; +import com.azure.resourcemanager.eventgrid.fluent.models.SystemTopicInner; +import com.azure.resourcemanager.eventgrid.models.SystemTopicUpdateParameters; +import com.azure.resourcemanager.eventgrid.models.SystemTopicsListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SystemTopicsClient. */ +public final class SystemTopicsClientImpl implements SystemTopicsClient { + private final ClientLogger logger = new ClientLogger(SystemTopicsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SystemTopicsService service; + + /** The service client containing this operation class. */ + private final EventGridManagementClientImpl client; + + /** + * Initializes an instance of SystemTopicsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SystemTopicsClientImpl(EventGridManagementClientImpl client) { + this.service = + RestProxy.create(SystemTopicsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for EventGridManagementClientSystemTopics to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "EventGridManagementC") + private interface SystemTopicsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/systemTopics/{systemTopicName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("systemTopicName") String systemTopicName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/systemTopics/{systemTopicName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("systemTopicName") String systemTopicName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SystemTopicInner systemTopicInfo, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/systemTopics/{systemTopicName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("systemTopicName") String systemTopicName, + @QueryParam("api-version") String apiVersion, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/systemTopics/{systemTopicName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("systemTopicName") String systemTopicName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SystemTopicUpdateParameters systemTopicUpdateParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/systemTopics") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid" + + "/systemTopics") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get properties of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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 properties of a system topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String systemTopicName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (systemTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + systemTopicName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get properties of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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 properties of a system topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String systemTopicName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (systemTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + systemTopicName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get properties of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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 properties of a system topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String systemTopicName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, systemTopicName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get properties of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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 properties of a system topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SystemTopicInner getByResourceGroup(String resourceGroupName, String systemTopicName) { + return getByResourceGroupAsync(resourceGroupName, systemTopicName).block(); + } + + /** + * Get properties of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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 properties of a system topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String systemTopicName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, systemTopicName, context).block(); + } + + /** + * Asynchronously creates a new system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicInfo System Topic information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String systemTopicName, SystemTopicInner systemTopicInfo) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (systemTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicName is required and cannot be null.")); + } + if (systemTopicInfo == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicInfo is required and cannot be null.")); + } else { + systemTopicInfo.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + systemTopicName, + this.client.getApiVersion(), + systemTopicInfo, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Asynchronously creates a new system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicInfo System Topic information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String systemTopicName, SystemTopicInner systemTopicInfo, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (systemTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicName is required and cannot be null.")); + } + if (systemTopicInfo == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicInfo is required and cannot be null.")); + } else { + systemTopicInfo.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + systemTopicName, + this.client.getApiVersion(), + systemTopicInfo, + accept, + context); + } + + /** + * Asynchronously creates a new system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicInfo System Topic information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SystemTopicInner> beginCreateOrUpdateAsync( + String resourceGroupName, String systemTopicName, SystemTopicInner systemTopicInfo) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, systemTopicName, systemTopicInfo); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SystemTopicInner.class, SystemTopicInner.class, Context.NONE); + } + + /** + * Asynchronously creates a new system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicInfo System Topic information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SystemTopicInner> beginCreateOrUpdateAsync( + String resourceGroupName, String systemTopicName, SystemTopicInner systemTopicInfo, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, systemTopicName, systemTopicInfo, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SystemTopicInner.class, SystemTopicInner.class, context); + } + + /** + * Asynchronously creates a new system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicInfo System Topic information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SystemTopicInner> beginCreateOrUpdate( + String resourceGroupName, String systemTopicName, SystemTopicInner systemTopicInfo) { + return beginCreateOrUpdateAsync(resourceGroupName, systemTopicName, systemTopicInfo).getSyncPoller(); + } + + /** + * Asynchronously creates a new system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicInfo System Topic information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SystemTopicInner> beginCreateOrUpdate( + String resourceGroupName, String systemTopicName, SystemTopicInner systemTopicInfo, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, systemTopicName, systemTopicInfo, context).getSyncPoller(); + } + + /** + * Asynchronously creates a new system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicInfo System Topic information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String systemTopicName, SystemTopicInner systemTopicInfo) { + return beginCreateOrUpdateAsync(resourceGroupName, systemTopicName, systemTopicInfo) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Asynchronously creates a new system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicInfo System Topic information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String systemTopicName, SystemTopicInner systemTopicInfo, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, systemTopicName, systemTopicInfo, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Asynchronously creates a new system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicInfo System Topic information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SystemTopicInner createOrUpdate( + String resourceGroupName, String systemTopicName, SystemTopicInner systemTopicInfo) { + return createOrUpdateAsync(resourceGroupName, systemTopicName, systemTopicInfo).block(); + } + + /** + * Asynchronously creates a new system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicInfo System Topic information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SystemTopicInner createOrUpdate( + String resourceGroupName, String systemTopicName, SystemTopicInner systemTopicInfo, Context context) { + return createOrUpdateAsync(resourceGroupName, systemTopicName, systemTopicInfo, context).block(); + } + + /** + * Delete existing system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String systemTopicName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (systemTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + systemTopicName, + this.client.getApiVersion(), + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete existing system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String systemTopicName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (systemTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + systemTopicName, + this.client.getApiVersion(), + context); + } + + /** + * Delete existing system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String systemTopicName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, systemTopicName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete existing system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String systemTopicName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, systemTopicName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete existing system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String systemTopicName) { + return beginDeleteAsync(resourceGroupName, systemTopicName).getSyncPoller(); + } + + /** + * Delete existing system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String systemTopicName, Context context) { + return beginDeleteAsync(resourceGroupName, systemTopicName, context).getSyncPoller(); + } + + /** + * Delete existing system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String systemTopicName) { + return beginDeleteAsync(resourceGroupName, systemTopicName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete existing system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String systemTopicName, Context context) { + return beginDeleteAsync(resourceGroupName, systemTopicName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete existing system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String systemTopicName) { + deleteAsync(resourceGroupName, systemTopicName).block(); + } + + /** + * Delete existing system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String systemTopicName, Context context) { + deleteAsync(resourceGroupName, systemTopicName, context).block(); + } + + /** + * Asynchronously updates a system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicUpdateParameters SystemTopic update information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String systemTopicName, SystemTopicUpdateParameters systemTopicUpdateParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (systemTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicName is required and cannot be null.")); + } + if (systemTopicUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter systemTopicUpdateParameters is required and cannot be null.")); + } else { + systemTopicUpdateParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + systemTopicName, + this.client.getApiVersion(), + systemTopicUpdateParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Asynchronously updates a system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicUpdateParameters SystemTopic update information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String systemTopicName, + SystemTopicUpdateParameters systemTopicUpdateParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (systemTopicName == null) { + return Mono + .error(new IllegalArgumentException("Parameter systemTopicName is required and cannot be null.")); + } + if (systemTopicUpdateParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter systemTopicUpdateParameters is required and cannot be null.")); + } else { + systemTopicUpdateParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + systemTopicName, + this.client.getApiVersion(), + systemTopicUpdateParameters, + accept, + context); + } + + /** + * Asynchronously updates a system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicUpdateParameters SystemTopic update information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SystemTopicInner> beginUpdateAsync( + String resourceGroupName, String systemTopicName, SystemTopicUpdateParameters systemTopicUpdateParameters) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, systemTopicName, systemTopicUpdateParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SystemTopicInner.class, SystemTopicInner.class, Context.NONE); + } + + /** + * Asynchronously updates a system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicUpdateParameters SystemTopic update information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SystemTopicInner> beginUpdateAsync( + String resourceGroupName, + String systemTopicName, + SystemTopicUpdateParameters systemTopicUpdateParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, systemTopicName, systemTopicUpdateParameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SystemTopicInner.class, SystemTopicInner.class, context); + } + + /** + * Asynchronously updates a system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicUpdateParameters SystemTopic update information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SystemTopicInner> beginUpdate( + String resourceGroupName, String systemTopicName, SystemTopicUpdateParameters systemTopicUpdateParameters) { + return beginUpdateAsync(resourceGroupName, systemTopicName, systemTopicUpdateParameters).getSyncPoller(); + } + + /** + * Asynchronously updates a system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicUpdateParameters SystemTopic update information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SystemTopicInner> beginUpdate( + String resourceGroupName, + String systemTopicName, + SystemTopicUpdateParameters systemTopicUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, systemTopicName, systemTopicUpdateParameters, context) + .getSyncPoller(); + } + + /** + * Asynchronously updates a system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicUpdateParameters SystemTopic update information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String systemTopicName, SystemTopicUpdateParameters systemTopicUpdateParameters) { + return beginUpdateAsync(resourceGroupName, systemTopicName, systemTopicUpdateParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Asynchronously updates a system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicUpdateParameters SystemTopic update information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String systemTopicName, + SystemTopicUpdateParameters systemTopicUpdateParameters, + Context context) { + return beginUpdateAsync(resourceGroupName, systemTopicName, systemTopicUpdateParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Asynchronously updates a system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicUpdateParameters SystemTopic update information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SystemTopicInner update( + String resourceGroupName, String systemTopicName, SystemTopicUpdateParameters systemTopicUpdateParameters) { + return updateAsync(resourceGroupName, systemTopicName, systemTopicUpdateParameters).block(); + } + + /** + * Asynchronously updates a system topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param systemTopicUpdateParameters SystemTopic update information. + * @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 eventGrid System Topic. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SystemTopicInner update( + String resourceGroupName, + String systemTopicName, + SystemTopicUpdateParameters systemTopicUpdateParameters, + Context context) { + return updateAsync(resourceGroupName, systemTopicName, systemTopicUpdateParameters, context).block(); + } + + /** + * List all the system topics under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List System topics operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + filter, + top, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all the system topics under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List System topics operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + filter, + top, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all the system topics under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List System topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Integer top) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, top), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List all the system topics under an Azure subscription. + * + * @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 result of the List System topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + final Integer top = null; + return new PagedFlux<>( + () -> listSinglePageAsync(filter, top), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List all the system topics under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List System topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter, Integer top, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(filter, top, context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List all the system topics under an Azure subscription. + * + * @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 result of the List System topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listAsync(filter, top)); + } + + /** + * List all the system topics under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List System topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Integer top, Context context) { + return new PagedIterable<>(listAsync(filter, top, context)); + } + + /** + * List all the system topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List System topics operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String filter, Integer top) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + filter, + top, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all the system topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List System topics operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, String filter, Integer top, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + filter, + top, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all the system topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List System topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, Integer top) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List all the system topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 result of the List System topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String filter = null; + final Integer top = null; + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List all the system topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List System topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, String filter, Integer top, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List all the system topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 result of the List System topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String filter = null; + final Integer top = null; + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, top)); + } + + /** + * List all the system topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List System topics operation. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, String filter, Integer top, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, top, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 result of the List System topics operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 result of the List System topics operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 result of the List System topics operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @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 result of the List System topics operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/SystemTopicsImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/SystemTopicsImpl.java new file mode 100644 index 0000000000000..8ba02b812c6bc --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/SystemTopicsImpl.java @@ -0,0 +1,172 @@ +// 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.PagedIterable; +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.SystemTopicsClient; +import com.azure.resourcemanager.eventgrid.fluent.models.SystemTopicInner; +import com.azure.resourcemanager.eventgrid.models.SystemTopic; +import com.azure.resourcemanager.eventgrid.models.SystemTopics; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SystemTopicsImpl implements SystemTopics { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SystemTopicsImpl.class); + + private final SystemTopicsClient innerClient; + + private final com.azure.resourcemanager.eventgrid.EventGridManager serviceManager; + + public SystemTopicsImpl( + SystemTopicsClient innerClient, com.azure.resourcemanager.eventgrid.EventGridManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public SystemTopic getByResourceGroup(String resourceGroupName, String systemTopicName) { + SystemTopicInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, systemTopicName); + if (inner != null) { + return new SystemTopicImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String systemTopicName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, systemTopicName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SystemTopicImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String systemTopicName) { + this.serviceClient().delete(resourceGroupName, systemTopicName); + } + + public void delete(String resourceGroupName, String systemTopicName, Context context) { + this.serviceClient().delete(resourceGroupName, systemTopicName, context); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new SystemTopicImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, Integer top, Context context) { + PagedIterable inner = this.serviceClient().list(filter, top, context); + return Utils.mapPage(inner, inner1 -> new SystemTopicImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new SystemTopicImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup( + String resourceGroupName, String filter, Integer top, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, filter, top, context); + return Utils.mapPage(inner, inner1 -> new SystemTopicImpl(inner1, this.manager())); + } + + public SystemTopic getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String systemTopicName = Utils.getValueFromIdByName(id, "systemTopics"); + if (systemTopicName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'systemTopics'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, systemTopicName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String systemTopicName = Utils.getValueFromIdByName(id, "systemTopics"); + if (systemTopicName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'systemTopics'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, systemTopicName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String systemTopicName = Utils.getValueFromIdByName(id, "systemTopics"); + if (systemTopicName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'systemTopics'.", id))); + } + this.delete(resourceGroupName, systemTopicName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String systemTopicName = Utils.getValueFromIdByName(id, "systemTopics"); + if (systemTopicName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'systemTopics'.", id))); + } + this.delete(resourceGroupName, systemTopicName, context); + } + + private SystemTopicsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.eventgrid.EventGridManager manager() { + return this.serviceManager; + } + + public SystemTopicImpl define(String name) { + return new SystemTopicImpl(name, this.manager()); + } +} 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 6f37a7e8d8f33..a7a1d4e946ec6 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,11 +10,15 @@ 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.ExtendedLocation; +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; import com.azure.resourcemanager.eventgrid.models.PrivateEndpointConnection; import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; +import com.azure.resourcemanager.eventgrid.models.ResourceKind; +import com.azure.resourcemanager.eventgrid.models.ResourceSku; import com.azure.resourcemanager.eventgrid.models.Topic; import com.azure.resourcemanager.eventgrid.models.TopicProvisioningState; import com.azure.resourcemanager.eventgrid.models.TopicRegenerateKeyRequest; @@ -55,6 +59,22 @@ public Map tags() { } } + public ResourceSku sku() { + return this.innerModel().sku(); + } + + public IdentityInfo identity() { + return this.innerModel().identity(); + } + + public ResourceKind kind() { + return this.innerModel().kind(); + } + + public ExtendedLocation extendedLocation() { + return this.innerModel().extendedLocation(); + } + public SystemData systemData() { return this.innerModel().systemData(); } @@ -106,6 +126,10 @@ public List inboundIpRules() { } } + public Boolean disableLocalAuth() { + return this.innerModel().disableLocalAuth(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -243,6 +267,36 @@ public TopicImpl withTags(Map tags) { } } + public TopicImpl withSku(ResourceSku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateTopicUpdateParameters.withSku(sku); + return this; + } + } + + public TopicImpl withIdentity(IdentityInfo identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateTopicUpdateParameters.withIdentity(identity); + return this; + } + } + + public TopicImpl withKind(ResourceKind kind) { + this.innerModel().withKind(kind); + return this; + } + + public TopicImpl withExtendedLocation(ExtendedLocation extendedLocation) { + this.innerModel().withExtendedLocation(extendedLocation); + return this; + } + public TopicImpl withInputSchema(InputSchema inputSchema) { this.innerModel().withInputSchema(inputSchema); return this; @@ -273,6 +327,16 @@ public TopicImpl withInboundIpRules(List inboundIpRules) { } } + public TopicImpl withDisableLocalAuth(Boolean disableLocalAuth) { + if (isInCreateMode()) { + this.innerModel().withDisableLocalAuth(disableLocalAuth); + return this; + } else { + this.updateTopicUpdateParameters.withDisableLocalAuth(disableLocalAuth); + 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/TopicTypeInfoImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/TopicTypeInfoImpl.java index 0cb674db68655..f8ebe71e2724a 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/TopicTypeInfoImpl.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/TopicTypeInfoImpl.java @@ -7,6 +7,7 @@ import com.azure.resourcemanager.eventgrid.fluent.models.TopicTypeInfoInner; import com.azure.resourcemanager.eventgrid.models.ResourceRegionType; import com.azure.resourcemanager.eventgrid.models.TopicTypeInfo; +import com.azure.resourcemanager.eventgrid.models.TopicTypePropertiesSupportedScopesForSourceItem; import com.azure.resourcemanager.eventgrid.models.TopicTypeProvisioningState; import java.util.Collections; import java.util.List; @@ -67,6 +68,15 @@ public String sourceResourceFormat() { return this.innerModel().sourceResourceFormat(); } + public List supportedScopesForSource() { + List inner = this.innerModel().supportedScopesForSource(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public TopicTypeInfoInner innerModel() { return this.innerObject; } diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/TopicsClientImpl.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/TopicsClientImpl.java index c1e549c3b6d5f..86bf18a7dbf06 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/TopicsClientImpl.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/implementation/TopicsClientImpl.java @@ -180,7 +180,7 @@ Mono> listSharedAccessKeys( @Post( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics" + "/{topicName}/regenerateKey") - @ExpectedResponses({200}) + @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> regenerateKey( @HostParam("$host") String endpoint, diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/AdvancedFilter.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/AdvancedFilter.java index 867901dc9b455..7ef9f66827a7a 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/AdvancedFilter.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/AdvancedFilter.java @@ -36,7 +36,14 @@ @JsonSubTypes.Type(name = "StringNotIn", value = StringNotInAdvancedFilter.class), @JsonSubTypes.Type(name = "StringBeginsWith", value = StringBeginsWithAdvancedFilter.class), @JsonSubTypes.Type(name = "StringEndsWith", value = StringEndsWithAdvancedFilter.class), - @JsonSubTypes.Type(name = "StringContains", value = StringContainsAdvancedFilter.class) + @JsonSubTypes.Type(name = "StringContains", value = StringContainsAdvancedFilter.class), + @JsonSubTypes.Type(name = "NumberInRange", value = NumberInRangeAdvancedFilter.class), + @JsonSubTypes.Type(name = "NumberNotInRange", value = NumberNotInRangeAdvancedFilter.class), + @JsonSubTypes.Type(name = "StringNotBeginsWith", value = StringNotBeginsWithAdvancedFilter.class), + @JsonSubTypes.Type(name = "StringNotEndsWith", value = StringNotEndsWithAdvancedFilter.class), + @JsonSubTypes.Type(name = "StringNotContains", value = StringNotContainsAdvancedFilter.class), + @JsonSubTypes.Type(name = "IsNullOrUndefined", value = IsNullOrUndefinedAdvancedFilter.class), + @JsonSubTypes.Type(name = "IsNotNull", value = IsNotNullAdvancedFilter.class) }) @Fluent public class AdvancedFilter { diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/AdvancedFilterOperatorType.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/AdvancedFilterOperatorType.java index f5f078c46d679..5dabf8c45fac5 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/AdvancedFilterOperatorType.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/AdvancedFilterOperatorType.java @@ -47,6 +47,27 @@ public final class AdvancedFilterOperatorType extends ExpandableStringEnum deliveryAttributeMappings; + /** * Get the resourceId property: The Azure Resource Id that represents the endpoint of the Azure Function destination * of an event subscription. @@ -102,6 +109,27 @@ public AzureFunctionEventSubscriptionDestination withPreferredBatchSizeInKilobyt return this; } + /** + * Get the deliveryAttributeMappings property: Delivery attribute details. + * + * @return the deliveryAttributeMappings value. + */ + public List deliveryAttributeMappings() { + return this.deliveryAttributeMappings; + } + + /** + * Set the deliveryAttributeMappings property: Delivery attribute details. + * + * @param deliveryAttributeMappings the deliveryAttributeMappings value to set. + * @return the AzureFunctionEventSubscriptionDestination object itself. + */ + public AzureFunctionEventSubscriptionDestination withDeliveryAttributeMappings( + List deliveryAttributeMappings) { + this.deliveryAttributeMappings = deliveryAttributeMappings; + return this; + } + /** * Validates the instance. * @@ -110,5 +138,8 @@ public AzureFunctionEventSubscriptionDestination withPreferredBatchSizeInKilobyt @Override public void validate() { super.validate(); + if (deliveryAttributeMappings() != null) { + deliveryAttributeMappings().forEach(e -> e.validate()); + } } } 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 0000000000000..2f85f58671614 --- /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/DeliveryAttributeListResult.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DeliveryAttributeListResult.java new file mode 100644 index 0000000000000..a79694b243572 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DeliveryAttributeListResult.java @@ -0,0 +1,25 @@ +// 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.resourcemanager.eventgrid.fluent.models.DeliveryAttributeListResultInner; +import java.util.List; + +/** An immutable client-side representation of DeliveryAttributeListResult. */ +public interface DeliveryAttributeListResult { + /** + * Gets the value property: A collection of DeliveryAttributeMapping. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.eventgrid.fluent.models.DeliveryAttributeListResultInner object. + * + * @return the inner object. + */ + DeliveryAttributeListResultInner innerModel(); +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DeliveryAttributeMapping.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DeliveryAttributeMapping.java new file mode 100644 index 0000000000000..a689d72423173 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DeliveryAttributeMapping.java @@ -0,0 +1,63 @@ +// 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; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Delivery attribute mapping details. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = DeliveryAttributeMapping.class) +@JsonTypeName("DeliveryAttributeMapping") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Static", value = StaticDeliveryAttributeMapping.class), + @JsonSubTypes.Type(name = "Dynamic", value = DynamicDeliveryAttributeMapping.class) +}) +@Fluent +public class DeliveryAttributeMapping { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeliveryAttributeMapping.class); + + /* + * Name of the delivery attribute or header. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the name property: Name of the delivery attribute or header. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the delivery attribute or header. + * + * @param name the name value to set. + * @return the DeliveryAttributeMapping object itself. + */ + public DeliveryAttributeMapping withName(String name) { + this.name = name; + 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/DeliveryAttributeMappingType.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DeliveryAttributeMappingType.java new file mode 100644 index 0000000000000..c4e3bc68960fc --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DeliveryAttributeMappingType.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 DeliveryAttributeMappingType. */ +public final class DeliveryAttributeMappingType extends ExpandableStringEnum { + /** Static value Static for DeliveryAttributeMappingType. */ + public static final DeliveryAttributeMappingType STATIC = fromString("Static"); + + /** Static value Dynamic for DeliveryAttributeMappingType. */ + public static final DeliveryAttributeMappingType DYNAMIC = fromString("Dynamic"); + + /** + * Creates or finds a DeliveryAttributeMappingType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeliveryAttributeMappingType. + */ + @JsonCreator + public static DeliveryAttributeMappingType fromString(String name) { + return fromString(name, DeliveryAttributeMappingType.class); + } + + /** @return known DeliveryAttributeMappingType values. */ + public static Collection values() { + return values(DeliveryAttributeMappingType.class); + } +} 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 0000000000000..c05c953832457 --- /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/Domain.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/Domain.java index 58b2038fff9c4..84f0b104f2abc 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/Domain.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/Domain.java @@ -50,7 +50,21 @@ public interface Domain { Map tags(); /** - * Gets the systemData property: The system metadata relating to Domain resource. + * Gets the sku property: The Sku pricing tier for the Event Grid Domain resource. + * + * @return the sku value. + */ + ResourceSku sku(); + + /** + * Gets the identity property: Identity information for the Event Grid Domain resource. + * + * @return the identity value. + */ + IdentityInfo identity(); + + /** + * Gets the systemData property: The system metadata relating to the Event Grid Domain resource. * * @return the systemData value. */ @@ -64,14 +78,14 @@ public interface Domain { List privateEndpointConnections(); /** - * Gets the provisioningState property: Provisioning state of the domain. + * Gets the provisioningState property: Provisioning state of the Event Grid Domain Resource. * * @return the provisioningState value. */ DomainProvisioningState provisioningState(); /** - * Gets the endpoint property: Endpoint for the domain. + * Gets the endpoint property: Endpoint for the Event Grid Domain Resource which is used for publishing the events. * * @return the endpoint value. */ @@ -79,7 +93,7 @@ public interface Domain { /** * Gets the inputSchema property: This determines the format that Event Grid should expect for incoming events - * published to the domain. + * published to the Event Grid Domain Resource. * * @return the inputSchema value. */ @@ -94,7 +108,7 @@ public interface Domain { InputSchemaMapping inputSchemaMapping(); /** - * Gets the metricResourceId property: Metric resource id for the domain. + * Gets the metricResourceId property: Metric resource id for the Event Grid Domain Resource. * * @return the metricResourceId value. */ @@ -117,6 +131,45 @@ public interface Domain { */ List inboundIpRules(); + /** + * Gets the disableLocalAuth property: This boolean is used to enable or disable local auth. Default value is false. + * When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to + * the domain. + * + * @return the disableLocalAuth value. + */ + Boolean disableLocalAuth(); + + /** + * Gets the autoCreateTopicWithFirstSubscription property: This Boolean is used to specify the creation mechanism + * for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this context, creation + * of domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property + * is true. When this property is null or set to true, Event Grid is responsible of automatically creating the + * domain topic when the first event subscription is created at the scope of the domain topic. If this property is + * set to false, then creating the first event subscription will require creating a domain topic by the user. The + * self-management mode can be used if the user wants full control of when the domain topic is created, while + * auto-managed mode provides the flexibility to perform less operations and manage fewer resources by the user. + * Also, note that in auto-managed creation mode, user is allowed to create the domain topic on demand if needed. + * + * @return the autoCreateTopicWithFirstSubscription value. + */ + Boolean autoCreateTopicWithFirstSubscription(); + + /** + * Gets the autoDeleteTopicWithLastSubscription property: This Boolean is used to specify the deletion mechanism for + * 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this context, deletion of + * domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is + * true. When this property is set to true, Event Grid is responsible of automatically deleting the domain topic + * when the last event subscription at the scope of the domain topic is deleted. If this property is set to false, + * then the user needs to manually delete the domain topic when it is no longer needed (e.g., when last event + * subscription is deleted and the resource needs to be cleaned up). The self-management mode can be used if the + * user wants full control of when the domain topic needs to be deleted, while auto-managed mode provides the + * flexibility to perform less operations and manage fewer resources by the user. + * + * @return the autoDeleteTopicWithLastSubscription value. + */ + Boolean autoDeleteTopicWithLastSubscription(); + /** * Gets the region of the resource. * @@ -184,10 +237,15 @@ interface WithResourceGroup { */ interface WithCreate extends DefinitionStages.WithTags, + DefinitionStages.WithSku, + DefinitionStages.WithIdentity, DefinitionStages.WithInputSchema, DefinitionStages.WithInputSchemaMapping, DefinitionStages.WithPublicNetworkAccess, - DefinitionStages.WithInboundIpRules { + DefinitionStages.WithInboundIpRules, + DefinitionStages.WithDisableLocalAuth, + DefinitionStages.WithAutoCreateTopicWithFirstSubscription, + DefinitionStages.WithAutoDeleteTopicWithLastSubscription { /** * Executes the create request. * @@ -213,14 +271,34 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the Domain definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The Sku pricing tier for the Event Grid Domain resource.. + * + * @param sku The Sku pricing tier for the Event Grid Domain resource. + * @return the next definition stage. + */ + WithCreate withSku(ResourceSku sku); + } + /** The stage of the Domain definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Identity information for the Event Grid Domain resource.. + * + * @param identity Identity information for the Event Grid Domain resource. + * @return the next definition stage. + */ + WithCreate withIdentity(IdentityInfo identity); + } /** The stage of the Domain definition allowing to specify inputSchema. */ interface WithInputSchema { /** * Specifies the inputSchema property: This determines the format that Event Grid should expect for incoming - * events published to the domain.. + * events published to the Event Grid Domain Resource.. * * @param inputSchema This determines the format that Event Grid should expect for incoming events published - * to the domain. + * to the Event Grid Domain Resource. * @return the next definition stage. */ WithCreate withInputSchema(InputSchema inputSchema); @@ -264,6 +342,76 @@ interface WithInboundIpRules { */ WithCreate withInboundIpRules(List inboundIpRules); } + /** The stage of the Domain definition allowing to specify disableLocalAuth. */ + interface WithDisableLocalAuth { + /** + * Specifies the disableLocalAuth property: This boolean is used to enable or disable local auth. Default + * value is false. When the property is set to true, only AAD token will be used to authenticate if user is + * allowed to publish to the domain.. + * + * @param disableLocalAuth This boolean is used to enable or disable local auth. Default value is false. + * When the property is set to true, only AAD token will be used to authenticate if user is allowed to + * publish to the domain. + * @return the next definition stage. + */ + WithCreate withDisableLocalAuth(Boolean disableLocalAuth); + } + /** The stage of the Domain definition allowing to specify autoCreateTopicWithFirstSubscription. */ + interface WithAutoCreateTopicWithFirstSubscription { + /** + * Specifies the autoCreateTopicWithFirstSubscription property: This Boolean is used to specify the creation + * mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this + * context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The + * default value for this property is true. When this property is null or set to true, Event Grid is + * responsible of automatically creating the domain topic when the first event subscription is created at + * the scope of the domain topic. If this property is set to false, then creating the first event + * subscription will require creating a domain topic by the user. The self-management mode can be used if + * the user wants full control of when the domain topic is created, while auto-managed mode provides the + * flexibility to perform less operations and manage fewer resources by the user. Also, note that in + * auto-managed creation mode, user is allowed to create the domain topic on demand if needed.. + * + * @param autoCreateTopicWithFirstSubscription This Boolean is used to specify the creation mechanism for + * 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this context, + * creation of domain topic can be auto-managed (when true) or self-managed (when false). The default + * value for this property is true. When this property is null or set to true, Event Grid is responsible + * of automatically creating the domain topic when the first event subscription is created at the scope + * of the domain topic. If this property is set to false, then creating the first event subscription + * will require creating a domain topic by the user. The self-management mode can be used if the user + * wants full control of when the domain topic is created, while auto-managed mode provides the + * flexibility to perform less operations and manage fewer resources by the user. Also, note that in + * auto-managed creation mode, user is allowed to create the domain topic on demand if needed. + * @return the next definition stage. + */ + WithCreate withAutoCreateTopicWithFirstSubscription(Boolean autoCreateTopicWithFirstSubscription); + } + /** The stage of the Domain definition allowing to specify autoDeleteTopicWithLastSubscription. */ + interface WithAutoDeleteTopicWithLastSubscription { + /** + * Specifies the autoDeleteTopicWithLastSubscription property: This Boolean is used to specify the deletion + * mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this + * context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The + * default value for this property is true. When this property is set to true, Event Grid is responsible of + * automatically deleting the domain topic when the last event subscription at the scope of the domain topic + * is deleted. If this property is set to false, then the user needs to manually delete the domain topic + * when it is no longer needed (e.g., when last event subscription is deleted and the resource needs to be + * cleaned up). The self-management mode can be used if the user wants full control of when the domain topic + * needs to be deleted, while auto-managed mode provides the flexibility to perform less operations and + * manage fewer resources by the user.. + * + * @param autoDeleteTopicWithLastSubscription This Boolean is used to specify the deletion mechanism for + * 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this context, + * deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default + * value for this property is true. When this property is set to true, Event Grid is responsible of + * automatically deleting the domain topic when the last event subscription at the scope of the domain + * topic is deleted. If this property is set to false, then the user needs to manually delete the domain + * topic when it is no longer needed (e.g., when last event subscription is deleted and the resource + * needs to be cleaned up). The self-management mode can be used if the user wants full control of when + * the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform + * less operations and manage fewer resources by the user. + * @return the next definition stage. + */ + WithCreate withAutoDeleteTopicWithLastSubscription(Boolean autoDeleteTopicWithLastSubscription); + } } /** * Begins update for the Domain resource. @@ -274,7 +422,14 @@ interface WithInboundIpRules { /** The template for Domain update. */ interface Update - extends UpdateStages.WithTags, UpdateStages.WithPublicNetworkAccess, UpdateStages.WithInboundIpRules { + extends UpdateStages.WithTags, + UpdateStages.WithIdentity, + UpdateStages.WithSku, + UpdateStages.WithPublicNetworkAccess, + UpdateStages.WithInboundIpRules, + UpdateStages.WithDisableLocalAuth, + UpdateStages.WithAutoCreateTopicWithFirstSubscription, + UpdateStages.WithAutoDeleteTopicWithLastSubscription { /** * Executes the update request. * @@ -302,6 +457,26 @@ interface WithTags { */ Update withTags(Map tags); } + /** The stage of the Domain update 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. + */ + Update withIdentity(IdentityInfo identity); + } + /** The stage of the Domain update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The Sku pricing tier for the domain.. + * + * @param sku The Sku pricing tier for the domain. + * @return the next definition stage. + */ + Update withSku(ResourceSku sku); + } /** The stage of the Domain update allowing to specify publicNetworkAccess. */ interface WithPublicNetworkAccess { /** @@ -332,6 +507,76 @@ interface WithInboundIpRules { */ Update withInboundIpRules(List inboundIpRules); } + /** The stage of the Domain update allowing to specify disableLocalAuth. */ + interface WithDisableLocalAuth { + /** + * Specifies the disableLocalAuth property: This boolean is used to enable or disable local auth. Default + * value is false. When the property is set to true, only AAD token will be used to authenticate if user is + * allowed to publish to the domain.. + * + * @param disableLocalAuth This boolean is used to enable or disable local auth. Default value is false. + * When the property is set to true, only AAD token will be used to authenticate if user is allowed to + * publish to the domain. + * @return the next definition stage. + */ + Update withDisableLocalAuth(Boolean disableLocalAuth); + } + /** The stage of the Domain update allowing to specify autoCreateTopicWithFirstSubscription. */ + interface WithAutoCreateTopicWithFirstSubscription { + /** + * Specifies the autoCreateTopicWithFirstSubscription property: This Boolean is used to specify the creation + * mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this + * context, creation of domain topic can be auto-managed (when true) or self-managed (when false). The + * default value for this property is true. When this property is null or set to true, Event Grid is + * responsible of automatically creating the domain topic when the first event subscription is created at + * the scope of the domain topic. If this property is set to false, then creating the first event + * subscription will require creating a domain topic by the user. The self-management mode can be used if + * the user wants full control of when the domain topic is created, while auto-managed mode provides the + * flexibility to perform less operations and manage fewer resources by the user. Also, note that in + * auto-managed creation mode, user is allowed to create the domain topic on demand if needed.. + * + * @param autoCreateTopicWithFirstSubscription This Boolean is used to specify the creation mechanism for + * 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this context, + * creation of domain topic can be auto-managed (when true) or self-managed (when false). The default + * value for this property is true. When this property is null or set to true, Event Grid is responsible + * of automatically creating the domain topic when the first event subscription is created at the scope + * of the domain topic. If this property is set to false, then creating the first event subscription + * will require creating a domain topic by the user. The self-management mode can be used if the user + * wants full control of when the domain topic is created, while auto-managed mode provides the + * flexibility to perform less operations and manage fewer resources by the user. Also, note that in + * auto-managed creation mode, user is allowed to create the domain topic on demand if needed. + * @return the next definition stage. + */ + Update withAutoCreateTopicWithFirstSubscription(Boolean autoCreateTopicWithFirstSubscription); + } + /** The stage of the Domain update allowing to specify autoDeleteTopicWithLastSubscription. */ + interface WithAutoDeleteTopicWithLastSubscription { + /** + * Specifies the autoDeleteTopicWithLastSubscription property: This Boolean is used to specify the deletion + * mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this + * context, deletion of domain topic can be auto-managed (when true) or self-managed (when false). The + * default value for this property is true. When this property is set to true, Event Grid is responsible of + * automatically deleting the domain topic when the last event subscription at the scope of the domain topic + * is deleted. If this property is set to false, then the user needs to manually delete the domain topic + * when it is no longer needed (e.g., when last event subscription is deleted and the resource needs to be + * cleaned up). The self-management mode can be used if the user wants full control of when the domain topic + * needs to be deleted, while auto-managed mode provides the flexibility to perform less operations and + * manage fewer resources by the user.. + * + * @param autoDeleteTopicWithLastSubscription This Boolean is used to specify the deletion mechanism for + * 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this context, + * deletion of domain topic can be auto-managed (when true) or self-managed (when false). The default + * value for this property is true. When this property is set to true, Event Grid is responsible of + * automatically deleting the domain topic when the last event subscription at the scope of the domain + * topic is deleted. If this property is set to false, then the user needs to manually delete the domain + * topic when it is no longer needed (e.g., when last event subscription is deleted and the resource + * needs to be cleaned up). The self-management mode can be used if the user wants full control of when + * the domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform + * less operations and manage fewer resources by the user. + * @return the next definition stage. + */ + Update withAutoDeleteTopicWithLastSubscription(Boolean autoDeleteTopicWithLastSubscription); + } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DomainUpdateParameters.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DomainUpdateParameters.java index 447cf87713ecc..763c60ee3c087 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DomainUpdateParameters.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DomainUpdateParameters.java @@ -24,6 +24,18 @@ public class DomainUpdateParameters { @JsonProperty(value = "tags") private Map tags; + /* + * Identity information for the resource. + */ + @JsonProperty(value = "identity") + private IdentityInfo identity; + + /* + * The Sku pricing tier for the domain. + */ + @JsonProperty(value = "sku") + private ResourceSku sku; + /* * This determines if traffic is allowed over public network. By default it * is enabled. @@ -41,6 +53,62 @@ public class DomainUpdateParameters { @JsonProperty(value = "properties.inboundIpRules") private List inboundIpRules; + /* + * This boolean is used to enable or disable local auth. Default value is + * false. When the property is set to true, only AAD token will be used to + * authenticate if user is allowed to publish to the domain. + */ + @JsonProperty(value = "properties.disableLocalAuth") + private Boolean disableLocalAuth; + + /* + * This Boolean is used to specify the creation mechanism for 'all' the + * Event Grid Domain Topics associated with this Event Grid Domain + * resource. + * In this context, creation of domain topic can be auto-managed (when + * true) or self-managed (when false). The default value for this property + * is true. + * When this property is null or set to true, Event Grid is responsible of + * automatically creating the domain topic when the first event + * subscription is + * created at the scope of the domain topic. If this property is set to + * false, then creating the first event subscription will require creating + * a domain topic + * by the user. The self-management mode can be used if the user wants full + * control of when the domain topic is created, while auto-managed mode + * provides the + * flexibility to perform less operations and manage fewer resources by the + * user. Also, note that in auto-managed creation mode, user is allowed to + * create the + * domain topic on demand if needed. + */ + @JsonProperty(value = "properties.autoCreateTopicWithFirstSubscription") + private Boolean autoCreateTopicWithFirstSubscription; + + /* + * This Boolean is used to specify the deletion mechanism for 'all' the + * Event Grid Domain Topics associated with this Event Grid Domain + * resource. + * In this context, deletion of domain topic can be auto-managed (when + * true) or self-managed (when false). The default value for this property + * is true. + * When this property is set to true, Event Grid is responsible of + * automatically deleting the domain topic when the last event subscription + * at the scope + * of the domain topic is deleted. If this property is set to false, then + * the user needs to manually delete the domain topic when it is no longer + * needed + * (e.g., when last event subscription is deleted and the resource needs to + * be cleaned up). The self-management mode can be used if the user wants + * full + * control of when the domain topic needs to be deleted, while auto-managed + * mode provides the flexibility to perform less operations and manage + * fewer + * resources by the user. + */ + @JsonProperty(value = "properties.autoDeleteTopicWithLastSubscription") + private Boolean autoDeleteTopicWithLastSubscription; + /** * Get the tags property: Tags of the domains resource. * @@ -61,6 +129,46 @@ public DomainUpdateParameters withTags(Map tags) { return this; } + /** + * 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 DomainUpdateParameters object itself. + */ + public DomainUpdateParameters withIdentity(IdentityInfo identity) { + this.identity = identity; + return this; + } + + /** + * Get the sku property: The Sku pricing tier for the domain. + * + * @return the sku value. + */ + public ResourceSku sku() { + return this.sku; + } + + /** + * Set the sku property: The Sku pricing tier for the domain. + * + * @param sku the sku value to set. + * @return the DomainUpdateParameters object itself. + */ + public DomainUpdateParameters withSku(ResourceSku sku) { + this.sku = sku; + return this; + } + /** * Get the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is * enabled. You can further restrict to specific IPs by configuring <seealso @@ -109,12 +217,115 @@ public DomainUpdateParameters withInboundIpRules(List inboundIpRu return this; } + /** + * Get the disableLocalAuth property: This boolean is used to enable or disable local auth. Default value is false. + * When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to + * the domain. + * + * @return the disableLocalAuth value. + */ + public Boolean disableLocalAuth() { + return this.disableLocalAuth; + } + + /** + * Set the disableLocalAuth property: This boolean is used to enable or disable local auth. Default value is false. + * When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to + * the domain. + * + * @param disableLocalAuth the disableLocalAuth value to set. + * @return the DomainUpdateParameters object itself. + */ + public DomainUpdateParameters withDisableLocalAuth(Boolean disableLocalAuth) { + this.disableLocalAuth = disableLocalAuth; + return this; + } + + /** + * Get the autoCreateTopicWithFirstSubscription property: This Boolean is used to specify the creation mechanism for + * 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this context, creation of + * domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is + * true. When this property is null or set to true, Event Grid is responsible of automatically creating the domain + * topic when the first event subscription is created at the scope of the domain topic. If this property is set to + * false, then creating the first event subscription will require creating a domain topic by the user. The + * self-management mode can be used if the user wants full control of when the domain topic is created, while + * auto-managed mode provides the flexibility to perform less operations and manage fewer resources by the user. + * Also, note that in auto-managed creation mode, user is allowed to create the domain topic on demand if needed. + * + * @return the autoCreateTopicWithFirstSubscription value. + */ + public Boolean autoCreateTopicWithFirstSubscription() { + return this.autoCreateTopicWithFirstSubscription; + } + + /** + * Set the autoCreateTopicWithFirstSubscription property: This Boolean is used to specify the creation mechanism for + * 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this context, creation of + * domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is + * true. When this property is null or set to true, Event Grid is responsible of automatically creating the domain + * topic when the first event subscription is created at the scope of the domain topic. If this property is set to + * false, then creating the first event subscription will require creating a domain topic by the user. The + * self-management mode can be used if the user wants full control of when the domain topic is created, while + * auto-managed mode provides the flexibility to perform less operations and manage fewer resources by the user. + * Also, note that in auto-managed creation mode, user is allowed to create the domain topic on demand if needed. + * + * @param autoCreateTopicWithFirstSubscription the autoCreateTopicWithFirstSubscription value to set. + * @return the DomainUpdateParameters object itself. + */ + public DomainUpdateParameters withAutoCreateTopicWithFirstSubscription( + Boolean autoCreateTopicWithFirstSubscription) { + this.autoCreateTopicWithFirstSubscription = autoCreateTopicWithFirstSubscription; + return this; + } + + /** + * Get the autoDeleteTopicWithLastSubscription property: This Boolean is used to specify the deletion mechanism for + * 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this context, deletion of + * domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is + * true. When this property is set to true, Event Grid is responsible of automatically deleting the domain topic + * when the last event subscription at the scope of the domain topic is deleted. If this property is set to false, + * then the user needs to manually delete the domain topic when it is no longer needed (e.g., when last event + * subscription is deleted and the resource needs to be cleaned up). The self-management mode can be used if the + * user wants full control of when the domain topic needs to be deleted, while auto-managed mode provides the + * flexibility to perform less operations and manage fewer resources by the user. + * + * @return the autoDeleteTopicWithLastSubscription value. + */ + public Boolean autoDeleteTopicWithLastSubscription() { + return this.autoDeleteTopicWithLastSubscription; + } + + /** + * Set the autoDeleteTopicWithLastSubscription property: This Boolean is used to specify the deletion mechanism for + * 'all' the Event Grid Domain Topics associated with this Event Grid Domain resource. In this context, deletion of + * domain topic can be auto-managed (when true) or self-managed (when false). The default value for this property is + * true. When this property is set to true, Event Grid is responsible of automatically deleting the domain topic + * when the last event subscription at the scope of the domain topic is deleted. If this property is set to false, + * then the user needs to manually delete the domain topic when it is no longer needed (e.g., when last event + * subscription is deleted and the resource needs to be cleaned up). The self-management mode can be used if the + * user wants full control of when the domain topic needs to be deleted, while auto-managed mode provides the + * flexibility to perform less operations and manage fewer resources by the user. + * + * @param autoDeleteTopicWithLastSubscription the autoDeleteTopicWithLastSubscription value to set. + * @return the DomainUpdateParameters object itself. + */ + public DomainUpdateParameters withAutoDeleteTopicWithLastSubscription(Boolean autoDeleteTopicWithLastSubscription) { + this.autoDeleteTopicWithLastSubscription = autoDeleteTopicWithLastSubscription; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (identity() != null) { + identity().validate(); + } + if (sku() != null) { + sku().validate(); + } if (inboundIpRules() != null) { inboundIpRules().forEach(e -> e.validate()); } diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DomainsListResult.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DomainsListResult.java index d0cb0356cfe63..f493801704723 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DomainsListResult.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DomainsListResult.java @@ -17,13 +17,13 @@ public final class DomainsListResult { @JsonIgnore private final ClientLogger logger = new ClientLogger(DomainsListResult.class); /* - * A collection of Domains. + * A collection of Domains */ @JsonProperty(value = "value") private List value; /* - * A link for the next page of domains. + * A link for the next page of domains */ @JsonProperty(value = "nextLink") private String nextLink; diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DynamicDeliveryAttributeMapping.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DynamicDeliveryAttributeMapping.java new file mode 100644 index 0000000000000..835fea4b15cc8 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/DynamicDeliveryAttributeMapping.java @@ -0,0 +1,65 @@ +// 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.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Dynamic delivery attribute mapping details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Dynamic") +@JsonFlatten +@Fluent +public class DynamicDeliveryAttributeMapping extends DeliveryAttributeMapping { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DynamicDeliveryAttributeMapping.class); + + /* + * JSON path in the event which contains attribute value. + */ + @JsonProperty(value = "properties.sourceField") + private String sourceField; + + /** + * Get the sourceField property: JSON path in the event which contains attribute value. + * + * @return the sourceField value. + */ + public String sourceField() { + return this.sourceField; + } + + /** + * Set the sourceField property: JSON path in the event which contains attribute value. + * + * @param sourceField the sourceField value to set. + * @return the DynamicDeliveryAttributeMapping object itself. + */ + public DynamicDeliveryAttributeMapping withSourceField(String sourceField) { + this.sourceField = sourceField; + return this; + } + + /** {@inheritDoc} */ + @Override + public DynamicDeliveryAttributeMapping withName(String name) { + super.withName(name); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventChannel.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventChannel.java new file mode 100644 index 0000000000000..1395697ee4a63 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventChannel.java @@ -0,0 +1,315 @@ +// 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.core.util.Context; +import com.azure.resourcemanager.eventgrid.fluent.models.EventChannelInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of EventChannel. */ +public interface EventChannel { + /** + * 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 Event Channel resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the source property: Source of the event channel. This represents a unique resource in the partner's + * resource model. + * + * @return the source value. + */ + EventChannelSource source(); + + /** + * Gets the destination property: Represents the destination of an event channel. + * + * @return the destination value. + */ + EventChannelDestination destination(); + + /** + * Gets the provisioningState property: Provisioning state of the event channel. + * + * @return the provisioningState value. + */ + EventChannelProvisioningState provisioningState(); + + /** + * Gets the partnerTopicReadinessState property: The readiness state of the corresponding partner topic. + * + * @return the partnerTopicReadinessState value. + */ + PartnerTopicReadinessState partnerTopicReadinessState(); + + /** + * Gets the expirationTimeIfNotActivatedUtc property: Expiration time of the event channel. If this timer expires + * while the corresponding partner topic is never activated, the event channel and corresponding partner topic are + * deleted. + * + * @return the expirationTimeIfNotActivatedUtc value. + */ + OffsetDateTime expirationTimeIfNotActivatedUtc(); + + /** + * Gets the filter property: Information about the filter for the event channel. + * + * @return the filter value. + */ + EventChannelFilter filter(); + + /** + * Gets the partnerTopicFriendlyDescription property: Friendly description about the topic. This can be set by the + * publisher/partner to show custom description for the customer partner topic. This will be helpful to remove any + * ambiguity of the origin of creation of the partner topic for the customer. + * + * @return the partnerTopicFriendlyDescription value. + */ + String partnerTopicFriendlyDescription(); + + /** + * Gets the inner com.azure.resourcemanager.eventgrid.fluent.models.EventChannelInner object. + * + * @return the inner object. + */ + EventChannelInner innerModel(); + + /** The entirety of the EventChannel definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The EventChannel definition stages. */ + interface DefinitionStages { + /** The first stage of the EventChannel definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the EventChannel definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, partnerNamespaceName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @return the next definition stage. + */ + WithCreate withExistingPartnerNamespace(String resourceGroupName, String partnerNamespaceName); + } + /** + * The stage of the EventChannel definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithSource, + DefinitionStages.WithDestination, + DefinitionStages.WithExpirationTimeIfNotActivatedUtc, + DefinitionStages.WithFilter, + DefinitionStages.WithPartnerTopicFriendlyDescription { + /** + * Executes the create request. + * + * @return the created resource. + */ + EventChannel create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + EventChannel create(Context context); + } + /** The stage of the EventChannel definition allowing to specify source. */ + interface WithSource { + /** + * Specifies the source property: Source of the event channel. This represents a unique resource in the + * partner's resource model.. + * + * @param source Source of the event channel. This represents a unique resource in the partner's resource + * model. + * @return the next definition stage. + */ + WithCreate withSource(EventChannelSource source); + } + /** The stage of the EventChannel definition allowing to specify destination. */ + interface WithDestination { + /** + * Specifies the destination property: Represents the destination of an event channel.. + * + * @param destination Represents the destination of an event channel. + * @return the next definition stage. + */ + WithCreate withDestination(EventChannelDestination destination); + } + /** The stage of the EventChannel definition allowing to specify expirationTimeIfNotActivatedUtc. */ + interface WithExpirationTimeIfNotActivatedUtc { + /** + * Specifies the expirationTimeIfNotActivatedUtc property: Expiration time of the event channel. If this + * timer expires while the corresponding partner topic is never activated, the event channel and + * corresponding partner topic are deleted.. + * + * @param expirationTimeIfNotActivatedUtc Expiration time of the event channel. If this timer expires while + * the corresponding partner topic is never activated, the event channel and corresponding partner topic + * are deleted. + * @return the next definition stage. + */ + WithCreate withExpirationTimeIfNotActivatedUtc(OffsetDateTime expirationTimeIfNotActivatedUtc); + } + /** The stage of the EventChannel definition allowing to specify filter. */ + interface WithFilter { + /** + * Specifies the filter property: Information about the filter for the event channel.. + * + * @param filter Information about the filter for the event channel. + * @return the next definition stage. + */ + WithCreate withFilter(EventChannelFilter filter); + } + /** The stage of the EventChannel definition allowing to specify partnerTopicFriendlyDescription. */ + interface WithPartnerTopicFriendlyDescription { + /** + * Specifies the partnerTopicFriendlyDescription property: Friendly description about the topic. This can be + * set by the publisher/partner to show custom description for the customer partner topic. This will be + * helpful to remove any ambiguity of the origin of creation of the partner topic for the customer.. + * + * @param partnerTopicFriendlyDescription Friendly description about the topic. This can be set by the + * publisher/partner to show custom description for the customer partner topic. This will be helpful to + * remove any ambiguity of the origin of creation of the partner topic for the customer. + * @return the next definition stage. + */ + WithCreate withPartnerTopicFriendlyDescription(String partnerTopicFriendlyDescription); + } + } + /** + * Begins update for the EventChannel resource. + * + * @return the stage of resource update. + */ + EventChannel.Update update(); + + /** The template for EventChannel update. */ + interface Update + extends UpdateStages.WithSource, + UpdateStages.WithDestination, + UpdateStages.WithExpirationTimeIfNotActivatedUtc, + UpdateStages.WithFilter, + UpdateStages.WithPartnerTopicFriendlyDescription { + /** + * Executes the update request. + * + * @return the updated resource. + */ + EventChannel apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + EventChannel apply(Context context); + } + /** The EventChannel update stages. */ + interface UpdateStages { + /** The stage of the EventChannel update allowing to specify source. */ + interface WithSource { + /** + * Specifies the source property: Source of the event channel. This represents a unique resource in the + * partner's resource model.. + * + * @param source Source of the event channel. This represents a unique resource in the partner's resource + * model. + * @return the next definition stage. + */ + Update withSource(EventChannelSource source); + } + /** The stage of the EventChannel update allowing to specify destination. */ + interface WithDestination { + /** + * Specifies the destination property: Represents the destination of an event channel.. + * + * @param destination Represents the destination of an event channel. + * @return the next definition stage. + */ + Update withDestination(EventChannelDestination destination); + } + /** The stage of the EventChannel update allowing to specify expirationTimeIfNotActivatedUtc. */ + interface WithExpirationTimeIfNotActivatedUtc { + /** + * Specifies the expirationTimeIfNotActivatedUtc property: Expiration time of the event channel. If this + * timer expires while the corresponding partner topic is never activated, the event channel and + * corresponding partner topic are deleted.. + * + * @param expirationTimeIfNotActivatedUtc Expiration time of the event channel. If this timer expires while + * the corresponding partner topic is never activated, the event channel and corresponding partner topic + * are deleted. + * @return the next definition stage. + */ + Update withExpirationTimeIfNotActivatedUtc(OffsetDateTime expirationTimeIfNotActivatedUtc); + } + /** The stage of the EventChannel update allowing to specify filter. */ + interface WithFilter { + /** + * Specifies the filter property: Information about the filter for the event channel.. + * + * @param filter Information about the filter for the event channel. + * @return the next definition stage. + */ + Update withFilter(EventChannelFilter filter); + } + /** The stage of the EventChannel update allowing to specify partnerTopicFriendlyDescription. */ + interface WithPartnerTopicFriendlyDescription { + /** + * Specifies the partnerTopicFriendlyDescription property: Friendly description about the topic. This can be + * set by the publisher/partner to show custom description for the customer partner topic. This will be + * helpful to remove any ambiguity of the origin of creation of the partner topic for the customer.. + * + * @param partnerTopicFriendlyDescription Friendly description about the topic. This can be set by the + * publisher/partner to show custom description for the customer partner topic. This will be helpful to + * remove any ambiguity of the origin of creation of the partner topic for the customer. + * @return the next definition stage. + */ + Update withPartnerTopicFriendlyDescription(String partnerTopicFriendlyDescription); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + EventChannel refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + EventChannel refresh(Context context); +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventChannelDestination.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventChannelDestination.java new file mode 100644 index 0000000000000..163c321529e05 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventChannelDestination.java @@ -0,0 +1,112 @@ +// 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; + +/** Properties of the destination of an event channel. */ +@Fluent +public final class EventChannelDestination { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventChannelDestination.class); + + /* + * Azure subscription ID of the customer creating the event channel. The + * partner topic + * associated with the event channel will be created under this Azure + * subscription. + */ + @JsonProperty(value = "azureSubscriptionId") + private String azureSubscriptionId; + + /* + * Azure Resource Group of the customer creating the event channel. The + * partner topic + * associated with the event channel will be created under this resource + * group. + */ + @JsonProperty(value = "resourceGroup") + private String resourceGroup; + + /* + * Name of the partner topic associated with the event channel. + */ + @JsonProperty(value = "partnerTopicName") + private String partnerTopicName; + + /** + * Get the azureSubscriptionId property: Azure subscription ID of the customer creating the event channel. The + * partner topic associated with the event channel will be created under this Azure subscription. + * + * @return the azureSubscriptionId value. + */ + public String azureSubscriptionId() { + return this.azureSubscriptionId; + } + + /** + * Set the azureSubscriptionId property: Azure subscription ID of the customer creating the event channel. The + * partner topic associated with the event channel will be created under this Azure subscription. + * + * @param azureSubscriptionId the azureSubscriptionId value to set. + * @return the EventChannelDestination object itself. + */ + public EventChannelDestination withAzureSubscriptionId(String azureSubscriptionId) { + this.azureSubscriptionId = azureSubscriptionId; + return this; + } + + /** + * Get the resourceGroup property: Azure Resource Group of the customer creating the event channel. The partner + * topic associated with the event channel will be created under this resource group. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the resourceGroup property: Azure Resource Group of the customer creating the event channel. The partner + * topic associated with the event channel will be created under this resource group. + * + * @param resourceGroup the resourceGroup value to set. + * @return the EventChannelDestination object itself. + */ + public EventChannelDestination withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Get the partnerTopicName property: Name of the partner topic associated with the event channel. + * + * @return the partnerTopicName value. + */ + public String partnerTopicName() { + return this.partnerTopicName; + } + + /** + * Set the partnerTopicName property: Name of the partner topic associated with the event channel. + * + * @param partnerTopicName the partnerTopicName value to set. + * @return the EventChannelDestination object itself. + */ + public EventChannelDestination withPartnerTopicName(String partnerTopicName) { + this.partnerTopicName = partnerTopicName; + 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/EventChannelFilter.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventChannelFilter.java new file mode 100644 index 0000000000000..b6914d7edc71e --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventChannelFilter.java @@ -0,0 +1,84 @@ +// 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; +import java.util.List; + +/** Filter for the Event Channel. */ +@Fluent +public final class EventChannelFilter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventChannelFilter.class); + + /* + * Allows advanced filters to be evaluated against an array of values + * instead of expecting a singular value. The default value is either false + * or null. + */ + @JsonProperty(value = "enableAdvancedFilteringOnArrays") + private Boolean enableAdvancedFilteringOnArrays; + + /* + * An array of advanced filters that are used for filtering event channels. + */ + @JsonProperty(value = "advancedFilters") + private List advancedFilters; + + /** + * Get the enableAdvancedFilteringOnArrays property: Allows advanced filters to be evaluated against an array of + * values instead of expecting a singular value. The default value is either false or null. + * + * @return the enableAdvancedFilteringOnArrays value. + */ + public Boolean enableAdvancedFilteringOnArrays() { + return this.enableAdvancedFilteringOnArrays; + } + + /** + * Set the enableAdvancedFilteringOnArrays property: Allows advanced filters to be evaluated against an array of + * values instead of expecting a singular value. The default value is either false or null. + * + * @param enableAdvancedFilteringOnArrays the enableAdvancedFilteringOnArrays value to set. + * @return the EventChannelFilter object itself. + */ + public EventChannelFilter withEnableAdvancedFilteringOnArrays(Boolean enableAdvancedFilteringOnArrays) { + this.enableAdvancedFilteringOnArrays = enableAdvancedFilteringOnArrays; + return this; + } + + /** + * Get the advancedFilters property: An array of advanced filters that are used for filtering event channels. + * + * @return the advancedFilters value. + */ + public List advancedFilters() { + return this.advancedFilters; + } + + /** + * Set the advancedFilters property: An array of advanced filters that are used for filtering event channels. + * + * @param advancedFilters the advancedFilters value to set. + * @return the EventChannelFilter object itself. + */ + public EventChannelFilter withAdvancedFilters(List advancedFilters) { + this.advancedFilters = advancedFilters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (advancedFilters() != null) { + advancedFilters().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventChannelProvisioningState.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventChannelProvisioningState.java new file mode 100644 index 0000000000000..d82b71a475281 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventChannelProvisioningState.java @@ -0,0 +1,46 @@ +// 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 EventChannelProvisioningState. */ +public final class EventChannelProvisioningState extends ExpandableStringEnum { + /** Static value Creating for EventChannelProvisioningState. */ + public static final EventChannelProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for EventChannelProvisioningState. */ + public static final EventChannelProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for EventChannelProvisioningState. */ + public static final EventChannelProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for EventChannelProvisioningState. */ + public static final EventChannelProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for EventChannelProvisioningState. */ + public static final EventChannelProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Failed for EventChannelProvisioningState. */ + public static final EventChannelProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a EventChannelProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EventChannelProvisioningState. + */ + @JsonCreator + public static EventChannelProvisioningState fromString(String name) { + return fromString(name, EventChannelProvisioningState.class); + } + + /** @return known EventChannelProvisioningState values. */ + public static Collection values() { + return values(EventChannelProvisioningState.class); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventChannelSource.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventChannelSource.java new file mode 100644 index 0000000000000..a673af3af0a24 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventChannelSource.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.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 source of an event channel. */ +@Fluent +public final class EventChannelSource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventChannelSource.class); + + /* + * The identifier of the resource that's the source of the events. + * This represents a unique resource in the partner's resource model. + */ + @JsonProperty(value = "source") + private String source; + + /** + * Get the source property: The identifier of the resource that's the source of the events. This represents a unique + * resource in the partner's resource model. + * + * @return the source value. + */ + public String source() { + return this.source; + } + + /** + * Set the source property: The identifier of the resource that's the source of the events. This represents a unique + * resource in the partner's resource model. + * + * @param source the source value to set. + * @return the EventChannelSource object itself. + */ + public EventChannelSource withSource(String source) { + this.source = source; + 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/EventChannels.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventChannels.java new file mode 100644 index 0000000000000..ce5be2c5c2927 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventChannels.java @@ -0,0 +1,151 @@ +// 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.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of EventChannels. */ +public interface EventChannels { + /** + * Get properties of an event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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 properties of an event channel. + */ + EventChannel get(String resourceGroupName, String partnerNamespaceName, String eventChannelName); + + /** + * Get properties of an event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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 properties of an event channel. + */ + Response getWithResponse( + String resourceGroupName, String partnerNamespaceName, String eventChannelName, Context context); + + /** + * Delete existing event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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. + */ + void delete(String resourceGroupName, String partnerNamespaceName, String eventChannelName); + + /** + * Delete existing event channel. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param eventChannelName Name of the event channel. + * @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. + */ + void delete(String resourceGroupName, String partnerNamespaceName, String eventChannelName, Context context); + + /** + * List all the event channels in a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 result of the List Event Channels operation. + */ + PagedIterable listByPartnerNamespace(String resourceGroupName, String partnerNamespaceName); + + /** + * List all the event channels in a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Event Channels operation. + */ + PagedIterable listByPartnerNamespace( + String resourceGroupName, String partnerNamespaceName, String filter, Integer top, Context context); + + /** + * Get properties of an event channel. + * + * @param id the resource ID. + * @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 properties of an event channel. + */ + EventChannel getById(String id); + + /** + * Get properties of an event channel. + * + * @param id the resource ID. + * @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 properties of an event channel. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete existing event channel. + * + * @param id the resource ID. + * @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. + */ + void deleteById(String id); + + /** + * Delete existing event channel. + * + * @param id the resource ID. + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EventChannel resource. + * + * @param name resource name. + * @return the first stage of the new EventChannel definition. + */ + EventChannel.DefinitionStages.Blank define(String name); +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventChannelsListResult.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventChannelsListResult.java new file mode 100644 index 0000000000000..10f3cd033973a --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventChannelsListResult.java @@ -0,0 +1,81 @@ +// 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.azure.resourcemanager.eventgrid.fluent.models.EventChannelInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Result of the List Event Channels operation. */ +@Fluent +public final class EventChannelsListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventChannelsListResult.class); + + /* + * A collection of Event Channels + */ + @JsonProperty(value = "value") + private List value; + + /* + * A link for the next page of event channels + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A collection of Event Channels. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of Event Channels. + * + * @param value the value value to set. + * @return the EventChannelsListResult object itself. + */ + public EventChannelsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: A link for the next page of event channels. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: A link for the next page of event channels. + * + * @param nextLink the nextLink value to set. + * @return the EventChannelsListResult object itself. + */ + public EventChannelsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventHubEventSubscriptionDestination.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventHubEventSubscriptionDestination.java index 35fdfb490f07b..0f0181690a20a 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventHubEventSubscriptionDestination.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventHubEventSubscriptionDestination.java @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; /** Information about the event hub destination for an event subscription. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType") @@ -27,6 +28,12 @@ public class EventHubEventSubscriptionDestination extends EventSubscriptionDesti @JsonProperty(value = "properties.resourceId") private String resourceId; + /* + * Delivery attribute details. + */ + @JsonProperty(value = "properties.deliveryAttributeMappings") + private List deliveryAttributeMappings; + /** * Get the resourceId property: The Azure Resource Id that represents the endpoint of an Event Hub destination of an * event subscription. @@ -49,6 +56,27 @@ public EventHubEventSubscriptionDestination withResourceId(String resourceId) { return this; } + /** + * Get the deliveryAttributeMappings property: Delivery attribute details. + * + * @return the deliveryAttributeMappings value. + */ + public List deliveryAttributeMappings() { + return this.deliveryAttributeMappings; + } + + /** + * Set the deliveryAttributeMappings property: Delivery attribute details. + * + * @param deliveryAttributeMappings the deliveryAttributeMappings value to set. + * @return the EventHubEventSubscriptionDestination object itself. + */ + public EventHubEventSubscriptionDestination withDeliveryAttributeMappings( + List deliveryAttributeMappings) { + this.deliveryAttributeMappings = deliveryAttributeMappings; + return this; + } + /** * Validates the instance. * @@ -57,5 +85,8 @@ public EventHubEventSubscriptionDestination withResourceId(String resourceId) { @Override public void validate() { super.validate(); + if (deliveryAttributeMappings() != null) { + deliveryAttributeMappings().forEach(e -> e.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 e9d1d3ae063bf..24ae649ded7c8 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 @@ -57,12 +57,22 @@ public interface EventSubscription { /** * Gets the destination property: Information about the destination where events have to be delivered for the event - * subscription. + * subscription. Uses Azure Event Grid's identity to acquire the authentication tokens being used during delivery / + * dead-lettering. * * @return the destination value. */ 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. * @@ -100,12 +110,24 @@ public interface EventSubscription { RetryPolicy retryPolicy(); /** - * Gets the deadLetterDestination property: The DeadLetter destination of the event subscription. + * Gets the deadLetterDestination 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 Azure Event Grid's identity + * to acquire the authentication tokens being used during delivery / dead-lettering. * * @return the deadLetterDestination value. */ 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 +167,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. * @@ -170,14 +194,31 @@ interface WithCreate interface WithDestination { /** * Specifies the destination property: Information about the destination where events have to be delivered - * for the event subscription.. + * for the event subscription. Uses Azure Event Grid's identity to acquire the authentication tokens being + * used during delivery / dead-lettering.. * * @param destination Information about the destination where events have to be delivered for the event - * subscription. + * subscription. Uses Azure Event Grid's identity to acquire the authentication tokens being used during + * delivery / dead-lettering. * @return the next definition stage. */ 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 { /** @@ -233,13 +274,34 @@ interface WithRetryPolicy { /** The stage of the EventSubscription definition allowing to specify deadLetterDestination. */ interface WithDeadLetterDestination { /** - * Specifies the deadLetterDestination property: The DeadLetter destination of the event subscription.. + * Specifies the deadLetterDestination 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 Azure + * Event Grid's identity to acquire the authentication tokens being used during delivery / dead-lettering.. * - * @param deadLetterDestination The DeadLetter destination of the event subscription. + * @param 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 Azure Event Grid's + * identity to acquire the authentication tokens being used during delivery / dead-lettering. * @return the next definition stage. */ 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 +313,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. * @@ -278,14 +342,30 @@ interface UpdateStages { interface WithDestination { /** * Specifies the destination property: Information about the destination where events have to be delivered - * for the event subscription.. + * for the event subscription. Uses Azure Event Grid's identity to acquire the authentication tokens being + * used during delivery / dead-lettering.. * * @param destination Information about the destination where events have to be delivered for the event - * subscription. + * subscription. Uses Azure Event Grid's identity to acquire the authentication tokens being used during + * delivery / dead-lettering. * @return the next definition stage. */ 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 { /** @@ -342,13 +422,33 @@ interface WithRetryPolicy { /** The stage of the EventSubscription update allowing to specify deadLetterDestination. */ interface WithDeadLetterDestination { /** - * Specifies the deadLetterDestination property: The DeadLetter destination of the event subscription.. + * Specifies the deadLetterDestination 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 Azure + * Event Grid's identity to acquire the authentication tokens being used during delivery / dead-lettering.. * - * @param deadLetterDestination The DeadLetter destination of the event subscription. + * @param 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 Azure Event Grid's + * identity to acquire the authentication tokens being used during delivery / dead-lettering. * @return the next definition stage. */ 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. @@ -384,4 +484,24 @@ interface WithDeadLetterDestination { * @return the full endpoint URL for an event subscription. */ Response getFullUrlWithResponse(Context context); + + /** + * Get all delivery attributes for an event subscription. + * + * @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 all delivery attributes for an event subscription. + */ + DeliveryAttributeListResult getDeliveryAttributes(); + + /** + * Get all delivery attributes for an event subscription. + * + * @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 all delivery attributes for an event subscription. + */ + Response getDeliveryAttributesWithResponse(Context context); } diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventSubscriptionFilter.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventSubscriptionFilter.java index 6425665e315d3..0598b30c55ac5 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventSubscriptionFilter.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventSubscriptionFilter.java @@ -48,6 +48,13 @@ public final class EventSubscriptionFilter { @JsonProperty(value = "isSubjectCaseSensitive") private Boolean isSubjectCaseSensitive; + /* + * Allows advanced filters to be evaluated against an array of values + * instead of expecting a singular value. + */ + @JsonProperty(value = "enableAdvancedFilteringOnArrays") + private Boolean enableAdvancedFilteringOnArrays; + /* * An array of advanced filters that are used for filtering event * subscriptions. @@ -145,6 +152,28 @@ public EventSubscriptionFilter withIsSubjectCaseSensitive(Boolean isSubjectCaseS return this; } + /** + * Get the enableAdvancedFilteringOnArrays property: Allows advanced filters to be evaluated against an array of + * values instead of expecting a singular value. + * + * @return the enableAdvancedFilteringOnArrays value. + */ + public Boolean enableAdvancedFilteringOnArrays() { + return this.enableAdvancedFilteringOnArrays; + } + + /** + * Set the enableAdvancedFilteringOnArrays property: Allows advanced filters to be evaluated against an array of + * values instead of expecting a singular value. + * + * @param enableAdvancedFilteringOnArrays the enableAdvancedFilteringOnArrays value to set. + * @return the EventSubscriptionFilter object itself. + */ + public EventSubscriptionFilter withEnableAdvancedFilteringOnArrays(Boolean enableAdvancedFilteringOnArrays) { + this.enableAdvancedFilteringOnArrays = enableAdvancedFilteringOnArrays; + return this; + } + /** * Get the advancedFilters property: An array of advanced filters that are used for filtering event subscriptions. * 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 0000000000000..37f4e6cdb9c55 --- /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 0000000000000..1ee3b47e8d2ce --- /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 be14e3e69c790..282f9b2d5bc0d 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 @@ -19,10 +19,22 @@ public final class EventSubscriptionUpdateParameters { /* * 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; + /* + * 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. */ @@ -55,14 +67,30 @@ public final class EventSubscriptionUpdateParameters { private RetryPolicy retryPolicy; /* - * The DeadLetter destination of the event subscription. + * 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 Azure Event Grid's identity to acquire the authentication tokens + * being used during delivery / dead-lettering. */ @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. + * subscription. Uses Azure Event Grid's identity to acquire the authentication tokens being used during delivery / + * dead-lettering. * * @return the destination value. */ @@ -72,7 +100,8 @@ public EventSubscriptionDestination destination() { /** * Set the destination property: Information about the destination where events have to be delivered for the event - * subscription. + * 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 EventSubscriptionUpdateParameters object itself. @@ -82,6 +111,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. * @@ -185,7 +239,9 @@ public EventSubscriptionUpdateParameters withRetryPolicy(RetryPolicy retryPolicy } /** - * Get the deadLetterDestination property: The DeadLetter destination of the event subscription. + * Get the deadLetterDestination 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 Azure Event Grid's identity + * to acquire the authentication tokens being used during delivery / dead-lettering. * * @return the deadLetterDestination value. */ @@ -194,7 +250,9 @@ public DeadLetterDestination deadLetterDestination() { } /** - * Set the deadLetterDestination property: The DeadLetter destination of the event subscription. + * Set the deadLetterDestination 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 Azure Event Grid's identity + * to acquire the authentication tokens being used during delivery / dead-lettering. * * @param deadLetterDestination the deadLetterDestination value to set. * @return the EventSubscriptionUpdateParameters object itself. @@ -204,6 +262,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 +298,9 @@ public void validate() { if (destination() != null) { destination().validate(); } + if (deliveryWithResourceIdentity() != null) { + deliveryWithResourceIdentity().validate(); + } if (filter() != null) { filter().validate(); } @@ -222,5 +310,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/EventSubscriptions.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventSubscriptions.java index bc3cf8976eaed..b41a2042134d6 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventSubscriptions.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/EventSubscriptions.java @@ -473,6 +473,46 @@ PagedIterable listByResource( PagedIterable listByDomainTopic( String resourceGroupName, String domainName, String topicName, String filter, Integer top, Context context); + /** + * Get all delivery attributes for an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top + * level resource belonging to a resource provider namespace, or an EventGrid topic. 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 a resource, and + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + * for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @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 all delivery attributes for an event subscription. + */ + DeliveryAttributeListResult getDeliveryAttributes(String scope, String eventSubscriptionName); + + /** + * Get all delivery attributes for an event subscription. + * + * @param scope The scope of the event subscription. The scope can be a subscription, or a resource group, or a top + * level resource belonging to a resource provider namespace, or an EventGrid topic. 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 a resource, and + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + * for an EventGrid topic. + * @param eventSubscriptionName Name of the event subscription. + * @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 all delivery attributes for an event subscription. + */ + Response getDeliveryAttributesWithResponse( + String scope, String eventSubscriptionName, Context context); + /** * Get properties of an event subscription. * diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ExtendedLocation.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ExtendedLocation.java new file mode 100644 index 0000000000000..7f61f72283d78 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ExtendedLocation.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.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; + +/** Definition of an Extended Location. */ +@Fluent +public final class ExtendedLocation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtendedLocation.class); + + /* + * Fully qualified name of the extended location. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Type of the extended location. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the name property: Fully qualified name of the extended location. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Fully qualified name of the extended location. + * + * @param name the name value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Type of the extended location. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of the extended location. + * + * @param type the type value to set. + * @return the ExtendedLocation object itself. + */ + public ExtendedLocation withType(String type) { + this.type = type; + 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/ExtensionTopic.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ExtensionTopic.java new file mode 100644 index 0000000000000..c8e699fb0c107 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ExtensionTopic.java @@ -0,0 +1,52 @@ +// 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.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 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 0000000000000..3277558d86aa5 --- /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/HybridConnectionEventSubscriptionDestination.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/HybridConnectionEventSubscriptionDestination.java index 8baa600dbe0ba..65a78a6b6c609 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/HybridConnectionEventSubscriptionDestination.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/HybridConnectionEventSubscriptionDestination.java @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; /** Information about the HybridConnection destination for an event subscription. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType") @@ -28,6 +29,12 @@ public class HybridConnectionEventSubscriptionDestination extends EventSubscript @JsonProperty(value = "properties.resourceId") private String resourceId; + /* + * Delivery attribute details. + */ + @JsonProperty(value = "properties.deliveryAttributeMappings") + private List deliveryAttributeMappings; + /** * Get the resourceId property: The Azure Resource ID of an hybrid connection that is the destination of an event * subscription. @@ -50,6 +57,27 @@ public HybridConnectionEventSubscriptionDestination withResourceId(String resour return this; } + /** + * Get the deliveryAttributeMappings property: Delivery attribute details. + * + * @return the deliveryAttributeMappings value. + */ + public List deliveryAttributeMappings() { + return this.deliveryAttributeMappings; + } + + /** + * Set the deliveryAttributeMappings property: Delivery attribute details. + * + * @param deliveryAttributeMappings the deliveryAttributeMappings value to set. + * @return the HybridConnectionEventSubscriptionDestination object itself. + */ + public HybridConnectionEventSubscriptionDestination withDeliveryAttributeMappings( + List deliveryAttributeMappings) { + this.deliveryAttributeMappings = deliveryAttributeMappings; + return this; + } + /** * Validates the instance. * @@ -58,5 +86,8 @@ public HybridConnectionEventSubscriptionDestination withResourceId(String resour @Override public void validate() { super.validate(); + if (deliveryAttributeMappings() != null) { + deliveryAttributeMappings().forEach(e -> e.validate()); + } } } diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/IdentityInfo.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/IdentityInfo.java new file mode 100644 index 0000000000000..ac55edd4de993 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/IdentityInfo.java @@ -0,0 +1,152 @@ +// 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; +import java.util.Map; + +/** The identity information for the resource. */ +@Fluent +public final class IdentityInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IdentityInfo.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 IdentityType type; + + /* + * The principal ID of resource identity. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /* + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /* + * The list of user identities associated with the resource. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * This property is currently not used and reserved for future usage. + */ + @JsonProperty(value = "userAssignedIdentities") + private Map userAssignedIdentities; + + /** + * 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 IdentityType 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 IdentityInfo object itself. + */ + public IdentityInfo withType(IdentityType type) { + this.type = type; + return this; + } + + /** + * Get the principalId property: The principal ID of resource identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principal ID of resource identity. + * + * @param principalId the principalId value to set. + * @return the IdentityInfo object itself. + */ + public IdentityInfo withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the tenantId property: The tenant ID of resource. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenant ID of resource. + * + * @param tenantId the tenantId value to set. + * @return the IdentityInfo object itself. + */ + public IdentityInfo withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the userAssignedIdentities property: The list of user identities associated with the resource. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * This property is currently not used and reserved for future usage. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The list of user identities associated with the resource. The user + * identity dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * This property is currently not used and reserved for future usage. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the IdentityInfo object itself. + */ + public IdentityInfo withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/IdentityType.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/IdentityType.java new file mode 100644 index 0000000000000..14520a490821d --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/IdentityType.java @@ -0,0 +1,40 @@ +// 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 IdentityType. */ +public final class IdentityType extends ExpandableStringEnum { + /** Static value None for IdentityType. */ + public static final IdentityType NONE = fromString("None"); + + /** Static value SystemAssigned for IdentityType. */ + public static final IdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for IdentityType. */ + public static final IdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value SystemAssigned, UserAssigned for IdentityType. */ + public static final IdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = fromString("SystemAssigned, UserAssigned"); + + /** + * Creates or finds a IdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IdentityType. + */ + @JsonCreator + public static IdentityType fromString(String name) { + return fromString(name, IdentityType.class); + } + + /** @return known IdentityType values. */ + public static Collection values() { + return values(IdentityType.class); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/IsNotNullAdvancedFilter.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/IsNotNullAdvancedFilter.java new file mode 100644 index 0000000000000..ed62b35f75e3e --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/IsNotNullAdvancedFilter.java @@ -0,0 +1,36 @@ +// 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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** IsNotNull Advanced Filter. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType") +@JsonTypeName("IsNotNull") +@Immutable +public final class IsNotNullAdvancedFilter extends AdvancedFilter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IsNotNullAdvancedFilter.class); + + /** {@inheritDoc} */ + @Override + public IsNotNullAdvancedFilter withKey(String key) { + super.withKey(key); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/IsNullOrUndefinedAdvancedFilter.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/IsNullOrUndefinedAdvancedFilter.java new file mode 100644 index 0000000000000..ab54bad89443e --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/IsNullOrUndefinedAdvancedFilter.java @@ -0,0 +1,36 @@ +// 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.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** IsNullOrUndefined Advanced Filter. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType") +@JsonTypeName("IsNullOrUndefined") +@Immutable +public final class IsNullOrUndefinedAdvancedFilter extends AdvancedFilter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IsNullOrUndefinedAdvancedFilter.class); + + /** {@inheritDoc} */ + @Override + public IsNullOrUndefinedAdvancedFilter withKey(String key) { + super.withKey(key); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/NumberInRangeAdvancedFilter.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/NumberInRangeAdvancedFilter.java new file mode 100644 index 0000000000000..866d381321df6 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/NumberInRangeAdvancedFilter.java @@ -0,0 +1,64 @@ +// 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; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** NumberInRange Advanced Filter. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType") +@JsonTypeName("NumberInRange") +@Fluent +public final class NumberInRangeAdvancedFilter extends AdvancedFilter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NumberInRangeAdvancedFilter.class); + + /* + * The set of filter values. + */ + @JsonProperty(value = "values") + private List> values; + + /** + * Get the values property: The set of filter values. + * + * @return the values value. + */ + public List> values() { + return this.values; + } + + /** + * Set the values property: The set of filter values. + * + * @param values the values value to set. + * @return the NumberInRangeAdvancedFilter object itself. + */ + public NumberInRangeAdvancedFilter withValues(List> values) { + this.values = values; + return this; + } + + /** {@inheritDoc} */ + @Override + public NumberInRangeAdvancedFilter withKey(String key) { + super.withKey(key); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/NumberNotInRangeAdvancedFilter.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/NumberNotInRangeAdvancedFilter.java new file mode 100644 index 0000000000000..f41c23ec7d6aa --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/NumberNotInRangeAdvancedFilter.java @@ -0,0 +1,64 @@ +// 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; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** NumberNotInRange Advanced Filter. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType") +@JsonTypeName("NumberNotInRange") +@Fluent +public final class NumberNotInRangeAdvancedFilter extends AdvancedFilter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NumberNotInRangeAdvancedFilter.class); + + /* + * The set of filter values. + */ + @JsonProperty(value = "values") + private List> values; + + /** + * Get the values property: The set of filter values. + * + * @return the values value. + */ + public List> values() { + return this.values; + } + + /** + * Set the values property: The set of filter values. + * + * @param values the values value to set. + * @return the NumberNotInRangeAdvancedFilter object itself. + */ + public NumberNotInRangeAdvancedFilter withValues(List> values) { + this.values = values; + return this; + } + + /** {@inheritDoc} */ + @Override + public NumberNotInRangeAdvancedFilter withKey(String key) { + super.withKey(key); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/Operation.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/Operation.java index 6329702cf9cae..2cce74ea70934 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/Operation.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/Operation.java @@ -29,6 +29,13 @@ public interface Operation { */ String origin(); + /** + * Gets the isDataAction property: This Boolean is used to determine if the operation is a data plane action or not. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + /** * Gets the properties property: Properties of the operation. * diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerNamespace.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerNamespace.java new file mode 100644 index 0000000000000..d16f494675723 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerNamespace.java @@ -0,0 +1,414 @@ +// 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.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventgrid.fluent.models.PartnerNamespaceInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of PartnerNamespace. */ +public interface PartnerNamespace { + /** + * 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 location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: The system metadata relating to Partner Namespace resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the privateEndpointConnections property: The privateEndpointConnections property. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the provisioningState property: Provisioning state of the partner namespace. + * + * @return the provisioningState value. + */ + PartnerNamespaceProvisioningState provisioningState(); + + /** + * Gets the partnerRegistrationFullyQualifiedId property: The fully qualified ARM Id of the partner registration + * that should be associated with this partner namespace. This takes the following format: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}. + * + * @return the partnerRegistrationFullyQualifiedId value. + */ + String partnerRegistrationFullyQualifiedId(); + + /** + * Gets the endpoint property: Endpoint for the partner namespace. + * + * @return the endpoint value. + */ + String endpoint(); + + /** + * Gets the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it + * is enabled. You can further restrict to specific IPs by configuring <seealso + * cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.PartnerNamespaceProperties.InboundIpRules" + * />. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * Gets the inboundIpRules property: This can be used to restrict traffic from specific IPs instead of all IPs. + * Note: These are considered only if PublicNetworkAccess is enabled. + * + * @return the inboundIpRules value. + */ + List inboundIpRules(); + + /** + * Gets the disableLocalAuth property: This boolean is used to enable or disable local auth. Default value is false. + * When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to + * the partner namespace. + * + * @return the disableLocalAuth value. + */ + Boolean disableLocalAuth(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.eventgrid.fluent.models.PartnerNamespaceInner object. + * + * @return the inner object. + */ + PartnerNamespaceInner innerModel(); + + /** The entirety of the PartnerNamespace definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The PartnerNamespace definition stages. */ + interface DefinitionStages { + /** The first stage of the PartnerNamespace definition. */ + interface Blank extends WithLocation { + } + /** The stage of the PartnerNamespace definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the PartnerNamespace definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the PartnerNamespace definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithPartnerRegistrationFullyQualifiedId, + DefinitionStages.WithPublicNetworkAccess, + DefinitionStages.WithInboundIpRules, + DefinitionStages.WithDisableLocalAuth { + /** + * Executes the create request. + * + * @return the created resource. + */ + PartnerNamespace create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PartnerNamespace create(Context context); + } + /** The stage of the PartnerNamespace definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the PartnerNamespace definition allowing to specify partnerRegistrationFullyQualifiedId. */ + interface WithPartnerRegistrationFullyQualifiedId { + /** + * Specifies the partnerRegistrationFullyQualifiedId property: The fully qualified ARM Id of the partner + * registration that should be associated with this partner namespace. This takes the following format: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}.. + * + * @param partnerRegistrationFullyQualifiedId The fully qualified ARM Id of the partner registration that + * should be associated with this partner namespace. This takes the following format: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}. + * @return the next definition stage. + */ + WithCreate withPartnerRegistrationFullyQualifiedId(String partnerRegistrationFullyQualifiedId); + } + /** The stage of the PartnerNamespace definition allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: This determines if traffic is allowed over public network. By + * default it is enabled. You can further restrict to specific IPs by configuring <seealso + * cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.PartnerNamespaceProperties" + + ".InboundIpRules" + * />. + * + * @param publicNetworkAccess This determines if traffic is allowed over public network. By default it is + * enabled. You can further restrict to specific IPs by configuring <seealso + * cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.PartnerNamespaceProperties" + + ".InboundIpRules" + * />. + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + /** The stage of the PartnerNamespace definition allowing to specify inboundIpRules. */ + interface WithInboundIpRules { + /** + * Specifies the inboundIpRules property: This can be used to restrict traffic from specific IPs instead of + * all IPs. Note: These are considered only if PublicNetworkAccess is enabled.. + * + * @param inboundIpRules This can be used to restrict traffic from specific IPs instead of all IPs. Note: + * These are considered only if PublicNetworkAccess is enabled. + * @return the next definition stage. + */ + WithCreate withInboundIpRules(List inboundIpRules); + } + /** The stage of the PartnerNamespace definition allowing to specify disableLocalAuth. */ + interface WithDisableLocalAuth { + /** + * Specifies the disableLocalAuth property: This boolean is used to enable or disable local auth. Default + * value is false. When the property is set to true, only AAD token will be used to authenticate if user is + * allowed to publish to the partner namespace.. + * + * @param disableLocalAuth This boolean is used to enable or disable local auth. Default value is false. + * When the property is set to true, only AAD token will be used to authenticate if user is allowed to + * publish to the partner namespace. + * @return the next definition stage. + */ + WithCreate withDisableLocalAuth(Boolean disableLocalAuth); + } + } + /** + * Begins update for the PartnerNamespace resource. + * + * @return the stage of resource update. + */ + PartnerNamespace.Update update(); + + /** The template for PartnerNamespace update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithPublicNetworkAccess, + UpdateStages.WithInboundIpRules, + UpdateStages.WithDisableLocalAuth { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PartnerNamespace apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PartnerNamespace apply(Context context); + } + /** The PartnerNamespace update stages. */ + interface UpdateStages { + /** The stage of the PartnerNamespace update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Tags of the partner namespace.. + * + * @param tags Tags of the partner namespace. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the PartnerNamespace update allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: This determines if traffic is allowed over public network. By + * default it is enabled. You can further restrict to specific IPs by configuring <seealso + * cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts" + + ".PartnerNamespaceUpdateParameterProperties.InboundIpRules" + * />. + * + * @param publicNetworkAccess This determines if traffic is allowed over public network. By default it is + * enabled. You can further restrict to specific IPs by configuring <seealso + * cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts" + + ".PartnerNamespaceUpdateParameterProperties.InboundIpRules" + * />. + * @return the next definition stage. + */ + Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + /** The stage of the PartnerNamespace update allowing to specify inboundIpRules. */ + interface WithInboundIpRules { + /** + * Specifies the inboundIpRules property: This can be used to restrict traffic from specific IPs instead of + * all IPs. Note: These are considered only if PublicNetworkAccess is enabled.. + * + * @param inboundIpRules This can be used to restrict traffic from specific IPs instead of all IPs. Note: + * These are considered only if PublicNetworkAccess is enabled. + * @return the next definition stage. + */ + Update withInboundIpRules(List inboundIpRules); + } + /** The stage of the PartnerNamespace update allowing to specify disableLocalAuth. */ + interface WithDisableLocalAuth { + /** + * Specifies the disableLocalAuth property: This boolean is used to enable or disable local auth. Default + * value is false. When the property is set to true, only AAD token will be used to authenticate if user is + * allowed to publish to the partner namespace.. + * + * @param disableLocalAuth This boolean is used to enable or disable local auth. Default value is false. + * When the property is set to true, only AAD token will be used to authenticate if user is allowed to + * publish to the partner namespace. + * @return the next definition stage. + */ + Update withDisableLocalAuth(Boolean disableLocalAuth); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PartnerNamespace refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PartnerNamespace refresh(Context context); + + /** + * List the two keys used to publish to a partner namespace. + * + * @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 shared access keys of the partner namespace. + */ + PartnerNamespaceSharedAccessKeys listSharedAccessKeys(); + + /** + * List the two keys used to publish to a partner namespace. + * + * @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 shared access keys of the partner namespace. + */ + Response listSharedAccessKeysWithResponse(Context context); + + /** + * Regenerate a shared access key for a partner namespace. + * + * @param regenerateKeyRequest Request body to regenerate key. + * @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 shared access keys of the partner namespace. + */ + PartnerNamespaceSharedAccessKeys regenerateKey(PartnerNamespaceRegenerateKeyRequest regenerateKeyRequest); + + /** + * Regenerate a shared access key for a partner namespace. + * + * @param regenerateKeyRequest Request body to regenerate key. + * @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 shared access keys of the partner namespace. + */ + Response regenerateKeyWithResponse( + PartnerNamespaceRegenerateKeyRequest regenerateKeyRequest, Context context); +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerNamespaceProvisioningState.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerNamespaceProvisioningState.java new file mode 100644 index 0000000000000..86d18e75ae2ae --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerNamespaceProvisioningState.java @@ -0,0 +1,46 @@ +// 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 PartnerNamespaceProvisioningState. */ +public final class PartnerNamespaceProvisioningState extends ExpandableStringEnum { + /** Static value Creating for PartnerNamespaceProvisioningState. */ + public static final PartnerNamespaceProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for PartnerNamespaceProvisioningState. */ + public static final PartnerNamespaceProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for PartnerNamespaceProvisioningState. */ + public static final PartnerNamespaceProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for PartnerNamespaceProvisioningState. */ + public static final PartnerNamespaceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for PartnerNamespaceProvisioningState. */ + public static final PartnerNamespaceProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Failed for PartnerNamespaceProvisioningState. */ + public static final PartnerNamespaceProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a PartnerNamespaceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PartnerNamespaceProvisioningState. + */ + @JsonCreator + public static PartnerNamespaceProvisioningState fromString(String name) { + return fromString(name, PartnerNamespaceProvisioningState.class); + } + + /** @return known PartnerNamespaceProvisioningState values. */ + public static Collection values() { + return values(PartnerNamespaceProvisioningState.class); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerNamespaceRegenerateKeyRequest.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerNamespaceRegenerateKeyRequest.java new file mode 100644 index 0000000000000..330ceb81b7f38 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerNamespaceRegenerateKeyRequest.java @@ -0,0 +1,56 @@ +// 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; + +/** PartnerNamespace regenerate shared access key request. */ +@Fluent +public final class PartnerNamespaceRegenerateKeyRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PartnerNamespaceRegenerateKeyRequest.class); + + /* + * Key name to regenerate (key1 or key2). + */ + @JsonProperty(value = "keyName", required = true) + private String keyName; + + /** + * Get the keyName property: Key name to regenerate (key1 or key2). + * + * @return the keyName value. + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the keyName property: Key name to regenerate (key1 or key2). + * + * @param keyName the keyName value to set. + * @return the PartnerNamespaceRegenerateKeyRequest object itself. + */ + public PartnerNamespaceRegenerateKeyRequest withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyName in model PartnerNamespaceRegenerateKeyRequest")); + } + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerNamespaceSharedAccessKeys.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerNamespaceSharedAccessKeys.java new file mode 100644 index 0000000000000..775005d06bca9 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerNamespaceSharedAccessKeys.java @@ -0,0 +1,31 @@ +// 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.resourcemanager.eventgrid.fluent.models.PartnerNamespaceSharedAccessKeysInner; + +/** An immutable client-side representation of PartnerNamespaceSharedAccessKeys. */ +public interface PartnerNamespaceSharedAccessKeys { + /** + * Gets the key1 property: Shared access key1 for the partner namespace. + * + * @return the key1 value. + */ + String key1(); + + /** + * Gets the key2 property: Shared access key2 for the partner namespace. + * + * @return the key2 value. + */ + String key2(); + + /** + * Gets the inner com.azure.resourcemanager.eventgrid.fluent.models.PartnerNamespaceSharedAccessKeysInner object. + * + * @return the inner object. + */ + PartnerNamespaceSharedAccessKeysInner innerModel(); +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerNamespaceUpdateParameters.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerNamespaceUpdateParameters.java new file mode 100644 index 0000000000000..634558f243a4e --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerNamespaceUpdateParameters.java @@ -0,0 +1,157 @@ +// 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.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Properties of the PartnerNamespace update. */ +@JsonFlatten +@Fluent +public class PartnerNamespaceUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PartnerNamespaceUpdateParameters.class); + + /* + * Tags of the partner namespace. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * This determines if traffic is allowed over public network. By default it + * is enabled. + * You can further restrict to specific IPs by configuring + */ + @JsonProperty(value = "properties.publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * This can be used to restrict traffic from specific IPs instead of all + * IPs. Note: These are considered only if PublicNetworkAccess is enabled. + */ + @JsonProperty(value = "properties.inboundIpRules") + private List inboundIpRules; + + /* + * This boolean is used to enable or disable local auth. Default value is + * false. When the property is set to true, only AAD token will be used to + * authenticate if user is allowed to publish to the partner namespace. + */ + @JsonProperty(value = "properties.disableLocalAuth") + private Boolean disableLocalAuth; + + /** + * Get the tags property: Tags of the partner namespace. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Tags of the partner namespace. + * + * @param tags the tags value to set. + * @return the PartnerNamespaceUpdateParameters object itself. + */ + public PartnerNamespaceUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is + * enabled. You can further restrict to specific IPs by configuring <seealso + * cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.PartnerNamespaceUpdateParameterProperties" + + ".InboundIpRules" + * />. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is + * enabled. You can further restrict to specific IPs by configuring <seealso + * cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.PartnerNamespaceUpdateParameterProperties" + + ".InboundIpRules" + * />. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the PartnerNamespaceUpdateParameters object itself. + */ + public PartnerNamespaceUpdateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the inboundIpRules property: This can be used to restrict traffic from specific IPs instead of all IPs. Note: + * These are considered only if PublicNetworkAccess is enabled. + * + * @return the inboundIpRules value. + */ + public List inboundIpRules() { + return this.inboundIpRules; + } + + /** + * Set the inboundIpRules property: This can be used to restrict traffic from specific IPs instead of all IPs. Note: + * These are considered only if PublicNetworkAccess is enabled. + * + * @param inboundIpRules the inboundIpRules value to set. + * @return the PartnerNamespaceUpdateParameters object itself. + */ + public PartnerNamespaceUpdateParameters withInboundIpRules(List inboundIpRules) { + this.inboundIpRules = inboundIpRules; + return this; + } + + /** + * Get the disableLocalAuth property: This boolean is used to enable or disable local auth. Default value is false. + * When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to + * the partner namespace. + * + * @return the disableLocalAuth value. + */ + public Boolean disableLocalAuth() { + return this.disableLocalAuth; + } + + /** + * Set the disableLocalAuth property: This boolean is used to enable or disable local auth. Default value is false. + * When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to + * the partner namespace. + * + * @param disableLocalAuth the disableLocalAuth value to set. + * @return the PartnerNamespaceUpdateParameters object itself. + */ + public PartnerNamespaceUpdateParameters withDisableLocalAuth(Boolean disableLocalAuth) { + this.disableLocalAuth = disableLocalAuth; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (inboundIpRules() != null) { + inboundIpRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerNamespaces.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerNamespaces.java new file mode 100644 index 0000000000000..5a6975734621c --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerNamespaces.java @@ -0,0 +1,233 @@ +// 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.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PartnerNamespaces. */ +public interface PartnerNamespaces { + /** + * Get properties of a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 properties of a partner namespace. + */ + PartnerNamespace getByResourceGroup(String resourceGroupName, String partnerNamespaceName); + + /** + * Get properties of a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 properties of a partner namespace. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String partnerNamespaceName, Context context); + + /** + * Delete existing partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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. + */ + void deleteByResourceGroup(String resourceGroupName, String partnerNamespaceName); + + /** + * Delete existing partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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. + */ + void delete(String resourceGroupName, String partnerNamespaceName, Context context); + + /** + * List all the partner namespaces under an Azure subscription. + * + * @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 result of the List Partner Namespaces operation. + */ + PagedIterable list(); + + /** + * List all the partner namespaces under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Namespaces operation. + */ + PagedIterable list(String filter, Integer top, Context context); + + /** + * List all the partner namespaces under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 result of the List Partner Namespaces operation. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all the partner namespaces under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Namespaces operation. + */ + PagedIterable listByResourceGroup( + String resourceGroupName, String filter, Integer top, Context context); + + /** + * List the two keys used to publish to a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 shared access keys of the partner namespace. + */ + PartnerNamespaceSharedAccessKeys listSharedAccessKeys(String resourceGroupName, String partnerNamespaceName); + + /** + * List the two keys used to publish to a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @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 shared access keys of the partner namespace. + */ + Response listSharedAccessKeysWithResponse( + String resourceGroupName, String partnerNamespaceName, Context context); + + /** + * Regenerate a shared access key for a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param regenerateKeyRequest Request body to regenerate key. + * @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 shared access keys of the partner namespace. + */ + PartnerNamespaceSharedAccessKeys regenerateKey( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceRegenerateKeyRequest regenerateKeyRequest); + + /** + * Regenerate a shared access key for a partner namespace. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerNamespaceName Name of the partner namespace. + * @param regenerateKeyRequest Request body to regenerate key. + * @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 shared access keys of the partner namespace. + */ + Response regenerateKeyWithResponse( + String resourceGroupName, + String partnerNamespaceName, + PartnerNamespaceRegenerateKeyRequest regenerateKeyRequest, + Context context); + + /** + * Get properties of a partner namespace. + * + * @param id the resource ID. + * @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 properties of a partner namespace. + */ + PartnerNamespace getById(String id); + + /** + * Get properties of a partner namespace. + * + * @param id the resource ID. + * @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 properties of a partner namespace. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete existing partner namespace. + * + * @param id the resource ID. + * @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. + */ + void deleteById(String id); + + /** + * Delete existing partner namespace. + * + * @param id the resource ID. + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PartnerNamespace resource. + * + * @param name resource name. + * @return the first stage of the new PartnerNamespace definition. + */ + PartnerNamespace.DefinitionStages.Blank define(String name); +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerNamespacesListResult.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerNamespacesListResult.java new file mode 100644 index 0000000000000..2762c2690fdc1 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerNamespacesListResult.java @@ -0,0 +1,81 @@ +// 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.azure.resourcemanager.eventgrid.fluent.models.PartnerNamespaceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Result of the List Partner Namespaces operation. */ +@Fluent +public final class PartnerNamespacesListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PartnerNamespacesListResult.class); + + /* + * A collection of partner namespaces. + */ + @JsonProperty(value = "value") + private List value; + + /* + * A link for the next page of partner namespaces. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A collection of partner namespaces. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of partner namespaces. + * + * @param value the value value to set. + * @return the PartnerNamespacesListResult object itself. + */ + public PartnerNamespacesListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: A link for the next page of partner namespaces. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: A link for the next page of partner namespaces. + * + * @param nextLink the nextLink value to set. + * @return the PartnerNamespacesListResult object itself. + */ + public PartnerNamespacesListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerRegistration.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerRegistration.java new file mode 100644 index 0000000000000..12cc6bb90d36e --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerRegistration.java @@ -0,0 +1,533 @@ +// 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.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventgrid.fluent.models.PartnerRegistrationInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of PartnerRegistration. */ +public interface PartnerRegistration { + /** + * 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 location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: The system metadata relating to Partner Registration resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the partner registration. + * + * @return the provisioningState value. + */ + PartnerRegistrationProvisioningState provisioningState(); + + /** + * Gets the partnerName property: Official name of the partner name. For example: "Contoso". + * + * @return the partnerName value. + */ + String partnerName(); + + /** + * Gets the partnerResourceTypeName property: Name of the partner resource type. + * + * @return the partnerResourceTypeName value. + */ + String partnerResourceTypeName(); + + /** + * Gets the partnerResourceTypeDisplayName property: Display name of the partner resource type. + * + * @return the partnerResourceTypeDisplayName value. + */ + String partnerResourceTypeDisplayName(); + + /** + * Gets the partnerResourceTypeDescription property: Short description of the partner resource type. The length of + * this description should not exceed 256 characters. + * + * @return the partnerResourceTypeDescription value. + */ + String partnerResourceTypeDescription(); + + /** + * Gets the longDescription property: Long description for the custom scenarios and integration to be displayed in + * the portal if needed. Length of this description should not exceed 2048 characters. + * + * @return the longDescription value. + */ + String longDescription(); + + /** + * Gets the partnerCustomerServiceNumber property: The customer service number of the publisher. The expected phone + * format should start with a '+' sign followed by the country code. The remaining digits are then followed. Only + * digits and spaces are allowed and its length cannot exceed 16 digits including country code. Examples of valid + * phone numbers are: +1 515 123 4567 and +966 7 5115 2471. Examples of invalid phone numbers are: +1 (515) + * 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 1234 43. + * + * @return the partnerCustomerServiceNumber value. + */ + String partnerCustomerServiceNumber(); + + /** + * Gets the partnerCustomerServiceExtension property: The extension of the customer service number of the publisher. + * Only digits are allowed and number of digits should not exceed 10. + * + * @return the partnerCustomerServiceExtension value. + */ + String partnerCustomerServiceExtension(); + + /** + * Gets the customerServiceUri property: The extension of the customer service URI of the publisher. + * + * @return the customerServiceUri value. + */ + String customerServiceUri(); + + /** + * Gets the setupUri property: URI of the partner website that can be used by Azure customers to setup Event Grid + * integration on an event source. + * + * @return the setupUri value. + */ + String setupUri(); + + /** + * Gets the logoUri property: URI of the logo. + * + * @return the logoUri value. + */ + String logoUri(); + + /** + * Gets the visibilityState property: Visibility state of the partner registration. + * + * @return the visibilityState value. + */ + PartnerRegistrationVisibilityState visibilityState(); + + /** + * Gets the authorizedAzureSubscriptionIds property: List of Azure subscription Ids that are authorized to create a + * partner namespace associated with this partner registration. This is an optional property. Creating partner + * namespaces is always permitted under the same Azure subscription as the one used for creating the partner + * registration. + * + * @return the authorizedAzureSubscriptionIds value. + */ + List authorizedAzureSubscriptionIds(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.eventgrid.fluent.models.PartnerRegistrationInner object. + * + * @return the inner object. + */ + PartnerRegistrationInner innerModel(); + + /** The entirety of the PartnerRegistration definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The PartnerRegistration definition stages. */ + interface DefinitionStages { + /** The first stage of the PartnerRegistration definition. */ + interface Blank extends WithLocation { + } + /** The stage of the PartnerRegistration definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the PartnerRegistration definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the PartnerRegistration definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithPartnerName, + DefinitionStages.WithPartnerResourceTypeName, + DefinitionStages.WithPartnerResourceTypeDisplayName, + DefinitionStages.WithPartnerResourceTypeDescription, + DefinitionStages.WithLongDescription, + DefinitionStages.WithPartnerCustomerServiceNumber, + DefinitionStages.WithPartnerCustomerServiceExtension, + DefinitionStages.WithCustomerServiceUri, + DefinitionStages.WithSetupUri, + DefinitionStages.WithLogoUri, + DefinitionStages.WithVisibilityState, + DefinitionStages.WithAuthorizedAzureSubscriptionIds { + /** + * Executes the create request. + * + * @return the created resource. + */ + PartnerRegistration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PartnerRegistration create(Context context); + } + /** The stage of the PartnerRegistration definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the PartnerRegistration definition allowing to specify partnerName. */ + interface WithPartnerName { + /** + * Specifies the partnerName property: Official name of the partner name. For example: "Contoso".. + * + * @param partnerName Official name of the partner name. For example: "Contoso". + * @return the next definition stage. + */ + WithCreate withPartnerName(String partnerName); + } + /** The stage of the PartnerRegistration definition allowing to specify partnerResourceTypeName. */ + interface WithPartnerResourceTypeName { + /** + * Specifies the partnerResourceTypeName property: Name of the partner resource type.. + * + * @param partnerResourceTypeName Name of the partner resource type. + * @return the next definition stage. + */ + WithCreate withPartnerResourceTypeName(String partnerResourceTypeName); + } + /** The stage of the PartnerRegistration definition allowing to specify partnerResourceTypeDisplayName. */ + interface WithPartnerResourceTypeDisplayName { + /** + * Specifies the partnerResourceTypeDisplayName property: Display name of the partner resource type.. + * + * @param partnerResourceTypeDisplayName Display name of the partner resource type. + * @return the next definition stage. + */ + WithCreate withPartnerResourceTypeDisplayName(String partnerResourceTypeDisplayName); + } + /** The stage of the PartnerRegistration definition allowing to specify partnerResourceTypeDescription. */ + interface WithPartnerResourceTypeDescription { + /** + * Specifies the partnerResourceTypeDescription property: Short description of the partner resource type. + * The length of this description should not exceed 256 characters.. + * + * @param partnerResourceTypeDescription Short description of the partner resource type. The length of this + * description should not exceed 256 characters. + * @return the next definition stage. + */ + WithCreate withPartnerResourceTypeDescription(String partnerResourceTypeDescription); + } + /** The stage of the PartnerRegistration definition allowing to specify longDescription. */ + interface WithLongDescription { + /** + * Specifies the longDescription property: Long description for the custom scenarios and integration to be + * displayed in the portal if needed. Length of this description should not exceed 2048 characters.. + * + * @param longDescription Long description for the custom scenarios and integration to be displayed in the + * portal if needed. Length of this description should not exceed 2048 characters. + * @return the next definition stage. + */ + WithCreate withLongDescription(String longDescription); + } + /** The stage of the PartnerRegistration definition allowing to specify partnerCustomerServiceNumber. */ + interface WithPartnerCustomerServiceNumber { + /** + * Specifies the partnerCustomerServiceNumber property: The customer service number of the publisher. The + * expected phone format should start with a '+' sign followed by the country code. The remaining digits are + * then followed. Only digits and spaces are allowed and its length cannot exceed 16 digits including + * country code. Examples of valid phone numbers are: +1 515 123 4567 and +966 7 5115 2471. Examples of + * invalid phone numbers are: +1 (515) 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 1234 43. + * + * @param partnerCustomerServiceNumber The customer service number of the publisher. The expected phone + * format should start with a '+' sign followed by the country code. The remaining digits are then + * followed. Only digits and spaces are allowed and its length cannot exceed 16 digits including country + * code. Examples of valid phone numbers are: +1 515 123 4567 and +966 7 5115 2471. Examples of invalid + * phone numbers are: +1 (515) 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 1234 43. + * @return the next definition stage. + */ + WithCreate withPartnerCustomerServiceNumber(String partnerCustomerServiceNumber); + } + /** The stage of the PartnerRegistration definition allowing to specify partnerCustomerServiceExtension. */ + interface WithPartnerCustomerServiceExtension { + /** + * Specifies the partnerCustomerServiceExtension property: The extension of the customer service number of + * the publisher. Only digits are allowed and number of digits should not exceed 10.. + * + * @param partnerCustomerServiceExtension The extension of the customer service number of the publisher. + * Only digits are allowed and number of digits should not exceed 10. + * @return the next definition stage. + */ + WithCreate withPartnerCustomerServiceExtension(String partnerCustomerServiceExtension); + } + /** The stage of the PartnerRegistration definition allowing to specify customerServiceUri. */ + interface WithCustomerServiceUri { + /** + * Specifies the customerServiceUri property: The extension of the customer service URI of the publisher.. + * + * @param customerServiceUri The extension of the customer service URI of the publisher. + * @return the next definition stage. + */ + WithCreate withCustomerServiceUri(String customerServiceUri); + } + /** The stage of the PartnerRegistration definition allowing to specify setupUri. */ + interface WithSetupUri { + /** + * Specifies the setupUri property: URI of the partner website that can be used by Azure customers to setup + * Event Grid integration on an event source.. + * + * @param setupUri URI of the partner website that can be used by Azure customers to setup Event Grid + * integration on an event source. + * @return the next definition stage. + */ + WithCreate withSetupUri(String setupUri); + } + /** The stage of the PartnerRegistration definition allowing to specify logoUri. */ + interface WithLogoUri { + /** + * Specifies the logoUri property: URI of the logo.. + * + * @param logoUri URI of the logo. + * @return the next definition stage. + */ + WithCreate withLogoUri(String logoUri); + } + /** The stage of the PartnerRegistration definition allowing to specify visibilityState. */ + interface WithVisibilityState { + /** + * Specifies the visibilityState property: Visibility state of the partner registration.. + * + * @param visibilityState Visibility state of the partner registration. + * @return the next definition stage. + */ + WithCreate withVisibilityState(PartnerRegistrationVisibilityState visibilityState); + } + /** The stage of the PartnerRegistration definition allowing to specify authorizedAzureSubscriptionIds. */ + interface WithAuthorizedAzureSubscriptionIds { + /** + * Specifies the authorizedAzureSubscriptionIds property: List of Azure subscription Ids that are authorized + * to create a partner namespace associated with this partner registration. This is an optional property. + * Creating partner namespaces is always permitted under the same Azure subscription as the one used for + * creating the partner registration.. + * + * @param authorizedAzureSubscriptionIds List of Azure subscription Ids that are authorized to create a + * partner namespace associated with this partner registration. This is an optional property. Creating + * partner namespaces is always permitted under the same Azure subscription as the one used for creating + * the partner registration. + * @return the next definition stage. + */ + WithCreate withAuthorizedAzureSubscriptionIds(List authorizedAzureSubscriptionIds); + } + } + /** + * Begins update for the PartnerRegistration resource. + * + * @return the stage of resource update. + */ + PartnerRegistration.Update update(); + + /** The template for PartnerRegistration update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithPartnerTopicTypeName, + UpdateStages.WithPartnerTopicTypeDisplayName, + UpdateStages.WithPartnerTopicTypeDescription, + UpdateStages.WithSetupUri, + UpdateStages.WithLogoUri, + UpdateStages.WithAuthorizedAzureSubscriptionIds { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PartnerRegistration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PartnerRegistration apply(Context context); + } + /** The PartnerRegistration update stages. */ + interface UpdateStages { + /** The stage of the PartnerRegistration update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Tags of the partner registration resource.. + * + * @param tags Tags of the partner registration resource. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the PartnerRegistration update allowing to specify partnerTopicTypeName. */ + interface WithPartnerTopicTypeName { + /** + * Specifies the partnerTopicTypeName property: Name of the partner topic type.. + * + * @param partnerTopicTypeName Name of the partner topic type. + * @return the next definition stage. + */ + Update withPartnerTopicTypeName(String partnerTopicTypeName); + } + /** The stage of the PartnerRegistration update allowing to specify partnerTopicTypeDisplayName. */ + interface WithPartnerTopicTypeDisplayName { + /** + * Specifies the partnerTopicTypeDisplayName property: Display name of the partner topic type.. + * + * @param partnerTopicTypeDisplayName Display name of the partner topic type. + * @return the next definition stage. + */ + Update withPartnerTopicTypeDisplayName(String partnerTopicTypeDisplayName); + } + /** The stage of the PartnerRegistration update allowing to specify partnerTopicTypeDescription. */ + interface WithPartnerTopicTypeDescription { + /** + * Specifies the partnerTopicTypeDescription property: Description of the partner topic type.. + * + * @param partnerTopicTypeDescription Description of the partner topic type. + * @return the next definition stage. + */ + Update withPartnerTopicTypeDescription(String partnerTopicTypeDescription); + } + /** The stage of the PartnerRegistration update allowing to specify setupUri. */ + interface WithSetupUri { + /** + * Specifies the setupUri property: URI of the partner website that can be used by Azure customers to setup + * Event Grid integration on an event source.. + * + * @param setupUri URI of the partner website that can be used by Azure customers to setup Event Grid + * integration on an event source. + * @return the next definition stage. + */ + Update withSetupUri(String setupUri); + } + /** The stage of the PartnerRegistration update allowing to specify logoUri. */ + interface WithLogoUri { + /** + * Specifies the logoUri property: URI of the partner logo.. + * + * @param logoUri URI of the partner logo. + * @return the next definition stage. + */ + Update withLogoUri(String logoUri); + } + /** The stage of the PartnerRegistration update allowing to specify authorizedAzureSubscriptionIds. */ + interface WithAuthorizedAzureSubscriptionIds { + /** + * Specifies the authorizedAzureSubscriptionIds property: List of IDs of Azure AD applications that are + * authorized to create a partner namespace associated with this partner registration. This is an optional + * property. Creating partner namespaces is always permitted under the same Azure subscription as the one + * used for creating the partner registration.. + * + * @param authorizedAzureSubscriptionIds List of IDs of Azure AD applications that are authorized to create + * a partner namespace associated with this partner registration. This is an optional property. Creating + * partner namespaces is always permitted under the same Azure subscription as the one used for creating + * the partner registration. + * @return the next definition stage. + */ + Update withAuthorizedAzureSubscriptionIds(List authorizedAzureSubscriptionIds); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PartnerRegistration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PartnerRegistration refresh(Context context); +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerRegistrationProvisioningState.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerRegistrationProvisioningState.java new file mode 100644 index 0000000000000..2399e246721d1 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerRegistrationProvisioningState.java @@ -0,0 +1,47 @@ +// 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 PartnerRegistrationProvisioningState. */ +public final class PartnerRegistrationProvisioningState + extends ExpandableStringEnum { + /** Static value Creating for PartnerRegistrationProvisioningState. */ + public static final PartnerRegistrationProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for PartnerRegistrationProvisioningState. */ + public static final PartnerRegistrationProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for PartnerRegistrationProvisioningState. */ + public static final PartnerRegistrationProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for PartnerRegistrationProvisioningState. */ + public static final PartnerRegistrationProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for PartnerRegistrationProvisioningState. */ + public static final PartnerRegistrationProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Failed for PartnerRegistrationProvisioningState. */ + public static final PartnerRegistrationProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a PartnerRegistrationProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PartnerRegistrationProvisioningState. + */ + @JsonCreator + public static PartnerRegistrationProvisioningState fromString(String name) { + return fromString(name, PartnerRegistrationProvisioningState.class); + } + + /** @return known PartnerRegistrationProvisioningState values. */ + public static Collection values() { + return values(PartnerRegistrationProvisioningState.class); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerRegistrationUpdateParameters.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerRegistrationUpdateParameters.java new file mode 100644 index 0000000000000..08b24c9675adb --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerRegistrationUpdateParameters.java @@ -0,0 +1,225 @@ +// 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; +import java.util.List; +import java.util.Map; + +/** Properties of the Partner Registration update. */ +@Fluent +public final class PartnerRegistrationUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PartnerRegistrationUpdateParameters.class); + + /* + * Tags of the partner registration resource. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * Name of the partner topic type. + */ + @JsonProperty(value = "partnerTopicTypeName") + private String partnerTopicTypeName; + + /* + * Display name of the partner topic type. + */ + @JsonProperty(value = "partnerTopicTypeDisplayName") + private String partnerTopicTypeDisplayName; + + /* + * Description of the partner topic type. + */ + @JsonProperty(value = "partnerTopicTypeDescription") + private String partnerTopicTypeDescription; + + /* + * URI of the partner website that can be used by Azure customers to setup + * Event Grid + * integration on an event source. + */ + @JsonProperty(value = "setupUri") + private String setupUri; + + /* + * URI of the partner logo. + */ + @JsonProperty(value = "logoUri") + private String logoUri; + + /* + * List of IDs of Azure AD applications that are authorized to create a + * partner namespace + * associated with this partner registration. This is an optional property. + * Creating + * partner namespaces is always permitted under the same Azure subscription + * as the one used + * for creating the partner registration. + */ + @JsonProperty(value = "authorizedAzureSubscriptionIds") + private List authorizedAzureSubscriptionIds; + + /** + * Get the tags property: Tags of the partner registration resource. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Tags of the partner registration resource. + * + * @param tags the tags value to set. + * @return the PartnerRegistrationUpdateParameters object itself. + */ + public PartnerRegistrationUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the partnerTopicTypeName property: Name of the partner topic type. + * + * @return the partnerTopicTypeName value. + */ + public String partnerTopicTypeName() { + return this.partnerTopicTypeName; + } + + /** + * Set the partnerTopicTypeName property: Name of the partner topic type. + * + * @param partnerTopicTypeName the partnerTopicTypeName value to set. + * @return the PartnerRegistrationUpdateParameters object itself. + */ + public PartnerRegistrationUpdateParameters withPartnerTopicTypeName(String partnerTopicTypeName) { + this.partnerTopicTypeName = partnerTopicTypeName; + return this; + } + + /** + * Get the partnerTopicTypeDisplayName property: Display name of the partner topic type. + * + * @return the partnerTopicTypeDisplayName value. + */ + public String partnerTopicTypeDisplayName() { + return this.partnerTopicTypeDisplayName; + } + + /** + * Set the partnerTopicTypeDisplayName property: Display name of the partner topic type. + * + * @param partnerTopicTypeDisplayName the partnerTopicTypeDisplayName value to set. + * @return the PartnerRegistrationUpdateParameters object itself. + */ + public PartnerRegistrationUpdateParameters withPartnerTopicTypeDisplayName(String partnerTopicTypeDisplayName) { + this.partnerTopicTypeDisplayName = partnerTopicTypeDisplayName; + return this; + } + + /** + * Get the partnerTopicTypeDescription property: Description of the partner topic type. + * + * @return the partnerTopicTypeDescription value. + */ + public String partnerTopicTypeDescription() { + return this.partnerTopicTypeDescription; + } + + /** + * Set the partnerTopicTypeDescription property: Description of the partner topic type. + * + * @param partnerTopicTypeDescription the partnerTopicTypeDescription value to set. + * @return the PartnerRegistrationUpdateParameters object itself. + */ + public PartnerRegistrationUpdateParameters withPartnerTopicTypeDescription(String partnerTopicTypeDescription) { + this.partnerTopicTypeDescription = partnerTopicTypeDescription; + return this; + } + + /** + * Get the setupUri property: URI of the partner website that can be used by Azure customers to setup Event Grid + * integration on an event source. + * + * @return the setupUri value. + */ + public String setupUri() { + return this.setupUri; + } + + /** + * Set the setupUri property: URI of the partner website that can be used by Azure customers to setup Event Grid + * integration on an event source. + * + * @param setupUri the setupUri value to set. + * @return the PartnerRegistrationUpdateParameters object itself. + */ + public PartnerRegistrationUpdateParameters withSetupUri(String setupUri) { + this.setupUri = setupUri; + return this; + } + + /** + * Get the logoUri property: URI of the partner logo. + * + * @return the logoUri value. + */ + public String logoUri() { + return this.logoUri; + } + + /** + * Set the logoUri property: URI of the partner logo. + * + * @param logoUri the logoUri value to set. + * @return the PartnerRegistrationUpdateParameters object itself. + */ + public PartnerRegistrationUpdateParameters withLogoUri(String logoUri) { + this.logoUri = logoUri; + return this; + } + + /** + * Get the authorizedAzureSubscriptionIds property: List of IDs of Azure AD applications that are authorized to + * create a partner namespace associated with this partner registration. This is an optional property. Creating + * partner namespaces is always permitted under the same Azure subscription as the one used for creating the partner + * registration. + * + * @return the authorizedAzureSubscriptionIds value. + */ + public List authorizedAzureSubscriptionIds() { + return this.authorizedAzureSubscriptionIds; + } + + /** + * Set the authorizedAzureSubscriptionIds property: List of IDs of Azure AD applications that are authorized to + * create a partner namespace associated with this partner registration. This is an optional property. Creating + * partner namespaces is always permitted under the same Azure subscription as the one used for creating the partner + * registration. + * + * @param authorizedAzureSubscriptionIds the authorizedAzureSubscriptionIds value to set. + * @return the PartnerRegistrationUpdateParameters object itself. + */ + public PartnerRegistrationUpdateParameters withAuthorizedAzureSubscriptionIds( + List authorizedAzureSubscriptionIds) { + this.authorizedAzureSubscriptionIds = authorizedAzureSubscriptionIds; + 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/PartnerRegistrationVisibilityState.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerRegistrationVisibilityState.java new file mode 100644 index 0000000000000..39f93c354fbca --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerRegistrationVisibilityState.java @@ -0,0 +1,37 @@ +// 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 PartnerRegistrationVisibilityState. */ +public final class PartnerRegistrationVisibilityState extends ExpandableStringEnum { + /** Static value Hidden for PartnerRegistrationVisibilityState. */ + public static final PartnerRegistrationVisibilityState HIDDEN = fromString("Hidden"); + + /** Static value PublicPreview for PartnerRegistrationVisibilityState. */ + public static final PartnerRegistrationVisibilityState PUBLIC_PREVIEW = fromString("PublicPreview"); + + /** Static value GenerallyAvailable for PartnerRegistrationVisibilityState. */ + public static final PartnerRegistrationVisibilityState GENERALLY_AVAILABLE = fromString("GenerallyAvailable"); + + /** + * Creates or finds a PartnerRegistrationVisibilityState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PartnerRegistrationVisibilityState. + */ + @JsonCreator + public static PartnerRegistrationVisibilityState fromString(String name) { + return fromString(name, PartnerRegistrationVisibilityState.class); + } + + /** @return known PartnerRegistrationVisibilityState values. */ + public static Collection values() { + return values(PartnerRegistrationVisibilityState.class); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerRegistrations.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerRegistrations.java new file mode 100644 index 0000000000000..a070649907770 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerRegistrations.java @@ -0,0 +1,175 @@ +// 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.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PartnerRegistrations. */ +public interface PartnerRegistrations { + /** + * Gets a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @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 a partner registration with the specified parameters. + */ + PartnerRegistration getByResourceGroup(String resourceGroupName, String partnerRegistrationName); + + /** + * Gets a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @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 a partner registration with the specified parameters. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String partnerRegistrationName, Context context); + + /** + * Deletes a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @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. + */ + void deleteByResourceGroup(String resourceGroupName, String partnerRegistrationName); + + /** + * Deletes a partner registration with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerRegistrationName Name of the partner registration. + * @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 response. + */ + Response deleteWithResponse(String resourceGroupName, String partnerRegistrationName, Context context); + + /** + * List all the partner registrations under an Azure subscription. + * + * @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 result of the List Partner Registrations operation. + */ + PagedIterable list(); + + /** + * List all the partner registrations under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Registrations operation. + */ + PagedIterable list(String filter, Integer top, Context context); + + /** + * List all the partner registrations under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 result of the List Partner Registrations operation. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all the partner registrations under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Registrations operation. + */ + PagedIterable listByResourceGroup( + String resourceGroupName, String filter, Integer top, Context context); + + /** + * Gets a partner registration with the specified parameters. + * + * @param id the resource ID. + * @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 a partner registration with the specified parameters. + */ + PartnerRegistration getById(String id); + + /** + * Gets a partner registration with the specified parameters. + * + * @param id the resource ID. + * @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 a partner registration with the specified parameters. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a partner registration with the specified parameters. + * + * @param id the resource ID. + * @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. + */ + void deleteById(String id); + + /** + * Deletes a partner registration with the specified parameters. + * + * @param id the resource ID. + * @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 response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PartnerRegistration resource. + * + * @param name resource name. + * @return the first stage of the new PartnerRegistration definition. + */ + PartnerRegistration.DefinitionStages.Blank define(String name); +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerRegistrationsListResult.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerRegistrationsListResult.java new file mode 100644 index 0000000000000..b26d3e781d87e --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerRegistrationsListResult.java @@ -0,0 +1,81 @@ +// 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.azure.resourcemanager.eventgrid.fluent.models.PartnerRegistrationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Result of the List Partner Registrations operation. */ +@Fluent +public final class PartnerRegistrationsListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PartnerRegistrationsListResult.class); + + /* + * A collection of partner registrations. + */ + @JsonProperty(value = "value") + private List value; + + /* + * A link for the next page of partner registrations. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A collection of partner registrations. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of partner registrations. + * + * @param value the value value to set. + * @return the PartnerRegistrationsListResult object itself. + */ + public PartnerRegistrationsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: A link for the next page of partner registrations. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: A link for the next page of partner registrations. + * + * @param nextLink the nextLink value to set. + * @return the PartnerRegistrationsListResult object itself. + */ + public PartnerRegistrationsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopic.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopic.java new file mode 100644 index 0000000000000..c9a6b2d60b415 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopic.java @@ -0,0 +1,107 @@ +// 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.PartnerTopicInner; +import java.time.OffsetDateTime; +import java.util.Map; + +/** An immutable client-side representation of PartnerTopic. */ +public interface PartnerTopic { + /** + * 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 location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: The system metadata relating to Partner Topic resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the identity property: Identity information for the Partner Topic resource. + * + * @return the identity value. + */ + IdentityInfo identity(); + + /** + * Gets the source property: Source associated with this partner topic. This represents a unique partner resource. + * + * @return the source value. + */ + String source(); + + /** + * Gets the expirationTimeIfNotActivatedUtc property: Expiration time of the partner topic. If this timer expires + * while the partner topic is still never activated, the partner topic and corresponding event channel are deleted. + * + * @return the expirationTimeIfNotActivatedUtc value. + */ + OffsetDateTime expirationTimeIfNotActivatedUtc(); + + /** + * Gets the provisioningState property: Provisioning state of the partner topic. + * + * @return the provisioningState value. + */ + PartnerTopicProvisioningState provisioningState(); + + /** + * Gets the activationState property: Activation state of the partner topic. + * + * @return the activationState value. + */ + PartnerTopicActivationState activationState(); + + /** + * Gets the partnerTopicFriendlyDescription property: Friendly description about the topic. This can be set by the + * publisher/partner to show custom description for the customer partner topic. This will be helpful to remove any + * ambiguity of the origin of creation of the partner topic for the customer. + * + * @return the partnerTopicFriendlyDescription value. + */ + String partnerTopicFriendlyDescription(); + + /** + * Gets the inner com.azure.resourcemanager.eventgrid.fluent.models.PartnerTopicInner object. + * + * @return the inner object. + */ + PartnerTopicInner innerModel(); +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopicActivationState.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopicActivationState.java new file mode 100644 index 0000000000000..2c016bfc2dc03 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopicActivationState.java @@ -0,0 +1,37 @@ +// 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 PartnerTopicActivationState. */ +public final class PartnerTopicActivationState extends ExpandableStringEnum { + /** Static value NeverActivated for PartnerTopicActivationState. */ + public static final PartnerTopicActivationState NEVER_ACTIVATED = fromString("NeverActivated"); + + /** Static value Activated for PartnerTopicActivationState. */ + public static final PartnerTopicActivationState ACTIVATED = fromString("Activated"); + + /** Static value Deactivated for PartnerTopicActivationState. */ + public static final PartnerTopicActivationState DEACTIVATED = fromString("Deactivated"); + + /** + * Creates or finds a PartnerTopicActivationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PartnerTopicActivationState. + */ + @JsonCreator + public static PartnerTopicActivationState fromString(String name) { + return fromString(name, PartnerTopicActivationState.class); + } + + /** @return known PartnerTopicActivationState values. */ + public static Collection values() { + return values(PartnerTopicActivationState.class); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopicEventSubscriptions.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopicEventSubscriptions.java new file mode 100644 index 0000000000000..ceeb8d1db724c --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopicEventSubscriptions.java @@ -0,0 +1,248 @@ +// 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.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner; + +/** Resource collection API of PartnerTopicEventSubscriptions. */ +public interface PartnerTopicEventSubscriptions { + /** + * Get an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be found. Event subscription names must be between + * 3 and 100 characters in length and use alphanumeric letters only. + * @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 an event subscription of a partner topic. + */ + EventSubscription get(String resourceGroupName, String partnerTopicName, String eventSubscriptionName); + + /** + * Get an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be found. Event subscription names must be between + * 3 and 100 characters in length and use alphanumeric letters only. + * @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 an event subscription of a partner topic. + */ + Response getWithResponse( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context); + + /** + * Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. + * Existing event subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + EventSubscription createOrUpdate( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo); + + /** + * Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. + * Existing event subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + EventSubscription createOrUpdate( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo, + Context context); + + /** + * Delete an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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. + */ + void delete(String resourceGroupName, String partnerTopicName, String eventSubscriptionName); + + /** + * Delete an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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. + */ + void delete(String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context); + + /** + * Update event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + EventSubscription update( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters); + + /** + * Update event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + EventSubscription update( + String resourceGroupName, + String partnerTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, + Context context); + + /** + * Get the full endpoint URL for an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 full endpoint URL for an event subscription of a partner topic. + */ + EventSubscriptionFullUrl getFullUrl( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName); + + /** + * Get the full endpoint URL for an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 full endpoint URL for an event subscription of a partner topic. + */ + Response getFullUrlWithResponse( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context); + + /** + * List event subscriptions that belong to a specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 result of the List EventSubscriptions operation. + */ + PagedIterable listByPartnerTopic(String resourceGroupName, String partnerTopicName); + + /** + * List event subscriptions that belong to a specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List EventSubscriptions operation. + */ + PagedIterable listByPartnerTopic( + String resourceGroupName, String partnerTopicName, String filter, Integer top, Context context); + + /** + * Get all delivery attributes for an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 all delivery attributes for an event subscription of a partner topic. + */ + DeliveryAttributeListResult getDeliveryAttributes( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName); + + /** + * Get all delivery attributes for an event subscription of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 all delivery attributes for an event subscription of a partner topic. + */ + Response getDeliveryAttributesWithResponse( + String resourceGroupName, String partnerTopicName, String eventSubscriptionName, Context context); +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopicProvisioningState.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopicProvisioningState.java new file mode 100644 index 0000000000000..7afe064aefdda --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopicProvisioningState.java @@ -0,0 +1,46 @@ +// 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 PartnerTopicProvisioningState. */ +public final class PartnerTopicProvisioningState extends ExpandableStringEnum { + /** Static value Creating for PartnerTopicProvisioningState. */ + public static final PartnerTopicProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for PartnerTopicProvisioningState. */ + public static final PartnerTopicProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for PartnerTopicProvisioningState. */ + public static final PartnerTopicProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for PartnerTopicProvisioningState. */ + public static final PartnerTopicProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Canceled for PartnerTopicProvisioningState. */ + public static final PartnerTopicProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Failed for PartnerTopicProvisioningState. */ + public static final PartnerTopicProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a PartnerTopicProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PartnerTopicProvisioningState. + */ + @JsonCreator + public static PartnerTopicProvisioningState fromString(String name) { + return fromString(name, PartnerTopicProvisioningState.class); + } + + /** @return known PartnerTopicProvisioningState values. */ + public static Collection values() { + return values(PartnerTopicProvisioningState.class); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopicReadinessState.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopicReadinessState.java new file mode 100644 index 0000000000000..019f4d6285b16 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopicReadinessState.java @@ -0,0 +1,40 @@ +// 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 PartnerTopicReadinessState. */ +public final class PartnerTopicReadinessState extends ExpandableStringEnum { + /** Static value NotActivatedByUserYet for PartnerTopicReadinessState. */ + public static final PartnerTopicReadinessState NOT_ACTIVATED_BY_USER_YET = fromString("NotActivatedByUserYet"); + + /** Static value ActivatedByUser for PartnerTopicReadinessState. */ + public static final PartnerTopicReadinessState ACTIVATED_BY_USER = fromString("ActivatedByUser"); + + /** Static value DeactivatedByUser for PartnerTopicReadinessState. */ + public static final PartnerTopicReadinessState DEACTIVATED_BY_USER = fromString("DeactivatedByUser"); + + /** Static value DeletedByUser for PartnerTopicReadinessState. */ + public static final PartnerTopicReadinessState DELETED_BY_USER = fromString("DeletedByUser"); + + /** + * Creates or finds a PartnerTopicReadinessState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PartnerTopicReadinessState. + */ + @JsonCreator + public static PartnerTopicReadinessState fromString(String name) { + return fromString(name, PartnerTopicReadinessState.class); + } + + /** @return known PartnerTopicReadinessState values. */ + public static Collection values() { + return values(PartnerTopicReadinessState.class); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopicUpdateParameters.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopicUpdateParameters.java new file mode 100644 index 0000000000000..b9e761b01cfe6 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopicUpdateParameters.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; +import java.util.Map; + +/** Properties of the Partner Topic update. */ +@Fluent +public final class PartnerTopicUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PartnerTopicUpdateParameters.class); + + /* + * Tags of the Partner Topic resource. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * Identity information for the Partner Topic resource. + */ + @JsonProperty(value = "identity") + private IdentityInfo identity; + + /** + * Get the tags property: Tags of the Partner Topic resource. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Tags of the Partner Topic resource. + * + * @param tags the tags value to set. + * @return the PartnerTopicUpdateParameters object itself. + */ + public PartnerTopicUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity property: Identity information for the Partner Topic resource. + * + * @return the identity value. + */ + public IdentityInfo identity() { + return this.identity; + } + + /** + * Set the identity property: Identity information for the Partner Topic resource. + * + * @param identity the identity value to set. + * @return the PartnerTopicUpdateParameters object itself. + */ + public PartnerTopicUpdateParameters withIdentity(IdentityInfo identity) { + this.identity = identity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopics.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopics.java new file mode 100644 index 0000000000000..924f4d20a810d --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopics.java @@ -0,0 +1,203 @@ +// 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.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PartnerTopics. */ +public interface PartnerTopics { + /** + * Get properties of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 properties of a partner topic. + */ + PartnerTopic getByResourceGroup(String resourceGroupName, String partnerTopicName); + + /** + * Get properties of a partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 properties of a partner topic. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String partnerTopicName, Context context); + + /** + * Delete existing partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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. + */ + void deleteByResourceGroup(String resourceGroupName, String partnerTopicName); + + /** + * Delete existing partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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. + */ + void delete(String resourceGroupName, String partnerTopicName, Context context); + + /** + * Asynchronously updates a partner topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param partnerTopicUpdateParameters PartnerTopic update information. + * @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 response. + */ + PartnerTopic update( + String resourceGroupName, String partnerTopicName, PartnerTopicUpdateParameters partnerTopicUpdateParameters); + + /** + * Asynchronously updates a partner topic with the specified parameters. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @param partnerTopicUpdateParameters PartnerTopic update information. + * @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 response. + */ + Response updateWithResponse( + String resourceGroupName, + String partnerTopicName, + PartnerTopicUpdateParameters partnerTopicUpdateParameters, + Context context); + + /** + * List all the partner topics under an Azure subscription. + * + * @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 result of the List Partner Topics operation. + */ + PagedIterable list(); + + /** + * List all the partner topics under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Topics operation. + */ + PagedIterable list(String filter, Integer top, Context context); + + /** + * List all the partner topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 result of the List Partner Topics operation. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all the partner topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List Partner Topics operation. + */ + PagedIterable listByResourceGroup( + String resourceGroupName, String filter, Integer top, Context context); + + /** + * Activate a newly created partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 eventGrid Partner Topic. + */ + PartnerTopic activate(String resourceGroupName, String partnerTopicName); + + /** + * Activate a newly created partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 eventGrid Partner Topic. + */ + Response activateWithResponse(String resourceGroupName, String partnerTopicName, Context context); + + /** + * Deactivate specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 eventGrid Partner Topic. + */ + PartnerTopic deactivate(String resourceGroupName, String partnerTopicName); + + /** + * Deactivate specific partner topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param partnerTopicName Name of the partner topic. + * @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 eventGrid Partner Topic. + */ + Response deactivateWithResponse(String resourceGroupName, String partnerTopicName, Context context); +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopicsListResult.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopicsListResult.java new file mode 100644 index 0000000000000..f9b5344c61106 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PartnerTopicsListResult.java @@ -0,0 +1,81 @@ +// 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.azure.resourcemanager.eventgrid.fluent.models.PartnerTopicInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Result of the List Partner Topics operation. */ +@Fluent +public final class PartnerTopicsListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PartnerTopicsListResult.class); + + /* + * A collection of partner topics. + */ + @JsonProperty(value = "value") + private List value; + + /* + * A link for the next page of partner topics. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A collection of partner topics. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of partner topics. + * + * @param value the value value to set. + * @return the PartnerTopicsListResult object itself. + */ + public PartnerTopicsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: A link for the next page of partner topics. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: A link for the next page of partner topics. + * + * @param nextLink the nextLink value to set. + * @return the PartnerTopicsListResult object itself. + */ + public PartnerTopicsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PrivateEndpointConnections.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PrivateEndpointConnections.java index 00df7a503ede1..6d294d392eb79 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PrivateEndpointConnections.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PrivateEndpointConnections.java @@ -12,16 +12,18 @@ /** Resource collection API of PrivateEndpointConnections. */ public interface PrivateEndpointConnections { /** - * Get a specific private endpoint connection under a topic or domain. + * Get a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @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 a specific private endpoint connection under a topic or domain. + * @return a specific private endpoint connection under a topic, domain, or partner namespace. */ PrivateEndpointConnection get( String resourceGroupName, @@ -30,17 +32,19 @@ PrivateEndpointConnection get( String privateEndpointConnectionName); /** - * Get a specific private endpoint connection under a topic or domain. + * Get a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @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 a specific private endpoint connection under a topic or domain. + * @return a specific private endpoint connection under a topic, domain, or partner namespace. */ Response getWithResponse( String resourceGroupName, @@ -50,11 +54,13 @@ Response getWithResponse( Context context); /** - * Update a specific private endpoint connection under a topic or domain. + * Update a specific private endpoint connection under a topic, domain or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param privateEndpointConnection The private endpoint connection object to update. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -70,11 +76,13 @@ PrivateEndpointConnection update( PrivateEndpointConnectionInner privateEndpointConnection); /** - * Update a specific private endpoint connection under a topic or domain. + * Update a specific private endpoint connection under a topic, domain or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param privateEndpointConnection The private endpoint connection object to update. * @param context The context to associate with this operation. @@ -92,11 +100,13 @@ PrivateEndpointConnection update( Context context); /** - * Delete a specific private endpoint connection under a topic or domain. + * Delete a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -109,11 +119,13 @@ void delete( String privateEndpointConnectionName); /** - * Delete a specific private endpoint connection under a topic or domain. + * Delete a specific private endpoint connection under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateEndpointConnectionName The name of the private endpoint connection connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -128,25 +140,29 @@ void delete( Context context); /** - * Get all private endpoint connections under a topic or domain. + * Get all private endpoint connections under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @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 all private endpoint connections under a topic or domain. + * @return all private endpoint connections under a topic, domain, or partner namespace. */ PagedIterable listByResource( String resourceGroupName, PrivateEndpointConnectionsParentType parentType, String parentName); /** - * Get all private endpoint connections under a topic or domain. + * Get all private endpoint connections under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the * 'name' property only and with limited number of OData operations. These operations are: the 'contains' * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). @@ -159,7 +175,7 @@ PagedIterable listByResource( * @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 all private endpoint connections under a topic or domain. + * @return all private endpoint connections under a topic, domain, or partner namespace. */ PagedIterable listByResource( String resourceGroupName, diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PrivateEndpointConnectionsParentType.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PrivateEndpointConnectionsParentType.java index b303e05bf1e02..399ca1e8d31e3 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PrivateEndpointConnectionsParentType.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PrivateEndpointConnectionsParentType.java @@ -17,6 +17,9 @@ public final class PrivateEndpointConnectionsParentType /** Static value domains for PrivateEndpointConnectionsParentType. */ public static final PrivateEndpointConnectionsParentType DOMAINS = fromString("domains"); + /** Static value partnerNamespaces for PrivateEndpointConnectionsParentType. */ + public static final PrivateEndpointConnectionsParentType PARTNER_NAMESPACES = fromString("partnerNamespaces"); + /** * Creates or finds a PrivateEndpointConnectionsParentType from its string representation. * diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PrivateLinkResources.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PrivateLinkResources.java index 2c4001bfe533f..ad9bb145cc415 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PrivateLinkResources.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/PrivateLinkResources.java @@ -14,8 +14,10 @@ public interface PrivateLinkResources { * Get properties of a private link resource. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateLinkResourceName The name of private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -29,8 +31,10 @@ PrivateLinkResource get( * Get properties of a private link resource. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param privateLinkResourceName The name of private link resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -46,11 +50,13 @@ Response getWithResponse( Context context); /** - * List all the private link resources under a topic or domain. + * List all the private link resources under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @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. @@ -59,11 +65,13 @@ Response getWithResponse( PagedIterable listByResource(String resourceGroupName, String parentType, String parentName); /** - * List all the private link resources under a topic or domain. + * List all the private link resources under a topic, domain, or partner namespace. * * @param resourceGroupName The name of the resource group within the user's subscription. - * @param parentType The type of the parent resource. This can be either \'topics\' or \'domains\'. - * @param parentName The name of the parent resource (namely, either, the topic name or domain name). + * @param parentType The type of the parent resource. This can be either \'topics\', \'domains\', or + * \'partnerNamespaces\'. + * @param parentName The name of the parent resource (namely, either, the topic name, domain name, or partner + * namespace name). * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the * 'name' property only and with limited number of OData operations. These operations are: the 'contains' * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ResourceKind.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ResourceKind.java new file mode 100644 index 0000000000000..bcfda097fd9e9 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ResourceKind.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 ResourceKind. */ +public final class ResourceKind extends ExpandableStringEnum { + /** Static value Azure for ResourceKind. */ + public static final ResourceKind AZURE = fromString("Azure"); + + /** Static value AzureArc for ResourceKind. */ + public static final ResourceKind AZURE_ARC = fromString("AzureArc"); + + /** + * Creates or finds a ResourceKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceKind. + */ + @JsonCreator + public static ResourceKind fromString(String name) { + return fromString(name, ResourceKind.class); + } + + /** @return known ResourceKind values. */ + public static Collection values() { + return values(ResourceKind.class); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ResourceSku.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ResourceSku.java new file mode 100644 index 0000000000000..12c8dc8ad6145 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ResourceSku.java @@ -0,0 +1,50 @@ +// 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; + +/** Describes an EventGrid Resource Sku. */ +@Fluent +public final class ResourceSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSku.class); + + /* + * The Sku name of the resource. The possible values are: Basic or Premium. + */ + @JsonProperty(value = "name") + private Sku name; + + /** + * Get the name property: The Sku name of the resource. The possible values are: Basic or Premium. + * + * @return the name value. + */ + public Sku name() { + return this.name; + } + + /** + * Set the name property: The Sku name of the resource. The possible values are: Basic or Premium. + * + * @param name the name value to set. + * @return the ResourceSku object itself. + */ + public ResourceSku withName(Sku name) { + this.name = name; + 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/ServiceBusQueueEventSubscriptionDestination.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ServiceBusQueueEventSubscriptionDestination.java index 77cba7c504d85..db987bbc6752c 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ServiceBusQueueEventSubscriptionDestination.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ServiceBusQueueEventSubscriptionDestination.java @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; /** Information about the service bus destination for an event subscription. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType") @@ -27,6 +28,12 @@ public class ServiceBusQueueEventSubscriptionDestination extends EventSubscripti @JsonProperty(value = "properties.resourceId") private String resourceId; + /* + * Delivery attribute details. + */ + @JsonProperty(value = "properties.deliveryAttributeMappings") + private List deliveryAttributeMappings; + /** * Get the resourceId property: The Azure Resource Id that represents the endpoint of the Service Bus destination of * an event subscription. @@ -49,6 +56,27 @@ public ServiceBusQueueEventSubscriptionDestination withResourceId(String resourc return this; } + /** + * Get the deliveryAttributeMappings property: Delivery attribute details. + * + * @return the deliveryAttributeMappings value. + */ + public List deliveryAttributeMappings() { + return this.deliveryAttributeMappings; + } + + /** + * Set the deliveryAttributeMappings property: Delivery attribute details. + * + * @param deliveryAttributeMappings the deliveryAttributeMappings value to set. + * @return the ServiceBusQueueEventSubscriptionDestination object itself. + */ + public ServiceBusQueueEventSubscriptionDestination withDeliveryAttributeMappings( + List deliveryAttributeMappings) { + this.deliveryAttributeMappings = deliveryAttributeMappings; + return this; + } + /** * Validates the instance. * @@ -57,5 +85,8 @@ public ServiceBusQueueEventSubscriptionDestination withResourceId(String resourc @Override public void validate() { super.validate(); + if (deliveryAttributeMappings() != null) { + deliveryAttributeMappings().forEach(e -> e.validate()); + } } } diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ServiceBusTopicEventSubscriptionDestination.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ServiceBusTopicEventSubscriptionDestination.java index 969e132f1ed7b..4eaf2f3096dd8 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ServiceBusTopicEventSubscriptionDestination.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/ServiceBusTopicEventSubscriptionDestination.java @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; /** Information about the service bus topic destination for an event subscription. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType") @@ -27,6 +28,12 @@ public class ServiceBusTopicEventSubscriptionDestination extends EventSubscripti @JsonProperty(value = "properties.resourceId") private String resourceId; + /* + * Delivery attribute details. + */ + @JsonProperty(value = "properties.deliveryAttributeMappings") + private List deliveryAttributeMappings; + /** * Get the resourceId property: The Azure Resource Id that represents the endpoint of the Service Bus Topic * destination of an event subscription. @@ -49,6 +56,27 @@ public ServiceBusTopicEventSubscriptionDestination withResourceId(String resourc return this; } + /** + * Get the deliveryAttributeMappings property: Delivery attribute details. + * + * @return the deliveryAttributeMappings value. + */ + public List deliveryAttributeMappings() { + return this.deliveryAttributeMappings; + } + + /** + * Set the deliveryAttributeMappings property: Delivery attribute details. + * + * @param deliveryAttributeMappings the deliveryAttributeMappings value to set. + * @return the ServiceBusTopicEventSubscriptionDestination object itself. + */ + public ServiceBusTopicEventSubscriptionDestination withDeliveryAttributeMappings( + List deliveryAttributeMappings) { + this.deliveryAttributeMappings = deliveryAttributeMappings; + return this; + } + /** * Validates the instance. * @@ -57,5 +85,8 @@ public ServiceBusTopicEventSubscriptionDestination withResourceId(String resourc @Override public void validate() { super.validate(); + if (deliveryAttributeMappings() != null) { + deliveryAttributeMappings().forEach(e -> e.validate()); + } } } diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/Sku.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/Sku.java new file mode 100644 index 0000000000000..5940bab1d2165 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/Sku.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 Sku. */ +public final class Sku extends ExpandableStringEnum { + /** Static value Basic for Sku. */ + public static final Sku BASIC = fromString("Basic"); + + /** Static value Premium for Sku. */ + public static final Sku PREMIUM = fromString("Premium"); + + /** + * Creates or finds a Sku from its string representation. + * + * @param name a name to look for. + * @return the corresponding Sku. + */ + @JsonCreator + public static Sku fromString(String name) { + return fromString(name, Sku.class); + } + + /** @return known Sku values. */ + public static Collection values() { + return values(Sku.class); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/StaticDeliveryAttributeMapping.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/StaticDeliveryAttributeMapping.java new file mode 100644 index 0000000000000..f9b579c957924 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/StaticDeliveryAttributeMapping.java @@ -0,0 +1,91 @@ +// 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.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Static delivery attribute mapping details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Static") +@JsonFlatten +@Fluent +public class StaticDeliveryAttributeMapping extends DeliveryAttributeMapping { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StaticDeliveryAttributeMapping.class); + + /* + * Value of the delivery attribute. + */ + @JsonProperty(value = "properties.value") + private String value; + + /* + * Boolean flag to tell if the attribute contains sensitive information . + */ + @JsonProperty(value = "properties.isSecret") + private Boolean isSecret; + + /** + * Get the value property: Value of the delivery attribute. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Value of the delivery attribute. + * + * @param value the value value to set. + * @return the StaticDeliveryAttributeMapping object itself. + */ + public StaticDeliveryAttributeMapping withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the isSecret property: Boolean flag to tell if the attribute contains sensitive information . + * + * @return the isSecret value. + */ + public Boolean isSecret() { + return this.isSecret; + } + + /** + * Set the isSecret property: Boolean flag to tell if the attribute contains sensitive information . + * + * @param isSecret the isSecret value to set. + * @return the StaticDeliveryAttributeMapping object itself. + */ + public StaticDeliveryAttributeMapping withIsSecret(Boolean isSecret) { + this.isSecret = isSecret; + return this; + } + + /** {@inheritDoc} */ + @Override + public StaticDeliveryAttributeMapping withName(String name) { + super.withName(name); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/StorageQueueEventSubscriptionDestination.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/StorageQueueEventSubscriptionDestination.java index 790b54caefc52..ce778ff881bcf 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/StorageQueueEventSubscriptionDestination.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/StorageQueueEventSubscriptionDestination.java @@ -34,6 +34,12 @@ public class StorageQueueEventSubscriptionDestination extends EventSubscriptionD @JsonProperty(value = "properties.queueName") private String queueName; + /* + * Storage queue message time to live in seconds. + */ + @JsonProperty(value = "properties.queueMessageTimeToLiveInSeconds") + private Long queueMessageTimeToLiveInSeconds; + /** * Get the resourceId property: The Azure Resource ID of the storage account that contains the queue that is the * destination of an event subscription. @@ -78,6 +84,27 @@ public StorageQueueEventSubscriptionDestination withQueueName(String queueName) return this; } + /** + * Get the queueMessageTimeToLiveInSeconds property: Storage queue message time to live in seconds. + * + * @return the queueMessageTimeToLiveInSeconds value. + */ + public Long queueMessageTimeToLiveInSeconds() { + return this.queueMessageTimeToLiveInSeconds; + } + + /** + * Set the queueMessageTimeToLiveInSeconds property: Storage queue message time to live in seconds. + * + * @param queueMessageTimeToLiveInSeconds the queueMessageTimeToLiveInSeconds value to set. + * @return the StorageQueueEventSubscriptionDestination object itself. + */ + public StorageQueueEventSubscriptionDestination withQueueMessageTimeToLiveInSeconds( + Long queueMessageTimeToLiveInSeconds) { + this.queueMessageTimeToLiveInSeconds = queueMessageTimeToLiveInSeconds; + return this; + } + /** * Validates the instance. * diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/StringNotBeginsWithAdvancedFilter.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/StringNotBeginsWithAdvancedFilter.java new file mode 100644 index 0000000000000..40f66808cdabc --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/StringNotBeginsWithAdvancedFilter.java @@ -0,0 +1,64 @@ +// 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; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** StringNotBeginsWith Advanced Filter. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType") +@JsonTypeName("StringNotBeginsWith") +@Fluent +public final class StringNotBeginsWithAdvancedFilter extends AdvancedFilter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StringNotBeginsWithAdvancedFilter.class); + + /* + * The set of filter values. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the values property: The set of filter values. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: The set of filter values. + * + * @param values the values value to set. + * @return the StringNotBeginsWithAdvancedFilter object itself. + */ + public StringNotBeginsWithAdvancedFilter withValues(List values) { + this.values = values; + return this; + } + + /** {@inheritDoc} */ + @Override + public StringNotBeginsWithAdvancedFilter withKey(String key) { + super.withKey(key); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/StringNotContainsAdvancedFilter.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/StringNotContainsAdvancedFilter.java new file mode 100644 index 0000000000000..89131b5b20cd1 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/StringNotContainsAdvancedFilter.java @@ -0,0 +1,64 @@ +// 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; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** StringNotContains Advanced Filter. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType") +@JsonTypeName("StringNotContains") +@Fluent +public final class StringNotContainsAdvancedFilter extends AdvancedFilter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StringNotContainsAdvancedFilter.class); + + /* + * The set of filter values. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the values property: The set of filter values. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: The set of filter values. + * + * @param values the values value to set. + * @return the StringNotContainsAdvancedFilter object itself. + */ + public StringNotContainsAdvancedFilter withValues(List values) { + this.values = values; + return this; + } + + /** {@inheritDoc} */ + @Override + public StringNotContainsAdvancedFilter withKey(String key) { + super.withKey(key); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/StringNotEndsWithAdvancedFilter.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/StringNotEndsWithAdvancedFilter.java new file mode 100644 index 0000000000000..d83aacdc87d44 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/StringNotEndsWithAdvancedFilter.java @@ -0,0 +1,64 @@ +// 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; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** StringNotEndsWith Advanced Filter. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "operatorType") +@JsonTypeName("StringNotEndsWith") +@Fluent +public final class StringNotEndsWithAdvancedFilter extends AdvancedFilter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StringNotEndsWithAdvancedFilter.class); + + /* + * The set of filter values. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the values property: The set of filter values. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: The set of filter values. + * + * @param values the values value to set. + * @return the StringNotEndsWithAdvancedFilter object itself. + */ + public StringNotEndsWithAdvancedFilter withValues(List values) { + this.values = values; + return this; + } + + /** {@inheritDoc} */ + @Override + public StringNotEndsWithAdvancedFilter withKey(String key) { + super.withKey(key); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/SystemTopic.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/SystemTopic.java new file mode 100644 index 0000000000000..d4c204365a7d8 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/SystemTopic.java @@ -0,0 +1,279 @@ +// 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.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventgrid.fluent.models.SystemTopicInner; +import java.util.Map; + +/** An immutable client-side representation of SystemTopic. */ +public interface SystemTopic { + /** + * 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 location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: The system metadata relating to System Topic resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the identity property: Identity information for the resource. + * + * @return the identity value. + */ + IdentityInfo identity(); + + /** + * Gets the provisioningState property: Provisioning state of the system topic. + * + * @return the provisioningState value. + */ + ResourceProvisioningState provisioningState(); + + /** + * Gets the source property: Source for the system topic. + * + * @return the source value. + */ + String source(); + + /** + * Gets the topicType property: TopicType for the system topic. + * + * @return the topicType value. + */ + String topicType(); + + /** + * Gets the metricResourceId property: Metric resource id for the system topic. + * + * @return the metricResourceId value. + */ + String metricResourceId(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.eventgrid.fluent.models.SystemTopicInner object. + * + * @return the inner object. + */ + SystemTopicInner innerModel(); + + /** The entirety of the SystemTopic definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The SystemTopic definition stages. */ + interface DefinitionStages { + /** The first stage of the SystemTopic definition. */ + interface Blank extends WithLocation { + } + /** The stage of the SystemTopic definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the SystemTopic definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the SystemTopic definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithSource, + DefinitionStages.WithTopicType { + /** + * Executes the create request. + * + * @return the created resource. + */ + SystemTopic create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SystemTopic create(Context context); + } + /** The stage of the SystemTopic definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the SystemTopic 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 SystemTopic definition allowing to specify source. */ + interface WithSource { + /** + * Specifies the source property: Source for the system topic.. + * + * @param source Source for the system topic. + * @return the next definition stage. + */ + WithCreate withSource(String source); + } + /** The stage of the SystemTopic definition allowing to specify topicType. */ + interface WithTopicType { + /** + * Specifies the topicType property: TopicType for the system topic.. + * + * @param topicType TopicType for the system topic. + * @return the next definition stage. + */ + WithCreate withTopicType(String topicType); + } + } + /** + * Begins update for the SystemTopic resource. + * + * @return the stage of resource update. + */ + SystemTopic.Update update(); + + /** The template for SystemTopic update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SystemTopic apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SystemTopic apply(Context context); + } + /** The SystemTopic update stages. */ + interface UpdateStages { + /** The stage of the SystemTopic update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Tags of the system topic.. + * + * @param tags Tags of the system topic. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the SystemTopic update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Resource identity information.. + * + * @param identity Resource identity information. + * @return the next definition stage. + */ + Update withIdentity(IdentityInfo identity); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SystemTopic refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SystemTopic refresh(Context context); +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/SystemTopicEventSubscriptions.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/SystemTopicEventSubscriptions.java new file mode 100644 index 0000000000000..2b276661e1bf4 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/SystemTopicEventSubscriptions.java @@ -0,0 +1,247 @@ +// 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.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner; + +/** Resource collection API of SystemTopicEventSubscriptions. */ +public interface SystemTopicEventSubscriptions { + /** + * Get an event subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 an event subscription. + */ + EventSubscription get(String resourceGroupName, String systemTopicName, String eventSubscriptionName); + + /** + * Get an event subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 an event subscription. + */ + Response getWithResponse( + String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context); + + /** + * Asynchronously creates or updates an event subscription with the specified parameters. Existing event + * subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + EventSubscription createOrUpdate( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo); + + /** + * Asynchronously creates or updates an event subscription with the specified parameters. Existing event + * subscriptions will be updated with this API. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionInfo Event subscription properties containing the destination and filter information. + * @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 event Subscription. + */ + EventSubscription createOrUpdate( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionInner eventSubscriptionInfo, + Context context); + + /** + * Delete an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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. + */ + void delete(String resourceGroupName, String systemTopicName, String eventSubscriptionName); + + /** + * Delete an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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. + */ + void delete(String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context); + + /** + * Update event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + EventSubscription update( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters); + + /** + * Update event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @param eventSubscriptionUpdateParameters Updated event subscription information. + * @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 event Subscription. + */ + EventSubscription update( + String resourceGroupName, + String systemTopicName, + String eventSubscriptionName, + EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters, + Context context); + + /** + * Get the full endpoint URL for an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 full endpoint URL for an event subscription of a system topic. + */ + EventSubscriptionFullUrl getFullUrl(String resourceGroupName, String systemTopicName, String eventSubscriptionName); + + /** + * Get the full endpoint URL for an event subscription of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 full endpoint URL for an event subscription of a system topic. + */ + Response getFullUrlWithResponse( + String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context); + + /** + * List event subscriptions that belong to a specific system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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 result of the List EventSubscriptions operation. + */ + PagedIterable listBySystemTopic(String resourceGroupName, String systemTopicName); + + /** + * List event subscriptions that belong to a specific system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List EventSubscriptions operation. + */ + PagedIterable listBySystemTopic( + String resourceGroupName, String systemTopicName, String filter, Integer top, Context context); + + /** + * Get all delivery attributes for an event subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 all delivery attributes for an event subscription. + */ + DeliveryAttributeListResult getDeliveryAttributes( + String resourceGroupName, String systemTopicName, String eventSubscriptionName); + + /** + * Get all delivery attributes for an event subscription. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @param eventSubscriptionName Name of the event subscription to be created. Event subscription names must be + * between 3 and 100 characters in length and use alphanumeric letters only. + * @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 all delivery attributes for an event subscription. + */ + Response getDeliveryAttributesWithResponse( + String resourceGroupName, String systemTopicName, String eventSubscriptionName, Context context); +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/SystemTopicUpdateParameters.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/SystemTopicUpdateParameters.java new file mode 100644 index 0000000000000..5cda9604aa5bd --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/SystemTopicUpdateParameters.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; +import java.util.Map; + +/** Properties of the System Topic update. */ +@Fluent +public final class SystemTopicUpdateParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SystemTopicUpdateParameters.class); + + /* + * Tags of the system topic. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * Resource identity information. + */ + @JsonProperty(value = "identity") + private IdentityInfo identity; + + /** + * Get the tags property: Tags of the system topic. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Tags of the system topic. + * + * @param tags the tags value to set. + * @return the SystemTopicUpdateParameters object itself. + */ + public SystemTopicUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity property: Resource identity information. + * + * @return the identity value. + */ + public IdentityInfo identity() { + return this.identity; + } + + /** + * Set the identity property: Resource identity information. + * + * @param identity the identity value to set. + * @return the SystemTopicUpdateParameters object itself. + */ + public SystemTopicUpdateParameters withIdentity(IdentityInfo identity) { + this.identity = identity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/SystemTopics.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/SystemTopics.java new file mode 100644 index 0000000000000..7f85810b81c4a --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/SystemTopics.java @@ -0,0 +1,173 @@ +// 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.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SystemTopics. */ +public interface SystemTopics { + /** + * Get properties of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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 properties of a system topic. + */ + SystemTopic getByResourceGroup(String resourceGroupName, String systemTopicName); + + /** + * Get properties of a system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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 properties of a system topic. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String systemTopicName, Context context); + + /** + * Delete existing system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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. + */ + void deleteByResourceGroup(String resourceGroupName, String systemTopicName); + + /** + * Delete existing system topic. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param systemTopicName Name of the system topic. + * @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. + */ + void delete(String resourceGroupName, String systemTopicName, Context context); + + /** + * List all the system topics under an Azure subscription. + * + * @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 result of the List System topics operation. + */ + PagedIterable list(); + + /** + * List all the system topics under an Azure subscription. + * + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List System topics operation. + */ + PagedIterable list(String filter, Integer top, Context context); + + /** + * List all the system topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @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 result of the List System topics operation. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all the system topics under a resource group. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the + * 'name' property only and with limited number of OData operations. These operations are: the 'contains' + * function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). + * No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, + * 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq + * 'westus'. + * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to + * 100. If not specified, the default number of results to be returned is 20 items per page. + * @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 result of the List System topics operation. + */ + PagedIterable listByResourceGroup( + String resourceGroupName, String filter, Integer top, Context context); + + /** + * Get properties of a system topic. + * + * @param id the resource ID. + * @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 properties of a system topic. + */ + SystemTopic getById(String id); + + /** + * Get properties of a system topic. + * + * @param id the resource ID. + * @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 properties of a system topic. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete existing system topic. + * + * @param id the resource ID. + * @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. + */ + void deleteById(String id); + + /** + * Delete existing system topic. + * + * @param id the resource ID. + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SystemTopic resource. + * + * @param name resource name. + * @return the first stage of the new SystemTopic definition. + */ + SystemTopic.DefinitionStages.Blank define(String name); +} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/SystemTopicsListResult.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/SystemTopicsListResult.java new file mode 100644 index 0000000000000..21dcb888eae21 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/SystemTopicsListResult.java @@ -0,0 +1,81 @@ +// 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.azure.resourcemanager.eventgrid.fluent.models.SystemTopicInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Result of the List System topics operation. */ +@Fluent +public final class SystemTopicsListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SystemTopicsListResult.class); + + /* + * A collection of system Topics. + */ + @JsonProperty(value = "value") + private List value; + + /* + * A link for the next page of topics. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: A collection of system Topics. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A collection of system Topics. + * + * @param value the value value to set. + * @return the SystemTopicsListResult object itself. + */ + public SystemTopicsListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: A link for the next page of topics. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: A link for the next page of topics. + * + * @param nextLink the nextLink value to set. + * @return the SystemTopicsListResult object itself. + */ + public SystemTopicsListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} 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 f777b51054863..67b69771574eb 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,34 @@ public interface Topic { */ Map tags(); + /** + * Gets the sku property: The Sku pricing tier for the topic. + * + * @return the sku value. + */ + ResourceSku sku(); + + /** + * Gets the identity property: Identity information for the resource. + * + * @return the identity value. + */ + IdentityInfo identity(); + + /** + * Gets the kind property: Kind of the resource. + * + * @return the kind value. + */ + ResourceKind kind(); + + /** + * Gets the extendedLocation property: Extended location of the resource. + * + * @return the extendedLocation value. + */ + ExtendedLocation extendedLocation(); + /** * Gets the systemData property: The system metadata relating to Topic resource. * @@ -118,6 +146,15 @@ public interface Topic { */ List inboundIpRules(); + /** + * Gets the disableLocalAuth property: This boolean is used to enable or disable local auth. Default value is false. + * When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to + * the topic. + * + * @return the disableLocalAuth value. + */ + Boolean disableLocalAuth(); + /** * Gets the region of the resource. * @@ -185,10 +222,15 @@ interface WithResourceGroup { */ interface WithCreate extends DefinitionStages.WithTags, + DefinitionStages.WithSku, + DefinitionStages.WithIdentity, + DefinitionStages.WithKind, + DefinitionStages.WithExtendedLocation, DefinitionStages.WithInputSchema, DefinitionStages.WithInputSchemaMapping, DefinitionStages.WithPublicNetworkAccess, - DefinitionStages.WithInboundIpRules { + DefinitionStages.WithInboundIpRules, + DefinitionStages.WithDisableLocalAuth { /** * Executes the create request. * @@ -214,6 +256,46 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the Topic definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The Sku pricing tier for the topic.. + * + * @param sku The Sku pricing tier for the topic. + * @return the next definition stage. + */ + WithCreate withSku(ResourceSku sku); + } + /** 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 kind. */ + interface WithKind { + /** + * Specifies the kind property: Kind of the resource.. + * + * @param kind Kind of the resource. + * @return the next definition stage. + */ + WithCreate withKind(ResourceKind kind); + } + /** The stage of the Topic definition allowing to specify extendedLocation. */ + interface WithExtendedLocation { + /** + * Specifies the extendedLocation property: Extended location of the resource.. + * + * @param extendedLocation Extended location of the resource. + * @return the next definition stage. + */ + WithCreate withExtendedLocation(ExtendedLocation extendedLocation); + } /** The stage of the Topic definition allowing to specify inputSchema. */ interface WithInputSchema { /** @@ -267,6 +349,20 @@ interface WithInboundIpRules { */ WithCreate withInboundIpRules(List inboundIpRules); } + /** The stage of the Topic definition allowing to specify disableLocalAuth. */ + interface WithDisableLocalAuth { + /** + * Specifies the disableLocalAuth property: This boolean is used to enable or disable local auth. Default + * value is false. When the property is set to true, only AAD token will be used to authenticate if user is + * allowed to publish to the topic.. + * + * @param disableLocalAuth This boolean is used to enable or disable local auth. Default value is false. + * When the property is set to true, only AAD token will be used to authenticate if user is allowed to + * publish to the topic. + * @return the next definition stage. + */ + WithCreate withDisableLocalAuth(Boolean disableLocalAuth); + } } /** * Begins update for the Topic resource. @@ -277,7 +373,12 @@ interface WithInboundIpRules { /** The template for Topic update. */ interface Update - extends UpdateStages.WithTags, UpdateStages.WithPublicNetworkAccess, UpdateStages.WithInboundIpRules { + extends UpdateStages.WithTags, + UpdateStages.WithIdentity, + UpdateStages.WithSku, + UpdateStages.WithPublicNetworkAccess, + UpdateStages.WithInboundIpRules, + UpdateStages.WithDisableLocalAuth { /** * Executes the update request. * @@ -298,13 +399,33 @@ interface UpdateStages { /** The stage of the Topic update allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: Tags of the resource.. + * Specifies the tags property: Tags of the Topic resource.. * - * @param tags Tags of the resource. + * @param tags Tags of the Topic resource. * @return the next definition stage. */ 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 sku. */ + interface WithSku { + /** + * Specifies the sku property: The Sku pricing tier for the topic.. + * + * @param sku The Sku pricing tier for the topic. + * @return the next definition stage. + */ + Update withSku(ResourceSku sku); + } /** The stage of the Topic update allowing to specify publicNetworkAccess. */ interface WithPublicNetworkAccess { /** @@ -335,6 +456,20 @@ interface WithInboundIpRules { */ Update withInboundIpRules(List inboundIpRules); } + /** The stage of the Topic update allowing to specify disableLocalAuth. */ + interface WithDisableLocalAuth { + /** + * Specifies the disableLocalAuth property: This boolean is used to enable or disable local auth. Default + * value is false. When the property is set to true, only AAD token will be used to authenticate if user is + * allowed to publish to the topic.. + * + * @param disableLocalAuth This boolean is used to enable or disable local auth. Default value is false. + * When the property is set to true, only AAD token will be used to authenticate if user is allowed to + * publish to the topic. + * @return the next definition stage. + */ + Update withDisableLocalAuth(Boolean disableLocalAuth); + } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/TopicTypeInfo.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/TopicTypeInfo.java index 048fa15e32e06..0c1608ec6a4d0 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/TopicTypeInfo.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/TopicTypeInfo.java @@ -79,6 +79,13 @@ public interface TopicTypeInfo { */ String sourceResourceFormat(); + /** + * Gets the supportedScopesForSource property: Supported source scopes. + * + * @return the supportedScopesForSource value. + */ + List supportedScopesForSource(); + /** * Gets the inner com.azure.resourcemanager.eventgrid.fluent.models.TopicTypeInfoInner object. * diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/TopicTypePropertiesSupportedScopesForSourceItem.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/TopicTypePropertiesSupportedScopesForSourceItem.java new file mode 100644 index 0000000000000..728def664d328 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/TopicTypePropertiesSupportedScopesForSourceItem.java @@ -0,0 +1,39 @@ +// 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 TopicTypePropertiesSupportedScopesForSourceItem. */ +public final class TopicTypePropertiesSupportedScopesForSourceItem + extends ExpandableStringEnum { + /** Static value Resource for TopicTypePropertiesSupportedScopesForSourceItem. */ + public static final TopicTypePropertiesSupportedScopesForSourceItem RESOURCE = fromString("Resource"); + + /** Static value ResourceGroup for TopicTypePropertiesSupportedScopesForSourceItem. */ + public static final TopicTypePropertiesSupportedScopesForSourceItem RESOURCE_GROUP = fromString("ResourceGroup"); + + /** Static value AzureSubscription for TopicTypePropertiesSupportedScopesForSourceItem. */ + public static final TopicTypePropertiesSupportedScopesForSourceItem AZURE_SUBSCRIPTION = + fromString("AzureSubscription"); + + /** + * Creates or finds a TopicTypePropertiesSupportedScopesForSourceItem from its string representation. + * + * @param name a name to look for. + * @return the corresponding TopicTypePropertiesSupportedScopesForSourceItem. + */ + @JsonCreator + public static TopicTypePropertiesSupportedScopesForSourceItem fromString(String name) { + return fromString(name, TopicTypePropertiesSupportedScopesForSourceItem.class); + } + + /** @return known TopicTypePropertiesSupportedScopesForSourceItem values. */ + public static Collection values() { + return values(TopicTypePropertiesSupportedScopesForSourceItem.class); + } +} 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 133f1ed3ee1db..4b78a2ea4cf75 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 @@ -19,11 +19,23 @@ public class TopicUpdateParameters { @JsonIgnore private final ClientLogger logger = new ClientLogger(TopicUpdateParameters.class); /* - * Tags of the resource. + * Tags of the Topic resource. */ @JsonProperty(value = "tags") private Map tags; + /* + * Topic resource identity information. + */ + @JsonProperty(value = "identity") + private IdentityInfo identity; + + /* + * The Sku pricing tier for the topic. + */ + @JsonProperty(value = "sku") + private ResourceSku sku; + /* * This determines if traffic is allowed over public network. By default it * is enabled. @@ -41,8 +53,16 @@ public class TopicUpdateParameters { @JsonProperty(value = "properties.inboundIpRules") private List inboundIpRules; + /* + * This boolean is used to enable or disable local auth. Default value is + * false. When the property is set to true, only AAD token will be used to + * authenticate if user is allowed to publish to the topic. + */ + @JsonProperty(value = "properties.disableLocalAuth") + private Boolean disableLocalAuth; + /** - * Get the tags property: Tags of the resource. + * Get the tags property: Tags of the Topic resource. * * @return the tags value. */ @@ -51,7 +71,7 @@ public Map tags() { } /** - * Set the tags property: Tags of the resource. + * Set the tags property: Tags of the Topic resource. * * @param tags the tags value to set. * @return the TopicUpdateParameters object itself. @@ -61,6 +81,46 @@ 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 sku property: The Sku pricing tier for the topic. + * + * @return the sku value. + */ + public ResourceSku sku() { + return this.sku; + } + + /** + * Set the sku property: The Sku pricing tier for the topic. + * + * @param sku the sku value to set. + * @return the TopicUpdateParameters object itself. + */ + public TopicUpdateParameters withSku(ResourceSku sku) { + this.sku = sku; + return this; + } + /** * Get the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is * enabled. You can further restrict to specific IPs by configuring <seealso @@ -109,12 +169,42 @@ public TopicUpdateParameters withInboundIpRules(List inboundIpRul return this; } + /** + * Get the disableLocalAuth property: This boolean is used to enable or disable local auth. Default value is false. + * When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to + * the topic. + * + * @return the disableLocalAuth value. + */ + public Boolean disableLocalAuth() { + return this.disableLocalAuth; + } + + /** + * Set the disableLocalAuth property: This boolean is used to enable or disable local auth. Default value is false. + * When the property is set to true, only AAD token will be used to authenticate if user is allowed to publish to + * the topic. + * + * @param disableLocalAuth the disableLocalAuth value to set. + * @return the TopicUpdateParameters object itself. + */ + public TopicUpdateParameters withDisableLocalAuth(Boolean disableLocalAuth) { + this.disableLocalAuth = disableLocalAuth; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (identity() != null) { + identity().validate(); + } + if (sku() != null) { + sku().validate(); + } if (inboundIpRules() != null) { inboundIpRules().forEach(e -> e.validate()); } diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/UserIdentityProperties.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/UserIdentityProperties.java new file mode 100644 index 0000000000000..80c663f9f1884 --- /dev/null +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/UserIdentityProperties.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.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 information about the user identity. */ +@Fluent +public final class UserIdentityProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserIdentityProperties.class); + + /* + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /* + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /** + * Get the principalId property: The principal id of user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principal id of user assigned identity. + * + * @param principalId the principalId value to set. + * @return the UserIdentityProperties object itself. + */ + public UserIdentityProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the clientId property: The client id of user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The client id of user assigned identity. + * + * @param clientId the clientId value to set. + * @return the UserIdentityProperties object itself. + */ + public UserIdentityProperties withClientId(String clientId) { + this.clientId = clientId; + 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/WebhookEventSubscriptionDestination.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/WebhookEventSubscriptionDestination.java index 4e322736e5bda..6edec3b1cf1ed 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/WebhookEventSubscriptionDestination.java +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/main/java/com/azure/resourcemanager/eventgrid/models/WebhookEventSubscriptionDestination.java @@ -11,6 +11,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; /** Information about the webhook destination for an event subscription. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType") @@ -60,6 +61,12 @@ public class WebhookEventSubscriptionDestination extends EventSubscriptionDestin @JsonProperty(value = "properties.azureActiveDirectoryApplicationIdOrUri") private String azureActiveDirectoryApplicationIdOrUri; + /* + * Delivery attribute details. + */ + @JsonProperty(value = "properties.deliveryAttributeMappings") + private List deliveryAttributeMappings; + /** * Get the endpointUrl property: The URL that represents the endpoint of the destination of an event subscription. * @@ -176,6 +183,27 @@ public WebhookEventSubscriptionDestination withAzureActiveDirectoryApplicationId return this; } + /** + * Get the deliveryAttributeMappings property: Delivery attribute details. + * + * @return the deliveryAttributeMappings value. + */ + public List deliveryAttributeMappings() { + return this.deliveryAttributeMappings; + } + + /** + * Set the deliveryAttributeMappings property: Delivery attribute details. + * + * @param deliveryAttributeMappings the deliveryAttributeMappings value to set. + * @return the WebhookEventSubscriptionDestination object itself. + */ + public WebhookEventSubscriptionDestination withDeliveryAttributeMappings( + List deliveryAttributeMappings) { + this.deliveryAttributeMappings = deliveryAttributeMappings; + return this; + } + /** * Validates the instance. * @@ -184,5 +212,8 @@ public WebhookEventSubscriptionDestination withAzureActiveDirectoryApplicationId @Override public void validate() { super.validate(); + if (deliveryAttributeMappings() != null) { + deliveryAttributeMappings().forEach(e -> e.validate()); + } } }