diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/CHANGELOG.md b/sdk/eventgrid/azure-resourcemanager-eventgrid/CHANGELOG.md index 29ec2e92f59c..c47db2bfc299 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/CHANGELOG.md +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/CHANGELOG.md @@ -1,14 +1,8 @@ # Release History -## 1.3.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2025-04-30) -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- 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-2025-02. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.2.0 (2025-03-24) diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/README.md b/sdk/eventgrid/azure-resourcemanager-eventgrid/README.md index 414f0f7e19f4..6e2ae885450d 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/README.md +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-eventgrid - 1.2.0 + 1.3.0-beta.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/SAMPLE.md b/sdk/eventgrid/azure-resourcemanager-eventgrid/SAMPLE.md index a46cc7581791..18335c308870 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/SAMPLE.md +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/SAMPLE.md @@ -261,25 +261,21 @@ ```java /** - * Samples for CaCertificates CreateOrUpdate. + * Samples for TopicTypes ListEventTypes. */ -public final class CaCertificatesCreateOrUpdateSamples { +public final class TopicTypesListEventTypesSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * CaCertificates_CreateOrUpdate.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicTypes_ListEventTypes + * .json */ /** - * Sample code: CaCertificates_CreateOrUpdate. + * Sample code: TopicTypes_ListEventTypes. * * @param manager Entry point to EventGridManager. */ - public static void caCertificatesCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.caCertificates() - .define("exampleCACertificateName1") - .withExistingNamespace("examplerg", "exampleNamespaceName1") - .withDescription("This is a test certificate") - .withEncodedCertificate("base64EncodePemFormattedCertificateString") - .create(); + public static void topicTypesListEventTypes(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.topicTypes().listEventTypes("Microsoft.Storage.StorageAccounts", com.azure.core.util.Context.NONE); } } ``` @@ -288,23 +284,20 @@ public final class CaCertificatesCreateOrUpdateSamples { ```java /** - * Samples for CaCertificates Delete. + * Samples for SystemTopics List. */ -public final class CaCertificatesDeleteSamples { +public final class SystemTopicsListSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/CaCertificates_Delete. - * json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * SystemTopics_ListBySubscription.json */ /** - * Sample code: CaCertificates_Delete. + * Sample code: SystemTopics_ListBySubscription. * * @param manager Entry point to EventGridManager. */ - public static void caCertificatesDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.caCertificates() - .delete("examplerg", "exampleNamespaceName1", "exampleCACertificateName1", - com.azure.core.util.Context.NONE); + public static void systemTopicsListBySubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.systemTopics().list(null, null, com.azure.core.util.Context.NONE); } } ``` @@ -313,50 +306,27 @@ public final class CaCertificatesDeleteSamples { ```java /** - * Samples for CaCertificates Get. - */ -public final class CaCertificatesGetSamples { - /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/CaCertificates_Get.json - */ - /** - * Sample code: CaCertificates_Get. - * - * @param manager Entry point to EventGridManager. - */ - public static void caCertificatesGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.caCertificates() - .getWithResponse("examplerg", "exampleNamespaceName1", "exampleCACertificateName1", - com.azure.core.util.Context.NONE); - } -} -``` - -### CaCertificates_ListByNamespace - -```java -/** - * Samples for CaCertificates ListByNamespace. + * Samples for SystemTopicEventSubscriptions ListBySystemTopic. */ -public final class CaCertificatesListByNamespaceSamples { +public final class SystemTopicEventSubscriptionsListBySystemTopicSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * CaCertificates_ListByNamespace.json + * SystemTopicEventSubscriptions_ListBySystemTopic.json */ /** - * Sample code: CaCertificates_ListByNamespace. + * Sample code: SystemTopicEventSubscriptions_ListBySystemTopic. * * @param manager Entry point to EventGridManager. */ - public static void caCertificatesListByNamespace(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.caCertificates() - .listByNamespace("examplerg", "namespace123", null, null, com.azure.core.util.Context.NONE); + public static void + systemTopicEventSubscriptionsListBySystemTopic(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.systemTopicEventSubscriptions() + .listBySystemTopic("examplerg", "exampleSystemTopic1", null, null, com.azure.core.util.Context.NONE); } } ``` -### Channels_CreateOrUpdate +### CaCertificates_ListByNamespace ```java import com.azure.resourcemanager.eventgrid.models.ChannelType; @@ -393,26 +363,62 @@ public final class ChannelsCreateOrUpdateSamples { } ``` +### Channels_CreateOrUpdate + +```java +import com.azure.resourcemanager.eventgrid.models.DeliveryConfiguration; +import com.azure.resourcemanager.eventgrid.models.DeliveryMode; +import com.azure.resourcemanager.eventgrid.models.DeliverySchema; +import com.azure.resourcemanager.eventgrid.models.QueueInfo; +import java.time.Duration; + +/** + * Samples for NamespaceTopicEventSubscriptions CreateOrUpdate. + */ +public final class NamespaceTopicEventSubscriptionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * NamespaceTopicEventSubscriptions_CreateOrUpdate.json + */ + /** + * Sample code: NamespaceTopicEventSubscriptions_CreateOrUpdate. + * + * @param manager Entry point to EventGridManager. + */ + public static void + namespaceTopicEventSubscriptionsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.namespaceTopicEventSubscriptions() + .define("examplenamespacetopicEventSub2") + .withExistingTopic("examplerg", "examplenamespace2", "examplenamespacetopic2") + .withDeliveryConfiguration(new DeliveryConfiguration().withDeliveryMode(DeliveryMode.QUEUE) + .withQueue(new QueueInfo().withReceiveLockDurationInSeconds(60) + .withMaxDeliveryCount(4) + .withEventTimeToLive(Duration.parse("P1D")))) + .withEventDeliverySchema(DeliverySchema.CLOUD_EVENT_SCHEMA_V1_0) + .create(); + } +} +``` + ### Channels_Delete ```java /** - * Samples for Channels Delete. + * Samples for ClientGroups Delete. */ -public final class ChannelsDeleteSamples { +public final class ClientGroupsDeleteSamples { /* * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Channels_Delete.json + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ClientGroups_Delete.json */ /** - * Sample code: Channels_Delete. + * Sample code: ClientGroups_Delete. * * @param manager Entry point to EventGridManager. */ - public static void channelsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.channels() - .delete("examplerg", "examplePartnerNamespaceName1", "exampleEventChannelName1", - com.azure.core.util.Context.NONE); + public static void clientGroupsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.clientGroups() + .delete("examplerg", "exampleNamespaceName1", "exampleClientGroupName1", com.azure.core.util.Context.NONE); } } ``` @@ -420,23 +426,42 @@ public final class ChannelsDeleteSamples { ### Channels_Get ```java +import com.azure.resourcemanager.eventgrid.models.PartnerNamespace; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for Channels Get. + * Samples for PartnerNamespaces Update. */ -public final class ChannelsGetSamples { +public final class PartnerNamespacesUpdateSamples { /* * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Channels_Get.json + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerNamespaces_Update. + * json */ /** - * Sample code: Channels_Get. + * Sample code: PartnerNamespaces_Update. * * @param manager Entry point to EventGridManager. */ - public static void channelsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.channels() - .getWithResponse("examplerg", "examplePartnerNamespaceName1", "exampleChannelName1", - com.azure.core.util.Context.NONE); + public static void partnerNamespacesUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + PartnerNamespace resource = manager.partnerNamespaces() + .getByResourceGroupWithResponse("examplerg", "examplePartnerNamespaceName1", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` @@ -445,22 +470,25 @@ public final class ChannelsGetSamples { ```java /** - * Samples for Channels GetFullUrl. + * Samples for CaCertificates CreateOrUpdate. */ -public final class ChannelsGetFullUrlSamples { +public final class CaCertificatesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Channels_GetFullUrl.json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * CaCertificates_CreateOrUpdate.json */ /** - * Sample code: Channels_GetFullUrl. + * Sample code: CaCertificates_CreateOrUpdate. * * @param manager Entry point to EventGridManager. */ - public static void channelsGetFullUrl(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.channels() - .getFullUrlWithResponse("examplerg", "examplenamespace", "examplechannel", - com.azure.core.util.Context.NONE); + public static void caCertificatesCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.caCertificates() + .define("exampleCACertificateName1") + .withExistingNamespace("examplerg", "exampleNamespaceName1") + .withDescription("This is a test certificate") + .withEncodedCertificate("base64EncodePemFormattedCertificateString") + .create(); } } ``` @@ -469,22 +497,21 @@ public final class ChannelsGetFullUrlSamples { ```java /** - * Samples for Channels ListByPartnerNamespace. + * Samples for ClientGroups ListByNamespace. */ -public final class ChannelsListByPartnerNamespaceSamples { +public final class ClientGroupsListByNamespaceSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * Channels_ListByPartnerNamespace.json + * ClientGroups_ListByNamespace.json */ /** - * Sample code: Channels_ListByPartnerNamespace. + * Sample code: ClientGroups_ListByNamespace. * * @param manager Entry point to EventGridManager. */ - public static void channelsListByPartnerNamespace(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.channels() - .listByPartnerNamespace("examplerg", "examplePartnerNamespaceName1", null, null, - com.azure.core.util.Context.NONE); + public static void clientGroupsListByNamespace(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.clientGroups() + .listByNamespace("examplerg", "namespace123", null, null, com.azure.core.util.Context.NONE); } } ``` @@ -492,27 +519,23 @@ public final class ChannelsListByPartnerNamespaceSamples { ### Channels_Update ```java -import com.azure.resourcemanager.eventgrid.models.ChannelUpdateParameters; -import java.time.OffsetDateTime; - /** - * Samples for Channels Update. + * Samples for EventSubscriptions GetDeliveryAttributes. */ -public final class ChannelsUpdateSamples { +public final class EventSubscriptionsGetDeliveryAttributesSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Channels_Update.json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * EventSubscriptions_GetDeliveryAttributes.json */ /** - * Sample code: Channels_Update. + * Sample code: EventSubscriptions_GetDeliveryAttributes. * * @param manager Entry point to EventGridManager. */ - public static void channelsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.channels() - .updateWithResponse( - "examplerg", "examplePartnerNamespaceName1", "exampleChannelName1", new ChannelUpdateParameters() - .withExpirationTimeIfNotActivatedUtc(OffsetDateTime.parse("2022-03-23T23:06:11.785Z")), + public static void + eventSubscriptionsGetDeliveryAttributes(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .getDeliveryAttributesWithResponse("aaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaa", com.azure.core.util.Context.NONE); } } @@ -521,26 +544,32 @@ public final class ChannelsUpdateSamples { ### ClientGroups_CreateOrUpdate ```java +import com.azure.resourcemanager.eventgrid.models.Partner; +import java.time.OffsetDateTime; +import java.util.UUID; + /** - * Samples for ClientGroups CreateOrUpdate. + * Samples for PartnerConfigurations AuthorizePartner. */ -public final class ClientGroupsCreateOrUpdateSamples { +public final class PartnerConfigurationsAuthorizePartnerSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * ClientGroups_CreateOrUpdate.json + * PartnerConfigurations_AuthorizePartner.json */ /** - * Sample code: ClientGroups_CreateOrUpdate. + * Sample code: PartnerConfigurations_AuthorizePartner. * * @param manager Entry point to EventGridManager. */ - public static void clientGroupsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.clientGroups() - .define("exampleClientGroupName1") - .withExistingNamespace("examplerg", "exampleNamespaceName1") - .withDescription("This is a test client group") - .withQuery("attributes.b IN ['a', 'b', 'c']") - .create(); + public static void + partnerConfigurationsAuthorizePartner(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerConfigurations() + .authorizePartnerWithResponse("examplerg", + new Partner() + .withPartnerRegistrationImmutableId(UUID.fromString("941892bc-f5d0-4d1c-8fb5-477570fc2b71")) + .withPartnerName("Contoso.Finance") + .withAuthorizationExpirationTimeInUtc(OffsetDateTime.parse("2022-01-28T01:20:55.142Z")), + com.azure.core.util.Context.NONE); } } ``` @@ -548,22 +577,36 @@ public final class ClientGroupsCreateOrUpdateSamples { ### ClientGroups_Delete ```java +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters; +import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination; +import java.util.Arrays; + /** - * Samples for ClientGroups Delete. + * Samples for SystemTopicEventSubscriptions Update. */ -public final class ClientGroupsDeleteSamples { +public final class SystemTopicEventSubscriptionsUpdateSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ClientGroups_Delete.json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * SystemTopicEventSubscriptions_Update.json */ /** - * Sample code: ClientGroups_Delete. + * Sample code: SystemTopicEventSubscriptions_Update. * * @param manager Entry point to EventGridManager. */ - public static void clientGroupsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.clientGroups() - .delete("examplerg", "exampleNamespaceName1", "exampleClientGroupName1", com.azure.core.util.Context.NONE); + public static void + systemTopicEventSubscriptionsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.systemTopicEventSubscriptions() + .update("examplerg", "exampleSystemTopic1", "exampleEventSubscriptionName1", + new EventSubscriptionUpdateParameters() + .withDestination( + new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") + .withSubjectEndsWith("newSuffix") + .withIsSubjectCaseSensitive(true)) + .withLabels(Arrays.asList("label1", "label2")), + com.azure.core.util.Context.NONE); } } ``` @@ -572,21 +615,21 @@ public final class ClientGroupsDeleteSamples { ```java /** - * Samples for ClientGroups Get. + * Samples for EventSubscriptions ListByResource. */ -public final class ClientGroupsGetSamples { +public final class EventSubscriptionsListByResourceSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ClientGroups_Get.json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * EventSubscriptions_ListByResource.json */ /** - * Sample code: ClientGroups_Get. + * Sample code: EventSubscriptions_ListByResource. * * @param manager Entry point to EventGridManager. */ - public static void clientGroupsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.clientGroups() - .getWithResponse("examplerg", "exampleNamespaceName1", "exampleClientGroupName1", + public static void eventSubscriptionsListByResource(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .listByResource("examplerg", "Microsoft.EventGrid", "topics", "exampletopic2", null, null, com.azure.core.util.Context.NONE); } } @@ -596,21 +639,23 @@ public final class ClientGroupsGetSamples { ```java /** - * Samples for ClientGroups ListByNamespace. + * Samples for TopicEventSubscriptions GetDeliveryAttributes. */ -public final class ClientGroupsListByNamespaceSamples { +public final class TopicEventSubscriptionsGetDeliveryAttributesSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * ClientGroups_ListByNamespace.json + * TopicEventSubscriptions_GetDeliveryAttributes.json */ /** - * Sample code: ClientGroups_ListByNamespace. + * Sample code: TopicEventSubscriptions_GetDeliveryAttributes. * * @param manager Entry point to EventGridManager. */ - public static void clientGroupsListByNamespace(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.clientGroups() - .listByNamespace("examplerg", "namespace123", null, null, com.azure.core.util.Context.NONE); + public static void + topicEventSubscriptionsGetDeliveryAttributes(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.topicEventSubscriptions() + .getDeliveryAttributesWithResponse("examplerg", "exampleTopic1", "examplesubscription1", + com.azure.core.util.Context.NONE); } } ``` @@ -618,55 +663,25 @@ public final class ClientGroupsListByNamespaceSamples { ### Clients_CreateOrUpdate ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.eventgrid.models.ClientCertificateAuthentication; -import com.azure.resourcemanager.eventgrid.models.ClientCertificateValidationScheme; -import com.azure.resourcemanager.eventgrid.models.ClientState; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; +import com.azure.resourcemanager.eventgrid.models.TopicRegenerateKeyRequest; /** - * Samples for Clients CreateOrUpdate. + * Samples for NamespaceTopics RegenerateKey. */ -public final class ClientsCreateOrUpdateSamples { +public final class NamespaceTopicsRegenerateKeySamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Clients_CreateOrUpdate. - * json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * NamespaceTopics_RegenerateKey.json */ /** - * Sample code: Clients_CreateOrUpdate. + * Sample code: NamespaceTopics_RegenerateKey. * * @param manager Entry point to EventGridManager. */ - public static void clientsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) - throws IOException { - manager.clients() - .define("exampleClientName1") - .withExistingNamespace("examplerg", "exampleNamespaceName1") - .withDescription("This is a test client") - .withClientCertificateAuthentication(new ClientCertificateAuthentication() - .withValidationScheme(ClientCertificateValidationScheme.SUBJECT_MATCHES_AUTHENTICATION_NAME)) - .withState(ClientState.ENABLED) - .withAttributes(mapOf("deviceTypes", - SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize("[\"Fan\",\"Light\",\"AC\"]", Object.class, SerializerEncoding.JSON), - "floor", 3, "room", "345")) - .create(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + public static void namespaceTopicsRegenerateKey(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.namespaceTopics() + .regenerateKey("examplerg", "examplenamespace2", "examplenamespacetopic2", + new TopicRegenerateKeyRequest().withKeyName("fakeTokenPlaceholder"), com.azure.core.util.Context.NONE); } } ``` @@ -675,21 +690,21 @@ public final class ClientsCreateOrUpdateSamples { ```java /** - * Samples for Clients Delete. + * Samples for Domains ListSharedAccessKeys. */ -public final class ClientsDeleteSamples { +public final class DomainsListSharedAccessKeysSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Clients_Delete.json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * Domains_ListSharedAccessKeys.json */ /** - * Sample code: Clients_Delete. + * Sample code: Domains_ListSharedAccessKeys. * * @param manager Entry point to EventGridManager. */ - public static void clientsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.clients() - .delete("examplerg", "exampleNamespaceName1", "exampleClientName1", com.azure.core.util.Context.NONE); + public static void domainsListSharedAccessKeys(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domains() + .listSharedAccessKeysWithResponse("examplerg", "exampledomain2", com.azure.core.util.Context.NONE); } } ``` @@ -697,22 +712,34 @@ public final class ClientsDeleteSamples { ### Clients_Get ```java +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters; +import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination; +import java.util.Arrays; + /** - * Samples for Clients Get. + * Samples for DomainEventSubscriptions Update. */ -public final class ClientsGetSamples { +public final class DomainEventSubscriptionsUpdateSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Clients_Get.json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * DomainEventSubscriptions_Update.json */ /** - * Sample code: Clients_Get. + * Sample code: DomainEventSubscriptions_Update. * * @param manager Entry point to EventGridManager. */ - public static void clientsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.clients() - .getWithResponse("examplerg", "exampleNamespaceName1", "exampleClientName1", + public static void domainEventSubscriptionsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domainEventSubscriptions() + .update("examplerg", "exampleDomain1", "exampleEventSubscriptionName1", + new EventSubscriptionUpdateParameters() + .withDestination( + new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") + .withSubjectEndsWith("newSuffix") + .withIsSubjectCaseSensitive(true)) + .withLabels(Arrays.asList("label1", "label2")), com.azure.core.util.Context.NONE); } } @@ -722,536 +749,400 @@ public final class ClientsGetSamples { ```java /** - * Samples for Clients ListByNamespace. + * Samples for EventSubscriptions Get. */ -public final class ClientsListByNamespaceSamples { +public final class EventSubscriptionsGetSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Clients_ListByNamespace. - * json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * EventSubscriptions_GetForCustomTopic_HybridConnectionDestination.json */ /** - * Sample code: Clients_ListByNamespace. + * Sample code: EventSubscriptions_GetForCustomTopic_HybridConnectionDestination. * * @param manager Entry point to EventGridManager. */ - public static void clientsListByNamespace(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.clients().listByNamespace("examplerg", "namespace123", null, null, com.azure.core.util.Context.NONE); + public static void eventSubscriptionsGetForCustomTopicHybridConnectionDestination( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .getWithResponse( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", + "examplesubscription1", com.azure.core.util.Context.NONE); } -} -``` - -### DomainEventSubscriptions_CreateOrUpdate - -```java -import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; -import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination; -/** - * Samples for DomainEventSubscriptions CreateOrUpdate. - */ -public final class DomainEventSubscriptionsCreateOrUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * DomainEventSubscriptions_CreateOrUpdate.json + * EventSubscriptions_GetForCustomTopic_ServiceBusTopicDestination.json */ /** - * Sample code: DomainEventSubscriptions_CreateOrUpdate. + * Sample code: EventSubscriptions_GetForCustomTopic_ServiceBusTopicDestination. * * @param manager Entry point to EventGridManager. */ - public static void - domainEventSubscriptionsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domainEventSubscriptions() - .createOrUpdate("examplerg", "exampleDomain1", "exampleEventSubscriptionName1", - new EventSubscriptionInner() - .withDestination( - new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") - .withSubjectEndsWith("ExampleSuffix") - .withIsSubjectCaseSensitive(false)), - com.azure.core.util.Context.NONE); + public static void eventSubscriptionsGetForCustomTopicServiceBusTopicDestination( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .getWithResponse( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", + "examplesubscription1", com.azure.core.util.Context.NONE); } -} -``` - -### DomainEventSubscriptions_Delete -```java -/** - * Samples for DomainEventSubscriptions Delete. - */ -public final class DomainEventSubscriptionsDeleteSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * DomainEventSubscriptions_Delete.json + * EventSubscriptions_GetForResourceGroup.json */ /** - * Sample code: DomainEventSubscriptions_Delete. + * Sample code: EventSubscriptions_GetForResourceGroup. * * @param manager Entry point to EventGridManager. */ - public static void domainEventSubscriptionsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domainEventSubscriptions() - .delete("examplerg", "exampleDomain1", "examplesubscription1", com.azure.core.util.Context.NONE); + public static void + eventSubscriptionsGetForResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .getWithResponse("subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg", + "examplesubscription2", com.azure.core.util.Context.NONE); } -} -``` - -### DomainEventSubscriptions_Get -```java -/** - * Samples for DomainEventSubscriptions Get. - */ -public final class DomainEventSubscriptionsGetSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * DomainEventSubscriptions_Get.json + * EventSubscriptions_GetForCustomTopic_EventHubDestination.json */ /** - * Sample code: DomainEventSubscriptions_Get. + * Sample code: EventSubscriptions_GetForCustomTopic_EventHubDestination. * * @param manager Entry point to EventGridManager. */ - public static void domainEventSubscriptionsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domainEventSubscriptions() - .getWithResponse("examplerg", "exampleDomain1", "examplesubscription1", com.azure.core.util.Context.NONE); + public static void eventSubscriptionsGetForCustomTopicEventHubDestination( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .getWithResponse( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", + "examplesubscription1", com.azure.core.util.Context.NONE); } -} -``` - -### DomainEventSubscriptions_GetDeliveryAttributes -```java -/** - * Samples for DomainEventSubscriptions GetDeliveryAttributes. - */ -public final class DomainEventSubscriptionsGetDeliveryAttributesSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * DomainEventSubscriptions_GetDeliveryAttributes.json + * EventSubscriptions_GetForSubscription.json */ /** - * Sample code: DomainEventSubscriptions_GetDeliveryAttributes. + * Sample code: EventSubscriptions_GetForSubscription. * * @param manager Entry point to EventGridManager. */ public static void - domainEventSubscriptionsGetDeliveryAttributes(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domainEventSubscriptions() - .getDeliveryAttributesWithResponse("examplerg", "exampleDomain1", "examplesubscription1", + eventSubscriptionsGetForSubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .getWithResponse("subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4", "examplesubscription3", com.azure.core.util.Context.NONE); } -} -``` -### DomainEventSubscriptions_GetFullUrl - -```java -/** - * Samples for DomainEventSubscriptions GetFullUrl. - */ -public final class DomainEventSubscriptionsGetFullUrlSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * DomainEventSubscriptions_GetFullUrl.json + * EventSubscriptions_GetForCustomTopic_WebhookDestination.json */ /** - * Sample code: DomainEventSubscriptions_GetFullUrl. + * Sample code: EventSubscriptions_GetForCustomTopic_WebhookDestination. * * @param manager Entry point to EventGridManager. */ - public static void - domainEventSubscriptionsGetFullUrl(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domainEventSubscriptions() - .getFullUrlWithResponse("examplerg", "exampleDomain1", "examplesubscription1", - com.azure.core.util.Context.NONE); + public static void eventSubscriptionsGetForCustomTopicWebhookDestination( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .getWithResponse( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", + "examplesubscription1", com.azure.core.util.Context.NONE); } -} -``` -### DomainEventSubscriptions_List - -```java -/** - * Samples for DomainEventSubscriptions List. - */ -public final class DomainEventSubscriptionsListSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * DomainEventSubscriptions_List.json + * EventSubscriptions_GetForCustomTopic_AzureFunctionDestination.json */ /** - * Sample code: DomainEventSubscriptions_List. + * Sample code: EventSubscriptions_GetForCustomTopic_AzureFunctionDestination. * * @param manager Entry point to EventGridManager. */ - public static void domainEventSubscriptionsList(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domainEventSubscriptions() - .list("examplerg", "exampleDomain1", null, null, com.azure.core.util.Context.NONE); + public static void eventSubscriptionsGetForCustomTopicAzureFunctionDestination( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .getWithResponse( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", + "examplesubscription1", com.azure.core.util.Context.NONE); } -} -``` - -### DomainEventSubscriptions_Update - -```java -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters; -import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination; -import java.util.Arrays; -/** - * Samples for DomainEventSubscriptions Update. - */ -public final class DomainEventSubscriptionsUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * DomainEventSubscriptions_Update.json + * EventSubscriptions_GetForCustomTopic.json */ /** - * Sample code: DomainEventSubscriptions_Update. + * Sample code: EventSubscriptions_GetForCustomTopic. * * @param manager Entry point to EventGridManager. */ - public static void domainEventSubscriptionsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domainEventSubscriptions() - .update("examplerg", "exampleDomain1", "exampleEventSubscriptionName1", - new EventSubscriptionUpdateParameters() - .withDestination( - new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") - .withSubjectEndsWith("newSuffix") - .withIsSubjectCaseSensitive(true)) - .withLabels(Arrays.asList("label1", "label2")), - com.azure.core.util.Context.NONE); + public static void + eventSubscriptionsGetForCustomTopic(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .getWithResponse( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", + "examplesubscription1", com.azure.core.util.Context.NONE); } -} -``` - -### DomainTopicEventSubscriptions_CreateOrUpdate - -```java -import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; -import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination; -/** - * Samples for DomainTopicEventSubscriptions CreateOrUpdate. - */ -public final class DomainTopicEventSubscriptionsCreateOrUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * DomainTopicEventSubscriptions_CreateOrUpdate.json + * EventSubscriptions_GetForCustomTopic_StorageQueueDestination.json */ /** - * Sample code: DomainTopicEventSubscriptions_CreateOrUpdate. + * Sample code: EventSubscriptions_GetForCustomTopic_StorageQueueDestination. * * @param manager Entry point to EventGridManager. */ - public static void - domainTopicEventSubscriptionsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domainTopicEventSubscriptions() - .createOrUpdate("examplerg", "exampleDomain1", "exampleDomainTopic1", "exampleEventSubscriptionName1", - new EventSubscriptionInner() - .withDestination( - new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") - .withSubjectEndsWith("ExampleSuffix") - .withIsSubjectCaseSensitive(false)), - com.azure.core.util.Context.NONE); + public static void eventSubscriptionsGetForCustomTopicStorageQueueDestination( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .getWithResponse( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", + "examplesubscription1", com.azure.core.util.Context.NONE); } -} -``` -### DomainTopicEventSubscriptions_Delete + /* + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * EventSubscriptions_GetForResource.json + */ + /** + * Sample code: EventSubscriptions_GetForResource. + * + * @param manager Entry point to EventGridManager. + */ + public static void eventSubscriptionsGetForResource(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .getWithResponse( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1", + "examplesubscription1", com.azure.core.util.Context.NONE); + } -```java -/** - * Samples for DomainTopicEventSubscriptions Delete. - */ -public final class DomainTopicEventSubscriptionsDeleteSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * DomainTopicEventSubscriptions_Delete.json + * EventSubscriptions_GetForCustomTopic_ServiceBusQueueDestination.json */ /** - * Sample code: DomainTopicEventSubscriptions_Delete. + * Sample code: EventSubscriptions_GetForCustomTopic_ServiceBusQueueDestination. * * @param manager Entry point to EventGridManager. */ - public static void - domainTopicEventSubscriptionsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domainTopicEventSubscriptions() - .delete("examplerg", "exampleDomain1", "exampleDomainTopic1", "examplesubscription1", - com.azure.core.util.Context.NONE); + public static void eventSubscriptionsGetForCustomTopicServiceBusQueueDestination( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .getWithResponse( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", + "examplesubscription1", com.azure.core.util.Context.NONE); } } ``` -### DomainTopicEventSubscriptions_Get +### DomainEventSubscriptions_CreateOrUpdate ```java /** - * Samples for DomainTopicEventSubscriptions Get. + * Samples for NamespaceTopicEventSubscriptions Delete. */ -public final class DomainTopicEventSubscriptionsGetSamples { +public final class NamespaceTopicEventSubscriptionsDeleteSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * DomainTopicEventSubscriptions_Get.json + * NamespaceTopicEventSubscriptions_Delete.json */ /** - * Sample code: DomainTopicEventSubscriptions_Get. + * Sample code: NamespaceTopicEventSubscriptions_Delete. * * @param manager Entry point to EventGridManager. */ - public static void domainTopicEventSubscriptionsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domainTopicEventSubscriptions() - .getWithResponse("examplerg", "exampleDomain1", "exampleDomainTopic1", "examplesubscription1", + public static void + namespaceTopicEventSubscriptionsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.namespaceTopicEventSubscriptions() + .delete("examplerg", "examplenamespace2", "examplenamespacetopic2", "examplenamespacetopicEventSub2", com.azure.core.util.Context.NONE); } } ``` -### DomainTopicEventSubscriptions_GetDeliveryAttributes +### DomainEventSubscriptions_Delete ```java /** - * Samples for DomainTopicEventSubscriptions GetDeliveryAttributes. + * Samples for PartnerNamespaces Delete. */ -public final class DomainTopicEventSubscriptionsGetDeliveryAttributesSamples { +public final class PartnerNamespacesDeleteSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * DomainTopicEventSubscriptions_GetDeliveryAttributes.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerNamespaces_Delete. + * json */ /** - * Sample code: DomainTopicEventSubscriptions_GetDeliveryAttributes. + * Sample code: PartnerNamespaces_Delete. * * @param manager Entry point to EventGridManager. */ - public static void domainTopicEventSubscriptionsGetDeliveryAttributes( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domainTopicEventSubscriptions() - .getDeliveryAttributesWithResponse("examplerg", "exampleDomain1", "exampleDomainTopic1", - "examplesubscription1", com.azure.core.util.Context.NONE); + public static void partnerNamespacesDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerNamespaces() + .delete("examplerg", "examplePartnerNamespaceName1", com.azure.core.util.Context.NONE); } } ``` -### DomainTopicEventSubscriptions_GetFullUrl +### DomainEventSubscriptions_Get ```java +import com.azure.resourcemanager.eventgrid.models.PrivateEndpointConnectionsParentType; + /** - * Samples for DomainTopicEventSubscriptions GetFullUrl. + * Samples for PrivateEndpointConnections ListByResource. */ -public final class DomainTopicEventSubscriptionsGetFullUrlSamples { +public final class PrivateEndpointConnectionsListByResourceSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * DomainTopicEventSubscriptions_GetFullUrl.json + * PrivateEndpointConnections_ListByResource.json */ /** - * Sample code: DomainTopicEventSubscriptions_GetFullUrl. + * Sample code: PrivateEndpointConnections_ListByResource. * * @param manager Entry point to EventGridManager. */ public static void - domainTopicEventSubscriptionsGetFullUrl(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domainTopicEventSubscriptions() - .getFullUrlWithResponse("examplerg", "exampleDomain1", "exampleDomainTopic1", "examplesubscription1", + privateEndpointConnectionsListByResource(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.privateEndpointConnections() + .listByResource("examplerg", PrivateEndpointConnectionsParentType.TOPICS, "exampletopic1", null, null, com.azure.core.util.Context.NONE); } } ``` -### DomainTopicEventSubscriptions_List +### DomainEventSubscriptions_GetDeliveryAttributes ```java /** - * Samples for DomainTopicEventSubscriptions List. + * Samples for EventSubscriptions ListRegionalByResourceGroupForTopicType. */ -public final class DomainTopicEventSubscriptionsListSamples { +public final class EventSubscriptionsListRegionalByResourceGroupForTopicTypeSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * DomainTopicEventSubscriptions_List.json + * EventSubscriptions_ListRegionalByResourceGroupForTopicType.json */ /** - * Sample code: DomainTopicEventSubscriptions_List. + * Sample code: EventSubscriptions_ListRegionalByResourceGroupForTopicType. * * @param manager Entry point to EventGridManager. */ - public static void domainTopicEventSubscriptionsList(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domainTopicEventSubscriptions() - .list("examplerg", "exampleDomain1", "exampleDomainTopic1", null, null, com.azure.core.util.Context.NONE); + public static void eventSubscriptionsListRegionalByResourceGroupForTopicType( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .listRegionalByResourceGroupForTopicType("examplerg", "westus2", "Microsoft.EventHub.namespaces", null, + null, com.azure.core.util.Context.NONE); } } ``` -### DomainTopicEventSubscriptions_Update +### DomainEventSubscriptions_GetFullUrl ```java -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters; -import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination; -import java.util.Arrays; +import com.azure.resourcemanager.eventgrid.models.PartnerNamespaceRegenerateKeyRequest; /** - * Samples for DomainTopicEventSubscriptions Update. + * Samples for PartnerNamespaces RegenerateKey. */ -public final class DomainTopicEventSubscriptionsUpdateSamples { +public final class PartnerNamespacesRegenerateKeySamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * DomainTopicEventSubscriptions_Update.json + * PartnerNamespaces_RegenerateKey.json */ /** - * Sample code: DomainTopicEventSubscriptions_Update. + * Sample code: PartnerNamespaces_RegenerateKey. * * @param manager Entry point to EventGridManager. */ - public static void - domainTopicEventSubscriptionsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domainTopicEventSubscriptions() - .update("examplerg", "exampleDomain1", "exampleDomainTopic1", "exampleEventSubscriptionName1", - new EventSubscriptionUpdateParameters() - .withDestination( - new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") - .withSubjectEndsWith("newSuffix") - .withIsSubjectCaseSensitive(true)) - .withLabels(Arrays.asList("label1", "label2")), + public static void partnerNamespacesRegenerateKey(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerNamespaces() + .regenerateKeyWithResponse("examplerg", "examplePartnerNamespaceName1", + new PartnerNamespaceRegenerateKeyRequest().withKeyName("fakeTokenPlaceholder"), com.azure.core.util.Context.NONE); } } ``` -### DomainTopics_CreateOrUpdate - -```java -/** - * Samples for DomainTopics CreateOrUpdate. - */ -public final class DomainTopicsCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * DomainTopics_CreateOrUpdate.json - */ - /** - * Sample code: DomainTopics_CreateOrUpdate. - * - * @param manager Entry point to EventGridManager. - */ - public static void domainTopicsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domainTopics() - .createOrUpdate("examplerg", "exampledomain1", "exampledomaintopic1", com.azure.core.util.Context.NONE); - } -} -``` - -### DomainTopics_Delete - -```java -/** - * Samples for DomainTopics Delete. - */ -public final class DomainTopicsDeleteSamples { - /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainTopics_Delete.json - */ - /** - * Sample code: DomainTopics_Delete. - * - * @param manager Entry point to EventGridManager. - */ - public static void domainTopicsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domainTopics() - .delete("examplerg", "exampledomain1", "exampledomaintopic1", com.azure.core.util.Context.NONE); - } -} -``` - -### DomainTopics_Get +### DomainEventSubscriptions_List ```java /** - * Samples for DomainTopics Get. + * Samples for Clients ListByNamespace. */ -public final class DomainTopicsGetSamples { +public final class ClientsListByNamespaceSamples { /* * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainTopics_Get.json + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Clients_ListByNamespace. + * json */ /** - * Sample code: DomainTopics_Get. + * Sample code: Clients_ListByNamespace. * * @param manager Entry point to EventGridManager. */ - public static void domainTopicsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domainTopics() - .getWithResponse("examplerg", "exampledomain2", "topic1", com.azure.core.util.Context.NONE); + public static void clientsListByNamespace(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.clients().listByNamespace("examplerg", "namespace123", null, null, com.azure.core.util.Context.NONE); } } ``` -### DomainTopics_ListByDomain +### DomainEventSubscriptions_Update ```java /** - * Samples for DomainTopics ListByDomain. + * Samples for Domains List. */ -public final class DomainTopicsListByDomainSamples { +public final class DomainsListSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainTopics_ListByDomain - * .json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * Domains_ListBySubscription.json */ /** - * Sample code: DomainTopics_ListByDomain. + * Sample code: Domains_ListBySubscription. * * @param manager Entry point to EventGridManager. */ - public static void domainTopicsListByDomain(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domainTopics() - .listByDomain("examplerg", "exampledomain2", null, null, com.azure.core.util.Context.NONE); + public static void domainsListBySubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domains().list(null, null, com.azure.core.util.Context.NONE); } } ``` -### Domains_CreateOrUpdate +### DomainTopicEventSubscriptions_CreateOrUpdate ```java -import com.azure.resourcemanager.eventgrid.models.InboundIpRule; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import java.util.Arrays; +import com.azure.resourcemanager.eventgrid.models.TopicSpacesConfiguration; +import com.azure.resourcemanager.eventgrid.models.TopicSpacesConfigurationState; import java.util.HashMap; import java.util.Map; /** - * Samples for Domains CreateOrUpdate. + * Samples for Namespaces CreateOrUpdate. */ -public final class DomainsCreateOrUpdateSamples { +public final class NamespacesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Domains_CreateOrUpdate. - * json + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Namespaces_CreateOrUpdate + * .json */ /** - * Sample code: Domains_CreateOrUpdate. + * Sample code: Namespaces_CreateOrUpdate. * * @param manager Entry point to EventGridManager. */ - public static void domainsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domains() - .define("exampledomain1") - .withRegion("westus2") + public static void namespacesCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.namespaces() + .define("exampleNamespaceName1") + .withRegion("westus") .withExistingResourceGroup("examplerg") - .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withInboundIpRules( - Arrays.asList(new InboundIpRule().withIpMask("12.18.30.15").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("12.18.176.1").withAction(IpActionType.ALLOW))) + .withTags(mapOf("tag1", "value11", "tag2", "value22")) + .withTopicSpacesConfiguration(new TopicSpacesConfiguration() + .withState(TopicSpacesConfigurationState.ENABLED) + .withRouteTopicResourceId( + "/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampleTopic1")) .create(); } @@ -1269,180 +1160,188 @@ public final class DomainsCreateOrUpdateSamples { } ``` -### Domains_Delete +### DomainTopicEventSubscriptions_Delete ```java /** - * Samples for Domains Delete. + * Samples for Topics Delete. */ -public final class DomainsDeleteSamples { +public final class TopicsDeleteSamples { /* * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Domains_Delete.json + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_Delete.json */ /** - * Sample code: Domains_Delete. + * Sample code: Topics_Delete. * * @param manager Entry point to EventGridManager. */ - public static void domainsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domains().delete("examplerg", "exampledomain1", com.azure.core.util.Context.NONE); + public static void topicsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.topics().delete("examplerg", "exampletopic", com.azure.core.util.Context.NONE); } } ``` -### Domains_GetByResourceGroup +### DomainTopicEventSubscriptions_Get ```java /** - * Samples for Domains GetByResourceGroup. + * Samples for PermissionBindings Delete. */ -public final class DomainsGetByResourceGroupSamples { +public final class PermissionBindingsDeleteSamples { /* * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Domains_Get.json + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PermissionBindings_Delete + * .json */ /** - * Sample code: Domains_Get. + * Sample code: PermissionBindings_Delete. * * @param manager Entry point to EventGridManager. */ - public static void domainsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domains() - .getByResourceGroupWithResponse("examplerg", "exampledomain2", com.azure.core.util.Context.NONE); + public static void permissionBindingsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.permissionBindings() + .delete("examplerg", "exampleNamespaceName1", "examplePermissionBindingName1", + com.azure.core.util.Context.NONE); } } ``` -### Domains_List +### DomainTopicEventSubscriptions_GetDeliveryAttributes ```java /** - * Samples for Domains List. + * Samples for NamespaceTopics Get. */ -public final class DomainsListSamples { +public final class NamespaceTopicsGetSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * Domains_ListBySubscription.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/NamespaceTopics_Get.json */ /** - * Sample code: Domains_ListBySubscription. + * Sample code: NamespaceTopics_Get. * * @param manager Entry point to EventGridManager. */ - public static void domainsListBySubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domains().list(null, null, com.azure.core.util.Context.NONE); + public static void namespaceTopicsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.namespaceTopics() + .getWithResponse("examplerg", "examplenamespace2", "examplenamespacetopic2", + com.azure.core.util.Context.NONE); } } ``` -### Domains_ListByResourceGroup +### DomainTopicEventSubscriptions_GetFullUrl ```java +import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner; +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; +import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination; + /** - * Samples for Domains ListByResourceGroup. + * Samples for DomainEventSubscriptions CreateOrUpdate. */ -public final class DomainsListByResourceGroupSamples { +public final class DomainEventSubscriptionsCreateOrUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * Domains_ListByResourceGroup.json + * DomainEventSubscriptions_CreateOrUpdate.json */ /** - * Sample code: Domains_ListByResourceGroup. + * Sample code: DomainEventSubscriptions_CreateOrUpdate. * * @param manager Entry point to EventGridManager. */ - public static void domainsListByResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domains().listByResourceGroup("examplerg", null, null, com.azure.core.util.Context.NONE); + public static void + domainEventSubscriptionsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domainEventSubscriptions() + .createOrUpdate("examplerg", "exampleDomain1", "exampleEventSubscriptionName1", + new EventSubscriptionInner() + .withDestination( + new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") + .withSubjectEndsWith("ExampleSuffix") + .withIsSubjectCaseSensitive(false)), + com.azure.core.util.Context.NONE); } } ``` -### Domains_ListSharedAccessKeys +### DomainTopicEventSubscriptions_List ```java /** - * Samples for Domains ListSharedAccessKeys. + * Samples for EventSubscriptions ListGlobalByResourceGroupForTopicType. */ -public final class DomainsListSharedAccessKeysSamples { +public final class EventSubscriptionsListGlobalByResourceGroupForTopicTypeSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * Domains_ListSharedAccessKeys.json + * EventSubscriptions_ListGlobalByResourceGroupForTopicType.json */ /** - * Sample code: Domains_ListSharedAccessKeys. + * Sample code: EventSubscriptions_ListGlobalByResourceGroupForTopicType. * * @param manager Entry point to EventGridManager. */ - public static void domainsListSharedAccessKeys(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domains() - .listSharedAccessKeysWithResponse("examplerg", "exampledomain2", com.azure.core.util.Context.NONE); + public static void eventSubscriptionsListGlobalByResourceGroupForTopicType( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .listGlobalByResourceGroupForTopicType("examplerg", "Microsoft.Resources.ResourceGroups", null, null, + com.azure.core.util.Context.NONE); } } ``` -### Domains_RegenerateKey +### DomainTopicEventSubscriptions_Update ```java -import com.azure.resourcemanager.eventgrid.models.DomainRegenerateKeyRequest; - /** - * Samples for Domains RegenerateKey. + * Samples for TopicEventSubscriptions Get. */ -public final class DomainsRegenerateKeySamples { +public final class TopicEventSubscriptionsGetSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Domains_RegenerateKey. - * json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * TopicEventSubscriptions_Get.json */ /** - * Sample code: Domains_RegenerateKey. + * Sample code: TopicEventSubscriptions_Get. * * @param manager Entry point to EventGridManager. */ - public static void domainsRegenerateKey(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.domains() - .regenerateKeyWithResponse("examplerg", "exampledomain2", - new DomainRegenerateKeyRequest().withKeyName("fakeTokenPlaceholder"), com.azure.core.util.Context.NONE); + public static void topicEventSubscriptionsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.topicEventSubscriptions() + .getWithResponse("examplerg", "exampleTopic1", "examplesubscription1", com.azure.core.util.Context.NONE); } } ``` -### Domains_Update +### DomainTopics_CreateOrUpdate ```java -import com.azure.resourcemanager.eventgrid.models.Domain; -import com.azure.resourcemanager.eventgrid.models.InboundIpRule; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import java.util.Arrays; import java.util.HashMap; import java.util.Map; /** - * Samples for Domains Update. + * Samples for PartnerNamespaces CreateOrUpdate. */ -public final class DomainsUpdateSamples { +public final class PartnerNamespacesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Domains_Update.json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * PartnerNamespaces_CreateOrUpdate.json */ /** - * Sample code: Domains_Update. + * Sample code: PartnerNamespaces_CreateOrUpdate. * * @param manager Entry point to EventGridManager. */ - public static void domainsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - Domain resource = manager.domains() - .getByResourceGroupWithResponse("examplerg", "exampledomain1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() + public static void partnerNamespacesCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerNamespaces() + .define("examplePartnerNamespaceName1") + .withRegion("westus") + .withExistingResourceGroup("examplerg") .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withInboundIpRules( - Arrays.asList(new InboundIpRule().withIpMask("12.18.30.15").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("12.18.176.1").withAction(IpActionType.ALLOW))) - .apply(); + .withPartnerRegistrationFullyQualifiedId( + "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerRegistrations/ContosoCorpAccount1") + .create(); } // Use "Map.of" if available @@ -1459,1650 +1358,1863 @@ public final class DomainsUpdateSamples { } ``` -### EventSubscriptions_CreateOrUpdate +### DomainTopics_Delete ```java -import com.azure.resourcemanager.eventgrid.models.AzureFunctionEventSubscriptionDestination; -import com.azure.resourcemanager.eventgrid.models.EventHubEventSubscriptionDestination; +import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner; import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; -import com.azure.resourcemanager.eventgrid.models.HybridConnectionEventSubscriptionDestination; -import com.azure.resourcemanager.eventgrid.models.ServiceBusQueueEventSubscriptionDestination; -import com.azure.resourcemanager.eventgrid.models.ServiceBusTopicEventSubscriptionDestination; -import com.azure.resourcemanager.eventgrid.models.StorageBlobDeadLetterDestination; -import com.azure.resourcemanager.eventgrid.models.StorageQueueEventSubscriptionDestination; import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination; /** - * Samples for EventSubscriptions CreateOrUpdate. + * Samples for PartnerTopicEventSubscriptions CreateOrUpdate. */ -public final class EventSubscriptionsCreateOrUpdateSamples { +public final class PartnerTopicEventSubscriptionsCreateOrUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_CreateOrUpdateForCustomTopic_WebhookDestination.json + * PartnerTopicEventSubscriptions_CreateOrUpdate.json */ /** - * Sample code: EventSubscriptions_CreateOrUpdateForCustomTopic_WebhookDestination. + * Sample code: PartnerTopicEventSubscriptions_CreateOrUpdate. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsCreateOrUpdateForCustomTopicWebhookDestination( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .define("examplesubscription1") - .withExistingScope( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1") - .withDestination(new WebhookEventSubscriptionDestination().withEndpointUrl( - "https://azurefunctionexample.azurewebsites.net/runtime/webhooks/EventGrid?functionName=EventGridTrigger1&code=PASSWORDCODE")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") - .withSubjectEndsWith("ExampleSuffix") - .withIsSubjectCaseSensitive(false)) - .create(); + public static void + partnerTopicEventSubscriptionsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerTopicEventSubscriptions() + .createOrUpdate("examplerg", "examplePartnerTopic1", "exampleEventSubscriptionName1", + new EventSubscriptionInner() + .withDestination( + new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") + .withSubjectEndsWith("ExampleSuffix") + .withIsSubjectCaseSensitive(false)), + com.azure.core.util.Context.NONE); } +} +``` + +### DomainTopics_Get +```java +/** + * Samples for Topics ListEventTypes. + */ +public final class TopicsListEventTypesSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_CreateOrUpdateForSubscription.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_ListEventTypes. + * json */ /** - * Sample code: EventSubscriptions_CreateOrUpdateForSubscription. + * Sample code: Topics_ListEventTypes. * * @param manager Entry point to EventGridManager. */ - public static void - eventSubscriptionsCreateOrUpdateForSubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .define("examplesubscription3") - .withExistingScope("subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4") - .withDestination(new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) - .withFilter(new EventSubscriptionFilter().withIsSubjectCaseSensitive(false)) - .create(); + public static void topicsListEventTypes(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.topics() + .listEventTypes("examplerg", "Microsoft.Storage", "storageAccounts", "ExampleStorageAccount", + com.azure.core.util.Context.NONE); } +} +``` + +### DomainTopics_ListByDomain +```java +/** + * Samples for PartnerConfigurations List. + */ +public final class PartnerConfigurationsListSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_CreateOrUpdateForCustomTopic_ServiceBusTopicDestination.json + * PartnerConfigurations_ListBySubscription.json */ /** - * Sample code: EventSubscriptions_CreateOrUpdateForCustomTopic_ServiceBusTopicDestination. + * Sample code: PartnerConfigurations_ListBySubscription. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsCreateOrUpdateForCustomTopicServiceBusTopicDestination( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .define("examplesubscription1") - .withExistingScope( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1") - .withDestination(new ServiceBusTopicEventSubscriptionDestination().withResourceId( - "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/topics/SBT")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") - .withSubjectEndsWith("ExampleSuffix") - .withIsSubjectCaseSensitive(false)) - .withDeadLetterDestination(new StorageBlobDeadLetterDestination().withResourceId( - "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg") - .withBlobContainerName("contosocontainer")) - .create(); + public static void + partnerConfigurationsListBySubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerConfigurations().list(null, null, com.azure.core.util.Context.NONE); } +} +``` + +### Domains_CreateOrUpdate +```java +/** + * Samples for SystemTopicEventSubscriptions Delete. + */ +public final class SystemTopicEventSubscriptionsDeleteSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_CreateOrUpdateForResource.json + * SystemTopicEventSubscriptions_Delete.json */ /** - * Sample code: EventSubscriptions_CreateOrUpdateForResource. + * Sample code: SystemTopicEventSubscriptions_Delete. * * @param manager Entry point to EventGridManager. */ public static void - eventSubscriptionsCreateOrUpdateForResource(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .define("examplesubscription10") - .withExistingScope( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1") - .withDestination(new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") - .withSubjectEndsWith("ExampleSuffix") - .withIsSubjectCaseSensitive(false)) - .create(); + systemTopicEventSubscriptionsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.systemTopicEventSubscriptions() + .delete("examplerg", "exampleSystemTopic1", "examplesubscription1", com.azure.core.util.Context.NONE); } +} +``` + +### Domains_Delete +```java +/** + * Samples for NamespaceTopicEventSubscriptions GetDeliveryAttributes. + */ +public final class NamespaceTopicEventSubscriptionsGetDeliveryAttributesSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_CreateOrUpdateForCustomTopic.json + * NamespaceTopicEventSubscriptions_GetDeliveryAttributes.json */ /** - * Sample code: EventSubscriptions_CreateOrUpdateForCustomTopic. + * Sample code: NamespaceTopicEventSubscriptions_GetDeliveryAttributes. * * @param manager Entry point to EventGridManager. */ - public static void - eventSubscriptionsCreateOrUpdateForCustomTopic(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .define("examplesubscription1") - .withExistingScope( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1") - .withDestination(new EventHubEventSubscriptionDestination().withResourceId( - "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") - .withSubjectEndsWith("ExampleSuffix") - .withIsSubjectCaseSensitive(false)) - .create(); + public static void namespaceTopicEventSubscriptionsGetDeliveryAttributes( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.namespaceTopicEventSubscriptions() + .getDeliveryAttributesWithResponse("examplerg", "exampleNamespace", "exampleNamespaceTopic", + "exampleEventSubscriptionName", com.azure.core.util.Context.NONE); } +} +``` + +### Domains_GetByResourceGroup + +```java +import com.azure.resourcemanager.eventgrid.fluent.models.PartnerConfigurationInner; +import com.azure.resourcemanager.eventgrid.models.Partner; +import com.azure.resourcemanager.eventgrid.models.PartnerAuthorization; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.UUID; +/** + * Samples for PartnerConfigurations CreateOrUpdate. + */ +public final class PartnerConfigurationsCreateOrUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_CreateOrUpdateForResourceGroup.json + * PartnerConfigurations_CreateOrUpdate.json */ /** - * Sample code: EventSubscriptions_CreateOrUpdateForResourceGroup. + * Sample code: PartnerConfigurations_CreateOrUpdate. * * @param manager Entry point to EventGridManager. */ public static void - eventSubscriptionsCreateOrUpdateForResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .define("examplesubscription2") - .withExistingScope("subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg") - .withDestination(new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") - .withSubjectEndsWith("ExampleSuffix") - .withIsSubjectCaseSensitive(false)) - .create(); + partnerConfigurationsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerConfigurations() + .createOrUpdate("examplerg", + new PartnerConfigurationInner() + .withPartnerAuthorization(new PartnerAuthorization().withDefaultMaximumExpirationTimeInDays(10) + .withAuthorizedPartnersList(Arrays.asList( + new Partner() + .withPartnerRegistrationImmutableId( + UUID.fromString("941892bc-f5d0-4d1c-8fb5-477570fc2b71")) + .withPartnerName("Contoso.Finance") + .withAuthorizationExpirationTimeInUtc(OffsetDateTime.parse("2022-01-28T01:20:55.142Z")), + new Partner() + .withPartnerRegistrationImmutableId( + UUID.fromString("5362bdb6-ce3e-4d0d-9a5b-3eb92c8aab38")) + .withPartnerName("fabrikam.HR") + .withAuthorizationExpirationTimeInUtc( + OffsetDateTime.parse("2022-02-20T01:00:00.142Z"))))), + com.azure.core.util.Context.NONE); } +} +``` +### Domains_List + +```java +/** + * Samples for EventSubscriptions ListByDomainTopic. + */ +public final class EventSubscriptionsListByDomainTopicSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_CreateOrUpdateForCustomTopic_EventHubDestination.json + * EventSubscriptions_ListByDomainTopic.json */ /** - * Sample code: EventSubscriptions_CreateOrUpdateForCustomTopic_EventHubDestination. + * Sample code: EventSubscriptions_ListByDomainTopic. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsCreateOrUpdateForCustomTopicEventHubDestination( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { + public static void + eventSubscriptionsListByDomainTopic(com.azure.resourcemanager.eventgrid.EventGridManager manager) { manager.eventSubscriptions() - .define("examplesubscription1") - .withExistingScope( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1") - .withDestination(new EventHubEventSubscriptionDestination().withResourceId( - "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") - .withSubjectEndsWith("ExampleSuffix") - .withIsSubjectCaseSensitive(false)) - .withDeadLetterDestination(new StorageBlobDeadLetterDestination().withResourceId( - "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg") - .withBlobContainerName("contosocontainer")) - .create(); + .listByDomainTopic("examplerg", "domain1", "topic1", null, null, com.azure.core.util.Context.NONE); } +} +``` + +### Domains_ListByResourceGroup + +```java +import com.azure.resourcemanager.eventgrid.models.DeliveryConfiguration; +import com.azure.resourcemanager.eventgrid.models.DeliveryMode; +import com.azure.resourcemanager.eventgrid.models.DeliverySchema; +import com.azure.resourcemanager.eventgrid.models.QueueInfo; +import com.azure.resourcemanager.eventgrid.models.Subscription; +import java.time.Duration; +/** + * Samples for NamespaceTopicEventSubscriptions Update. + */ +public final class NamespaceTopicEventSubscriptionsUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_CreateOrUpdateForCustomTopic_StorageQueueDestination.json + * NamespaceTopicEventSubscriptions_Update.json */ /** - * Sample code: EventSubscriptions_CreateOrUpdateForCustomTopic_StorageQueueDestination. + * Sample code: NamespaceTopicEventSubscriptions_Update. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsCreateOrUpdateForCustomTopicStorageQueueDestination( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .define("examplesubscription1") - .withExistingScope( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1") - .withDestination(new StorageQueueEventSubscriptionDestination().withResourceId( - "/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg") - .withQueueName("queue1")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") - .withSubjectEndsWith("ExampleSuffix") - .withIsSubjectCaseSensitive(false)) - .withDeadLetterDestination(new StorageBlobDeadLetterDestination().withResourceId( - "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg") - .withBlobContainerName("contosocontainer")) - .create(); + public static void + namespaceTopicEventSubscriptionsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + Subscription resource = manager.namespaceTopicEventSubscriptions() + .getWithResponse("examplerg", "exampleNamespaceName1", "exampleNamespaceTopicName1", + "exampleNamespaceTopicEventSubscriptionName1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withDeliveryConfiguration(new DeliveryConfiguration().withDeliveryMode(DeliveryMode.QUEUE) + .withQueue(new QueueInfo().withReceiveLockDurationInSeconds(60) + .withMaxDeliveryCount(3) + .withEventTimeToLive(Duration.parse("P1D")))) + .withEventDeliverySchema(DeliverySchema.CLOUD_EVENT_SCHEMA_V1_0) + .apply(); } +} +``` + +### Domains_ListSharedAccessKeys +```java +/** + * Samples for Topics ListByResourceGroup. + */ +public final class TopicsListByResourceGroupSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_CreateOrUpdateForCustomTopic_AzureFunctionDestination.json + * Topics_ListByResourceGroup.json */ /** - * Sample code: EventSubscriptions_CreateOrUpdateForCustomTopic_AzureFunctionDestination. + * Sample code: Topics_ListByResourceGroup. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsCreateOrUpdateForCustomTopicAzureFunctionDestination( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .define("examplesubscription1") - .withExistingScope( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1") - .withDestination(new AzureFunctionEventSubscriptionDestination().withResourceId( - "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Web/sites/ContosoSite/funtions/ContosoFunc")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") - .withSubjectEndsWith("ExampleSuffix") - .withIsSubjectCaseSensitive(false)) - .withDeadLetterDestination(new StorageBlobDeadLetterDestination().withResourceId( - "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg") - .withBlobContainerName("contosocontainer")) - .create(); + public static void topicsListByResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.topics().listByResourceGroup("examplerg", null, null, com.azure.core.util.Context.NONE); } +} +``` + +### Domains_RegenerateKey + +```java +import com.azure.resourcemanager.eventgrid.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.eventgrid.models.ConnectionState; +import com.azure.resourcemanager.eventgrid.models.PersistedConnectionStatus; +import com.azure.resourcemanager.eventgrid.models.PrivateEndpointConnectionsParentType; +/** + * Samples for PrivateEndpointConnections Update. + */ +public final class PrivateEndpointConnectionsUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_CreateOrUpdateForCustomTopic_HybridConnectionDestination.json + * PrivateEndpointConnections_Update.json */ /** - * Sample code: EventSubscriptions_CreateOrUpdateForCustomTopic_HybridConnectionDestination. + * Sample code: PrivateEndpointConnections_Update. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsCreateOrUpdateForCustomTopicHybridConnectionDestination( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .define("examplesubscription1") - .withExistingScope( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1") - .withDestination(new HybridConnectionEventSubscriptionDestination().withResourceId( - "/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Relay/namespaces/ContosoNamespace/hybridConnections/HC1")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") - .withSubjectEndsWith("ExampleSuffix") - .withIsSubjectCaseSensitive(false)) - .withDeadLetterDestination(new StorageBlobDeadLetterDestination().withResourceId( - "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg") - .withBlobContainerName("contosocontainer")) - .create(); + public static void privateEndpointConnectionsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.privateEndpointConnections() + .update("examplerg", PrivateEndpointConnectionsParentType.TOPICS, "exampletopic1", + "BMTPE5.8A30D251-4C61-489D-A1AA-B37C4A329B8B", + new PrivateEndpointConnectionInner().withPrivateLinkServiceConnectionState( + new ConnectionState().withStatus(PersistedConnectionStatus.APPROVED) + .withDescription("approving connection") + .withActionsRequired("None")), + com.azure.core.util.Context.NONE); } +} +``` + +### Domains_Update +```java +/** + * Samples for PartnerRegistrations Delete. + */ +public final class PartnerRegistrationsDeleteSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_CreateOrUpdateForCustomTopic_ServiceBusQueueDestination.json + * PartnerRegistrations_Delete.json */ /** - * Sample code: EventSubscriptions_CreateOrUpdateForCustomTopic_ServiceBusQueueDestination. + * Sample code: PartnerRegistrations_Delete. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsCreateOrUpdateForCustomTopicServiceBusQueueDestination( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .define("examplesubscription1") - .withExistingScope( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1") - .withDestination(new ServiceBusQueueEventSubscriptionDestination().withResourceId( - "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/queues/SBQ")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") - .withSubjectEndsWith("ExampleSuffix") - .withIsSubjectCaseSensitive(false)) - .withDeadLetterDestination(new StorageBlobDeadLetterDestination().withResourceId( - "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg") - .withBlobContainerName("contosocontainer")) - .create(); + public static void partnerRegistrationsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerRegistrations() + .delete("examplerg", "examplePartnerRegistrationName1", com.azure.core.util.Context.NONE); } } ``` -### EventSubscriptions_Delete +### EventSubscriptions_CreateOrUpdate ```java /** - * Samples for EventSubscriptions Delete. + * Samples for PartnerTopicEventSubscriptions Get. */ -public final class EventSubscriptionsDeleteSamples { +public final class PartnerTopicEventSubscriptionsGetSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_DeleteForCustomTopic.json + * PartnerTopicEventSubscriptions_Get.json */ /** - * Sample code: EventSubscriptions_DeleteForCustomTopic. + * Sample code: PartnerTopicEventSubscriptions_Get. * * @param manager Entry point to EventGridManager. */ - public static void - eventSubscriptionsDeleteForCustomTopic(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .delete( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1", - "examplesubscription1", com.azure.core.util.Context.NONE); + public static void partnerTopicEventSubscriptionsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerTopicEventSubscriptions() + .getWithResponse("examplerg", "examplePartnerTopic1", "examplesubscription1", + com.azure.core.util.Context.NONE); } +} +``` + +### EventSubscriptions_Delete +```java +/** + * Samples for EventSubscriptions ListRegionalBySubscriptionForTopicType. + */ +public final class EventSubscriptionsListRegionalBySubscriptionForTopicTypeSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_DeleteForResourceGroup.json + * EventSubscriptions_ListRegionalBySubscriptionForTopicType.json */ /** - * Sample code: EventSubscriptions_DeleteForResourceGroup. + * Sample code: EventSubscriptions_ListRegionalBySubscriptionForTopicType. * * @param manager Entry point to EventGridManager. */ - public static void - eventSubscriptionsDeleteForResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + public static void eventSubscriptionsListRegionalBySubscriptionForTopicType( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { manager.eventSubscriptions() - .delete("subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg", - "examplesubscription2", com.azure.core.util.Context.NONE); + .listRegionalBySubscriptionForTopicType("westus2", "Microsoft.EventHub.namespaces", null, null, + com.azure.core.util.Context.NONE); } +} +``` + +### EventSubscriptions_Get +```java +/** + * Samples for PartnerTopicEventSubscriptions GetDeliveryAttributes. + */ +public final class PartnerTopicEventSubscriptionsGetDeliveryAttributesSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_DeleteForSubscription.json + * PartnerTopicEventSubscriptions_GetDeliveryAttributes.json */ /** - * Sample code: EventSubscriptions_DeleteForSubscription. + * Sample code: PartnerTopicEventSubscriptions_GetDeliveryAttributes. * * @param manager Entry point to EventGridManager. */ - public static void - eventSubscriptionsDeleteForSubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .delete("subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4", "examplesubscription3", + public static void partnerTopicEventSubscriptionsGetDeliveryAttributes( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerTopicEventSubscriptions() + .getDeliveryAttributesWithResponse("examplerg", "examplePartnerTopic1", "examplesubscription1", com.azure.core.util.Context.NONE); } +} +``` +### EventSubscriptions_GetDeliveryAttributes + +```java +/** + * Samples for EventSubscriptions ListGlobalBySubscriptionForTopicType. + */ +public final class EventSubscriptionsListGlobalBySubscriptionForTopicTypeSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_DeleteForResource.json + * EventSubscriptions_ListGlobalBySubscriptionForTopicType.json */ /** - * Sample code: EventSubscriptions_DeleteForResource. + * Sample code: EventSubscriptions_ListGlobalBySubscriptionForTopicType. * * @param manager Entry point to EventGridManager. */ - public static void - eventSubscriptionsDeleteForResource(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + public static void eventSubscriptionsListGlobalBySubscriptionForTopicType( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { manager.eventSubscriptions() - .delete( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1", - "examplesubscription10", com.azure.core.util.Context.NONE); + .listGlobalBySubscriptionForTopicType("Microsoft.Resources.Subscriptions", null, null, + com.azure.core.util.Context.NONE); } } ``` -### EventSubscriptions_Get +### EventSubscriptions_GetFullUrl ```java /** - * Samples for EventSubscriptions Get. + * Samples for ExtensionTopics Get. */ -public final class EventSubscriptionsGetSamples { +public final class ExtensionTopicsGetSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_GetForCustomTopic_HybridConnectionDestination.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ExtensionTopics_Get.json */ /** - * Sample code: EventSubscriptions_GetForCustomTopic_HybridConnectionDestination. + * Sample code: ExtensionTopics_Get. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsGetForCustomTopicHybridConnectionDestination( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() + public static void extensionTopicsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.extensionTopics() .getWithResponse( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", - "examplesubscription1", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_GetForCustomTopic_ServiceBusTopicDestination.json - */ - /** - * Sample code: EventSubscriptions_GetForCustomTopic_ServiceBusTopicDestination. - * - * @param manager Entry point to EventGridManager. - */ - public static void eventSubscriptionsGetForCustomTopicServiceBusTopicDestination( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .getWithResponse( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", - "examplesubscription1", com.azure.core.util.Context.NONE); + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.storage/storageaccounts/exampleResourceName/providers/Microsoft.eventgrid/extensionTopics/default", + com.azure.core.util.Context.NONE); } +} +``` +### EventSubscriptions_List + +```java +/** + * Samples for PartnerTopicEventSubscriptions GetFullUrl. + */ +public final class PartnerTopicEventSubscriptionsGetFullUrlSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_GetForResourceGroup.json + * PartnerTopicEventSubscriptions_GetFullUrl.json */ /** - * Sample code: EventSubscriptions_GetForResourceGroup. + * Sample code: PartnerTopicEventSubscriptions_GetFullUrl. * * @param manager Entry point to EventGridManager. */ public static void - eventSubscriptionsGetForResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .getWithResponse("subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg", - "examplesubscription2", com.azure.core.util.Context.NONE); + partnerTopicEventSubscriptionsGetFullUrl(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerTopicEventSubscriptions() + .getFullUrlWithResponse("examplerg", "examplePartnerTopic1", "examplesubscription1", + com.azure.core.util.Context.NONE); } +} +``` - /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_GetForCustomTopic_EventHubDestination.json - */ - /** - * Sample code: EventSubscriptions_GetForCustomTopic_EventHubDestination. - * - * @param manager Entry point to EventGridManager. - */ - public static void eventSubscriptionsGetForCustomTopicEventHubDestination( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .getWithResponse( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", - "examplesubscription1", com.azure.core.util.Context.NONE); - } +### EventSubscriptions_ListByDomainTopic +```java +/** + * Samples for DomainEventSubscriptions GetFullUrl. + */ +public final class DomainEventSubscriptionsGetFullUrlSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_GetForSubscription.json + * DomainEventSubscriptions_GetFullUrl.json */ /** - * Sample code: EventSubscriptions_GetForSubscription. + * Sample code: DomainEventSubscriptions_GetFullUrl. * * @param manager Entry point to EventGridManager. */ public static void - eventSubscriptionsGetForSubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .getWithResponse("subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4", "examplesubscription3", + domainEventSubscriptionsGetFullUrl(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domainEventSubscriptions() + .getFullUrlWithResponse("examplerg", "exampleDomain1", "examplesubscription1", com.azure.core.util.Context.NONE); } +} +``` + +### EventSubscriptions_ListByResource +```java +/** + * Samples for TopicSpaces Get. + */ +public final class TopicSpacesGetSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_GetForCustomTopic_WebhookDestination.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicSpaces_Get.json */ /** - * Sample code: EventSubscriptions_GetForCustomTopic_WebhookDestination. + * Sample code: TopicSpaces_Get. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsGetForCustomTopicWebhookDestination( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .getWithResponse( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", - "examplesubscription1", com.azure.core.util.Context.NONE); + public static void topicSpacesGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.topicSpaces() + .getWithResponse("examplerg", "exampleNamespaceName1", "exampleTopicSpaceName1", + com.azure.core.util.Context.NONE); } +} +``` +### EventSubscriptions_ListByResourceGroup + +```java +/** + * Samples for CaCertificates Get. + */ +public final class CaCertificatesGetSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_GetForCustomTopic_AzureFunctionDestination.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/CaCertificates_Get.json */ /** - * Sample code: EventSubscriptions_GetForCustomTopic_AzureFunctionDestination. + * Sample code: CaCertificates_Get. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsGetForCustomTopicAzureFunctionDestination( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .getWithResponse( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", - "examplesubscription1", com.azure.core.util.Context.NONE); + public static void caCertificatesGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.caCertificates() + .getWithResponse("examplerg", "exampleNamespaceName1", "exampleCACertificateName1", + com.azure.core.util.Context.NONE); } +} +``` + +### EventSubscriptions_ListGlobalByResourceGroupForTopicType +```java +/** + * Samples for PartnerConfigurations Delete. + */ +public final class PartnerConfigurationsDeleteSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_GetForCustomTopic.json + * PartnerConfigurations_Delete.json */ /** - * Sample code: EventSubscriptions_GetForCustomTopic. + * Sample code: PartnerConfigurations_Delete. * * @param manager Entry point to EventGridManager. */ - public static void - eventSubscriptionsGetForCustomTopic(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .getWithResponse( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", - "examplesubscription1", com.azure.core.util.Context.NONE); + public static void partnerConfigurationsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerConfigurations().delete("examplerg", com.azure.core.util.Context.NONE); } +} +``` + +### EventSubscriptions_ListGlobalBySubscriptionForTopicType +```java +/** + * Samples for SystemTopics GetByResourceGroup. + */ +public final class SystemTopicsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_GetForCustomTopic_StorageQueueDestination.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/SystemTopics_Get.json */ /** - * Sample code: EventSubscriptions_GetForCustomTopic_StorageQueueDestination. + * Sample code: SystemTopics_Get. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsGetForCustomTopicStorageQueueDestination( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .getWithResponse( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", - "examplesubscription1", com.azure.core.util.Context.NONE); + public static void systemTopicsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.systemTopics() + .getByResourceGroupWithResponse("examplerg", "exampleSystemTopic2", com.azure.core.util.Context.NONE); } +} +``` + +### EventSubscriptions_ListRegionalByResourceGroup + +```java +import com.azure.resourcemanager.eventgrid.models.Domain; +import com.azure.resourcemanager.eventgrid.models.InboundIpRule; +import com.azure.resourcemanager.eventgrid.models.IpActionType; +import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +/** + * Samples for Domains Update. + */ +public final class DomainsUpdateSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_GetForResource.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Domains_Update.json */ /** - * Sample code: EventSubscriptions_GetForResource. + * Sample code: Domains_Update. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsGetForResource(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .getWithResponse( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1", - "examplesubscription1", com.azure.core.util.Context.NONE); + public static void domainsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + Domain resource = manager.domains() + .getByResourceGroupWithResponse("examplerg", "exampledomain1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) + .withInboundIpRules( + Arrays.asList(new InboundIpRule().withIpMask("12.18.30.15").withAction(IpActionType.ALLOW), + new InboundIpRule().withIpMask("12.18.176.1").withAction(IpActionType.ALLOW))) + .apply(); } - /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_GetForCustomTopic_ServiceBusQueueDestination.json - */ - /** - * Sample code: EventSubscriptions_GetForCustomTopic_ServiceBusQueueDestination. - * - * @param manager Entry point to EventGridManager. - */ - public static void eventSubscriptionsGetForCustomTopicServiceBusQueueDestination( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .getWithResponse( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", - "examplesubscription1", com.azure.core.util.Context.NONE); + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### EventSubscriptions_GetDeliveryAttributes +### EventSubscriptions_ListRegionalByResourceGroupForTopicType ```java /** - * Samples for EventSubscriptions GetDeliveryAttributes. + * Samples for ClientGroups Get. */ -public final class EventSubscriptionsGetDeliveryAttributesSamples { +public final class ClientGroupsGetSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_GetDeliveryAttributes.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ClientGroups_Get.json */ /** - * Sample code: EventSubscriptions_GetDeliveryAttributes. + * Sample code: ClientGroups_Get. * * @param manager Entry point to EventGridManager. */ - public static void - eventSubscriptionsGetDeliveryAttributes(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .getDeliveryAttributesWithResponse("aaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaa", + public static void clientGroupsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.clientGroups() + .getWithResponse("examplerg", "exampleNamespaceName1", "exampleClientGroupName1", com.azure.core.util.Context.NONE); } } ``` -### EventSubscriptions_GetFullUrl +### EventSubscriptions_ListRegionalBySubscription ```java -/** - * Samples for EventSubscriptions GetFullUrl. - */ -public final class EventSubscriptionsGetFullUrlSamples { - /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_GetFullUrlForResource.json - */ - /** - * Sample code: EventSubscriptions_GetFullUrlForResource. - * - * @param manager Entry point to EventGridManager. - */ - public static void - eventSubscriptionsGetFullUrlForResource(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .getFullUrlWithResponse( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1", - "examplesubscription1", com.azure.core.util.Context.NONE); - } +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters; +import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination; +import java.util.Arrays; +/** + * Samples for DomainTopicEventSubscriptions Update. + */ +public final class DomainTopicEventSubscriptionsUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_GetFullUrlForResourceGroup.json + * DomainTopicEventSubscriptions_Update.json */ /** - * Sample code: EventSubscriptions_GetFullUrlForResourceGroup. + * Sample code: DomainTopicEventSubscriptions_Update. * * @param manager Entry point to EventGridManager. */ public static void - eventSubscriptionsGetFullUrlForResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .getFullUrlWithResponse("subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg", - "examplesubscription2", com.azure.core.util.Context.NONE); + domainTopicEventSubscriptionsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domainTopicEventSubscriptions() + .update("examplerg", "exampleDomain1", "exampleDomainTopic1", "exampleEventSubscriptionName1", + new EventSubscriptionUpdateParameters() + .withDestination( + new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") + .withSubjectEndsWith("newSuffix") + .withIsSubjectCaseSensitive(true)) + .withLabels(Arrays.asList("label1", "label2")), + com.azure.core.util.Context.NONE); } +} +``` + +### EventSubscriptions_ListRegionalBySubscriptionForTopicType +```java +/** + * Samples for DomainEventSubscriptions Get. + */ +public final class DomainEventSubscriptionsGetSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_GetFullUrlForSubscription.json + * DomainEventSubscriptions_Get.json */ /** - * Sample code: EventSubscriptions_GetFullUrlForSubscription. + * Sample code: DomainEventSubscriptions_Get. * * @param manager Entry point to EventGridManager. */ - public static void - eventSubscriptionsGetFullUrlForSubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .getFullUrlWithResponse("subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4", "examplesubscription3", - com.azure.core.util.Context.NONE); + public static void domainEventSubscriptionsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domainEventSubscriptions() + .getWithResponse("examplerg", "exampleDomain1", "examplesubscription1", com.azure.core.util.Context.NONE); } +} +``` + +### EventSubscriptions_Update +```java +/** + * Samples for PartnerTopics GetByResourceGroup. + */ +public final class PartnerTopicsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_GetFullUrlForCustomTopic.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopics_Get.json */ /** - * Sample code: EventSubscriptions_GetFullUrlForCustomTopic. + * Sample code: PartnerTopics_Get. * * @param manager Entry point to EventGridManager. */ - public static void - eventSubscriptionsGetFullUrlForCustomTopic(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .getFullUrlWithResponse( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", - "examplesubscription1", com.azure.core.util.Context.NONE); + public static void partnerTopicsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerTopics() + .getByResourceGroupWithResponse("examplerg", "examplePartnerTopicName1", com.azure.core.util.Context.NONE); } } ``` -### EventSubscriptions_List +### ExtensionTopics_Get ```java /** - * Samples for EventSubscriptions List. + * Samples for CaCertificates ListByNamespace. */ -public final class EventSubscriptionsListSamples { +public final class CaCertificatesListByNamespaceSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_ListGlobalBySubscription.json + * CaCertificates_ListByNamespace.json */ /** - * Sample code: EventSubscriptions_ListGlobalBySubscription. + * Sample code: CaCertificates_ListByNamespace. * * @param manager Entry point to EventGridManager. */ - public static void - eventSubscriptionsListGlobalBySubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions().list(null, null, com.azure.core.util.Context.NONE); + public static void caCertificatesListByNamespace(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.caCertificates() + .listByNamespace("examplerg", "namespace123", null, null, com.azure.core.util.Context.NONE); } } ``` -### EventSubscriptions_ListByDomainTopic +### NamespaceTopicEventSubscriptions_CreateOrUpdate ```java /** - * Samples for EventSubscriptions ListByDomainTopic. + * Samples for PartnerNamespaces ListSharedAccessKeys. */ -public final class EventSubscriptionsListByDomainTopicSamples { +public final class PartnerNamespacesListSharedAccessKeysSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_ListByDomainTopic.json + * PartnerNamespaces_ListSharedAccessKeys.json */ /** - * Sample code: EventSubscriptions_ListByDomainTopic. + * Sample code: PartnerNamespaces_ListSharedAccessKeys. * * @param manager Entry point to EventGridManager. */ public static void - eventSubscriptionsListByDomainTopic(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .listByDomainTopic("examplerg", "domain1", "topic1", null, null, com.azure.core.util.Context.NONE); + partnerNamespacesListSharedAccessKeys(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerNamespaces() + .listSharedAccessKeysWithResponse("examplerg", "examplePartnerNamespaceName1", + com.azure.core.util.Context.NONE); } } ``` -### EventSubscriptions_ListByResource +### NamespaceTopicEventSubscriptions_Delete ```java +import com.azure.resourcemanager.eventgrid.models.EventInputSchema; +import com.azure.resourcemanager.eventgrid.models.PublisherType; + /** - * Samples for EventSubscriptions ListByResource. + * Samples for NamespaceTopics CreateOrUpdate. */ -public final class EventSubscriptionsListByResourceSamples { +public final class NamespaceTopicsCreateOrUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_ListByResource.json + * NamespaceTopics_CreateOrUpdate.json */ /** - * Sample code: EventSubscriptions_ListByResource. + * Sample code: NamespaceTopics_CreateOrUpdate. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsListByResource(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .listByResource("examplerg", "Microsoft.EventGrid", "topics", "exampletopic2", null, null, - com.azure.core.util.Context.NONE); + public static void namespaceTopicsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.namespaceTopics() + .define("examplenamespacetopic2") + .withExistingNamespace("examplerg", "examplenamespace2") + .withPublisherType(PublisherType.CUSTOM) + .withInputSchema(EventInputSchema.CLOUD_EVENT_SCHEMA_V1_0) + .withEventRetentionInDays(1) + .create(); } } ``` -### EventSubscriptions_ListByResourceGroup +### NamespaceTopicEventSubscriptions_Get ```java /** - * Samples for EventSubscriptions ListByResourceGroup. + * Samples for PartnerNamespaces List. */ -public final class EventSubscriptionsListByResourceGroupSamples { +public final class PartnerNamespacesListSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_ListGlobalByResourceGroup.json + * PartnerNamespaces_ListBySubscription.json */ /** - * Sample code: EventSubscriptions_ListGlobalByResourceGroup. + * Sample code: PartnerNamespaces_ListBySubscription. * * @param manager Entry point to EventGridManager. */ public static void - eventSubscriptionsListGlobalByResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions().listByResourceGroup("examplerg", null, null, com.azure.core.util.Context.NONE); + partnerNamespacesListBySubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerNamespaces().list(null, null, com.azure.core.util.Context.NONE); } } ``` -### EventSubscriptions_ListGlobalByResourceGroupForTopicType +### NamespaceTopicEventSubscriptions_GetDeliveryAttributes ```java /** - * Samples for EventSubscriptions ListGlobalByResourceGroupForTopicType. + * Samples for DomainTopics ListByDomain. */ -public final class EventSubscriptionsListGlobalByResourceGroupForTopicTypeSamples { +public final class DomainTopicsListByDomainSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_ListGlobalByResourceGroupForTopicType.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainTopics_ListByDomain + * .json */ /** - * Sample code: EventSubscriptions_ListGlobalByResourceGroupForTopicType. + * Sample code: DomainTopics_ListByDomain. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsListGlobalByResourceGroupForTopicType( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .listGlobalByResourceGroupForTopicType("examplerg", "Microsoft.Resources.ResourceGroups", null, null, - com.azure.core.util.Context.NONE); + public static void domainTopicsListByDomain(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domainTopics() + .listByDomain("examplerg", "exampledomain2", null, null, com.azure.core.util.Context.NONE); } } ``` -### EventSubscriptions_ListGlobalBySubscriptionForTopicType +### NamespaceTopicEventSubscriptions_GetFullUrl ```java +import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner; +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; +import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination; + /** - * Samples for EventSubscriptions ListGlobalBySubscriptionForTopicType. + * Samples for SystemTopicEventSubscriptions CreateOrUpdate. */ -public final class EventSubscriptionsListGlobalBySubscriptionForTopicTypeSamples { +public final class SystemTopicEventSubscriptionsCreateOrUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_ListGlobalBySubscriptionForTopicType.json + * SystemTopicEventSubscriptions_CreateOrUpdate.json */ /** - * Sample code: EventSubscriptions_ListGlobalBySubscriptionForTopicType. + * Sample code: SystemTopicEventSubscriptions_CreateOrUpdate. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsListGlobalBySubscriptionForTopicType( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .listGlobalBySubscriptionForTopicType("Microsoft.Resources.Subscriptions", null, null, + public static void + systemTopicEventSubscriptionsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.systemTopicEventSubscriptions() + .createOrUpdate("examplerg", "exampleSystemTopic1", "exampleEventSubscriptionName1", + new EventSubscriptionInner() + .withDestination( + new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") + .withSubjectEndsWith("ExampleSuffix") + .withIsSubjectCaseSensitive(false)), com.azure.core.util.Context.NONE); } } ``` -### EventSubscriptions_ListRegionalByResourceGroup +### NamespaceTopicEventSubscriptions_ListByNamespaceTopic ```java /** - * Samples for EventSubscriptions ListRegionalByResourceGroup. + * Samples for Namespaces ListSharedAccessKeys. */ -public final class EventSubscriptionsListRegionalByResourceGroupSamples { +public final class NamespacesListSharedAccessKeysSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_ListRegionalByResourceGroup.json + * Namespaces_ListSharedAccessKeys.json */ /** - * Sample code: EventSubscriptions_ListRegionalByResourceGroup. + * Sample code: Namespaces_ListSharedAccessKeys. * * @param manager Entry point to EventGridManager. */ - public static void - eventSubscriptionsListRegionalByResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .listRegionalByResourceGroup("examplerg", "westus2", null, null, com.azure.core.util.Context.NONE); + public static void namespacesListSharedAccessKeys(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.namespaces() + .listSharedAccessKeysWithResponse("examplerg", "exampleNamespaceName1", com.azure.core.util.Context.NONE); } } ``` -### EventSubscriptions_ListRegionalByResourceGroupForTopicType +### NamespaceTopicEventSubscriptions_Update ```java /** - * Samples for EventSubscriptions ListRegionalByResourceGroupForTopicType. + * Samples for Namespaces ListByResourceGroup. */ -public final class EventSubscriptionsListRegionalByResourceGroupForTopicTypeSamples { +public final class NamespacesListByResourceGroupSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_ListRegionalByResourceGroupForTopicType.json + * Namespaces_ListByResourceGroup.json */ /** - * Sample code: EventSubscriptions_ListRegionalByResourceGroupForTopicType. + * Sample code: Namespaces_ListByResourceGroup. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsListRegionalByResourceGroupForTopicType( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .listRegionalByResourceGroupForTopicType("examplerg", "westus2", "Microsoft.EventHub.namespaces", null, - null, com.azure.core.util.Context.NONE); + public static void namespacesListByResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.namespaces().listByResourceGroup("examplerg", null, null, com.azure.core.util.Context.NONE); } } ``` -### EventSubscriptions_ListRegionalBySubscription +### NamespaceTopics_CreateOrUpdate ```java /** - * Samples for EventSubscriptions ListRegionalBySubscription. + * Samples for PartnerNamespaces ListByResourceGroup. */ -public final class EventSubscriptionsListRegionalBySubscriptionSamples { +public final class PartnerNamespacesListByResourceGroupSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_ListRegionalBySubscription.json + * PartnerNamespaces_ListByResourceGroup.json */ /** - * Sample code: EventSubscriptions_ListRegionalBySubscription. + * Sample code: PartnerNamespaces_ListByResourceGroup. * * @param manager Entry point to EventGridManager. */ public static void - eventSubscriptionsListRegionalBySubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .listRegionalBySubscription("westus2", null, null, com.azure.core.util.Context.NONE); + partnerNamespacesListByResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerNamespaces().listByResourceGroup("examplerg", null, null, com.azure.core.util.Context.NONE); } } ``` -### EventSubscriptions_ListRegionalBySubscriptionForTopicType +### NamespaceTopics_Delete ```java +import com.azure.resourcemanager.eventgrid.models.PartnerRegistration; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for EventSubscriptions ListRegionalBySubscriptionForTopicType. + * Samples for PartnerRegistrations Update. */ -public final class EventSubscriptionsListRegionalBySubscriptionForTopicTypeSamples { +public final class PartnerRegistrationsUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_ListRegionalBySubscriptionForTopicType.json + * PartnerRegistrations_Update.json */ /** - * Sample code: EventSubscriptions_ListRegionalBySubscriptionForTopicType. + * Sample code: PartnerRegistrations_Update. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsListRegionalBySubscriptionForTopicType( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.eventSubscriptions() - .listRegionalBySubscriptionForTopicType("westus2", "Microsoft.EventHub.namespaces", null, null, + public static void partnerRegistrationsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + PartnerRegistration resource = manager.partnerRegistrations() + .getByResourceGroupWithResponse("examplerg", "examplePartnerRegistrationName1", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### NamespaceTopics_Get + +```java +/** + * Samples for DomainTopicEventSubscriptions Delete. + */ +public final class DomainTopicEventSubscriptionsDeleteSamples { + /* + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * DomainTopicEventSubscriptions_Delete.json + */ + /** + * Sample code: DomainTopicEventSubscriptions_Delete. + * + * @param manager Entry point to EventGridManager. + */ + public static void + domainTopicEventSubscriptionsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domainTopicEventSubscriptions() + .delete("examplerg", "exampleDomain1", "exampleDomainTopic1", "examplesubscription1", com.azure.core.util.Context.NONE); } } ``` -### EventSubscriptions_Update +### NamespaceTopics_ListByNamespace ```java -import com.azure.resourcemanager.eventgrid.models.AzureFunctionEventSubscriptionDestination; -import com.azure.resourcemanager.eventgrid.models.EventHubEventSubscriptionDestination; -import com.azure.resourcemanager.eventgrid.models.EventSubscription; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; -import com.azure.resourcemanager.eventgrid.models.HybridConnectionEventSubscriptionDestination; -import com.azure.resourcemanager.eventgrid.models.ServiceBusQueueEventSubscriptionDestination; -import com.azure.resourcemanager.eventgrid.models.ServiceBusTopicEventSubscriptionDestination; -import com.azure.resourcemanager.eventgrid.models.StorageBlobDeadLetterDestination; -import com.azure.resourcemanager.eventgrid.models.StorageQueueEventSubscriptionDestination; -import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination; -import java.util.Arrays; +/** + * Samples for DomainTopicEventSubscriptions Get. + */ +public final class DomainTopicEventSubscriptionsGetSamples { + /* + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * DomainTopicEventSubscriptions_Get.json + */ + /** + * Sample code: DomainTopicEventSubscriptions_Get. + * + * @param manager Entry point to EventGridManager. + */ + public static void domainTopicEventSubscriptionsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domainTopicEventSubscriptions() + .getWithResponse("examplerg", "exampleDomain1", "exampleDomainTopic1", "examplesubscription1", + com.azure.core.util.Context.NONE); + } +} +``` +### NamespaceTopics_ListSharedAccessKeys + +```java /** - * Samples for EventSubscriptions Update. + * Samples for NamespaceTopicEventSubscriptions Get. */ -public final class EventSubscriptionsUpdateSamples { +public final class NamespaceTopicEventSubscriptionsGetSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_UpdateForCustomTopic_EventHubDestination.json + * NamespaceTopicEventSubscriptions_Get.json */ /** - * Sample code: EventSubscriptions_UpdateForCustomTopic_EventHubDestination. + * Sample code: NamespaceTopicEventSubscriptions_Get. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsUpdateForCustomTopicEventHubDestination( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - EventSubscription resource = manager.eventSubscriptions() - .getWithResponse( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", - "examplesubscription1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withDestination(new EventHubEventSubscriptionDestination().withResourceId( - "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") - .withSubjectEndsWith("newSuffix") - .withIsSubjectCaseSensitive(true)) - .withLabels(Arrays.asList("label1", "label2")) - .apply(); + public static void + namespaceTopicEventSubscriptionsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.namespaceTopicEventSubscriptions() + .getWithResponse("examplerg", "examplenamespace2", "examplenamespacetopic2", + "examplenamespacetopicEventSub1", com.azure.core.util.Context.NONE); } +} +``` + +### NamespaceTopics_RegenerateKey + +```java +import com.azure.resourcemanager.eventgrid.models.AzureFunctionEventSubscriptionDestination; +import com.azure.resourcemanager.eventgrid.models.EventHubEventSubscriptionDestination; +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; +import com.azure.resourcemanager.eventgrid.models.HybridConnectionEventSubscriptionDestination; +import com.azure.resourcemanager.eventgrid.models.ServiceBusQueueEventSubscriptionDestination; +import com.azure.resourcemanager.eventgrid.models.ServiceBusTopicEventSubscriptionDestination; +import com.azure.resourcemanager.eventgrid.models.StorageBlobDeadLetterDestination; +import com.azure.resourcemanager.eventgrid.models.StorageQueueEventSubscriptionDestination; +import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination; +/** + * Samples for EventSubscriptions CreateOrUpdate. + */ +public final class EventSubscriptionsCreateOrUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_UpdateForCustomTopic_AzureFunctionDestination.json + * EventSubscriptions_CreateOrUpdateForCustomTopic_WebhookDestination.json */ /** - * Sample code: EventSubscriptions_UpdateForCustomTopic_AzureFunctionDestination. + * Sample code: EventSubscriptions_CreateOrUpdateForCustomTopic_WebhookDestination. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsUpdateForCustomTopicAzureFunctionDestination( + public static void eventSubscriptionsCreateOrUpdateForCustomTopicWebhookDestination( com.azure.resourcemanager.eventgrid.EventGridManager manager) { - EventSubscription resource = manager.eventSubscriptions() - .getWithResponse( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1", - "examplesubscription1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withDestination(new AzureFunctionEventSubscriptionDestination().withResourceId( - "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Web/sites/ContosoSite/funtions/ContosoFunc")) + manager.eventSubscriptions() + .define("examplesubscription1") + .withExistingScope( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1") + .withDestination(new WebhookEventSubscriptionDestination().withEndpointUrl( + "https://azurefunctionexample.azurewebsites.net/runtime/webhooks/EventGrid?functionName=EventGridTrigger1&code=PASSWORDCODE")) .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") .withSubjectEndsWith("ExampleSuffix") .withIsSubjectCaseSensitive(false)) - .withDeadLetterDestination(new StorageBlobDeadLetterDestination().withResourceId( - "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg") - .withBlobContainerName("contosocontainer")) - .apply(); + .create(); } /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_UpdateForCustomTopic_WebhookDestination.json + * EventSubscriptions_CreateOrUpdateForSubscription.json */ /** - * Sample code: EventSubscriptions_UpdateForCustomTopic_WebhookDestination. + * Sample code: EventSubscriptions_CreateOrUpdateForSubscription. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsUpdateForCustomTopicWebhookDestination( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - EventSubscription resource = manager.eventSubscriptions() - .getWithResponse( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", - "examplesubscription1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() + public static void + eventSubscriptionsCreateOrUpdateForSubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .define("examplesubscription3") + .withExistingScope("subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4") .withDestination(new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") - .withSubjectEndsWith("newSuffix") - .withIsSubjectCaseSensitive(true)) - .withLabels(Arrays.asList("label1", "label2")) - .apply(); + .withFilter(new EventSubscriptionFilter().withIsSubjectCaseSensitive(false)) + .create(); } /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_UpdateForCustomTopic_StorageQueueDestination.json + * EventSubscriptions_CreateOrUpdateForCustomTopic_ServiceBusTopicDestination.json */ /** - * Sample code: EventSubscriptions_UpdateForCustomTopic_StorageQueueDestination. + * Sample code: EventSubscriptions_CreateOrUpdateForCustomTopic_ServiceBusTopicDestination. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsUpdateForCustomTopicStorageQueueDestination( + public static void eventSubscriptionsCreateOrUpdateForCustomTopicServiceBusTopicDestination( com.azure.resourcemanager.eventgrid.EventGridManager manager) { - EventSubscription resource = manager.eventSubscriptions() - .getWithResponse( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1", - "examplesubscription1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withDestination(new StorageQueueEventSubscriptionDestination().withResourceId( - "/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg") - .withQueueName("queue1") - .withQueueMessageTimeToLiveInSeconds(300L)) + manager.eventSubscriptions() + .define("examplesubscription1") + .withExistingScope( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1") + .withDestination(new ServiceBusTopicEventSubscriptionDestination().withResourceId( + "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/topics/SBT")) .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") .withSubjectEndsWith("ExampleSuffix") .withIsSubjectCaseSensitive(false)) .withDeadLetterDestination(new StorageBlobDeadLetterDestination().withResourceId( "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg") .withBlobContainerName("contosocontainer")) - .apply(); + .create(); } /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_UpdateForCustomTopic_ServiceBusTopicDestination.json + * EventSubscriptions_CreateOrUpdateForResource.json */ /** - * Sample code: EventSubscriptions_UpdateForCustomTopic_ServiceBusTopicDestination. + * Sample code: EventSubscriptions_CreateOrUpdateForResource. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsUpdateForCustomTopicServiceBusTopicDestination( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - EventSubscription resource = manager.eventSubscriptions() - .getWithResponse( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", - "examplesubscription1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withDestination(new ServiceBusTopicEventSubscriptionDestination().withResourceId( - "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/topics/SBT")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") - .withSubjectEndsWith("newSuffix") - .withIsSubjectCaseSensitive(true)) - .withLabels(Arrays.asList("label1", "label2")) - .apply(); + public static void + eventSubscriptionsCreateOrUpdateForResource(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .define("examplesubscription10") + .withExistingScope( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1") + .withDestination(new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") + .withSubjectEndsWith("ExampleSuffix") + .withIsSubjectCaseSensitive(false)) + .create(); } /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_UpdateForCustomTopic_HybridConnectionDestination.json + * EventSubscriptions_CreateOrUpdateForCustomTopic.json */ /** - * Sample code: EventSubscriptions_UpdateForCustomTopic_HybridConnectionDestination. + * Sample code: EventSubscriptions_CreateOrUpdateForCustomTopic. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsUpdateForCustomTopicHybridConnectionDestination( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - EventSubscription resource = manager.eventSubscriptions() - .getWithResponse( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", - "examplesubscription1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withDestination(new HybridConnectionEventSubscriptionDestination().withResourceId( - "/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Relay/namespaces/ContosoNamespace/hybridConnections/HC1")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") - .withSubjectEndsWith("newSuffix") - .withIsSubjectCaseSensitive(true)) - .withLabels(Arrays.asList("label1", "label2")) - .apply(); + public static void + eventSubscriptionsCreateOrUpdateForCustomTopic(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .define("examplesubscription1") + .withExistingScope( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1") + .withDestination(new EventHubEventSubscriptionDestination().withResourceId( + "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") + .withSubjectEndsWith("ExampleSuffix") + .withIsSubjectCaseSensitive(false)) + .create(); } /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_UpdateForCustomTopic_ServiceBusQueueDestination.json + * EventSubscriptions_CreateOrUpdateForResourceGroup.json */ /** - * Sample code: EventSubscriptions_UpdateForCustomTopic_ServiceBusQueueDestination. + * Sample code: EventSubscriptions_CreateOrUpdateForResourceGroup. * * @param manager Entry point to EventGridManager. */ - public static void eventSubscriptionsUpdateForCustomTopicServiceBusQueueDestination( + public static void + eventSubscriptionsCreateOrUpdateForResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .define("examplesubscription2") + .withExistingScope("subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg") + .withDestination(new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") + .withSubjectEndsWith("ExampleSuffix") + .withIsSubjectCaseSensitive(false)) + .create(); + } + + /* + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * EventSubscriptions_CreateOrUpdateForCustomTopic_EventHubDestination.json + */ + /** + * Sample code: EventSubscriptions_CreateOrUpdateForCustomTopic_EventHubDestination. + * + * @param manager Entry point to EventGridManager. + */ + public static void eventSubscriptionsCreateOrUpdateForCustomTopicEventHubDestination( com.azure.resourcemanager.eventgrid.EventGridManager manager) { - EventSubscription resource = manager.eventSubscriptions() - .getWithResponse( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1", - "examplesubscription1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withDestination(new ServiceBusQueueEventSubscriptionDestination().withResourceId( - "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/queues/SBQ")) + manager.eventSubscriptions() + .define("examplesubscription1") + .withExistingScope( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1") + .withDestination(new EventHubEventSubscriptionDestination().withResourceId( + "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1")) .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") .withSubjectEndsWith("ExampleSuffix") .withIsSubjectCaseSensitive(false)) .withDeadLetterDestination(new StorageBlobDeadLetterDestination().withResourceId( "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg") .withBlobContainerName("contosocontainer")) - .apply(); + .create(); } /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_UpdateForCustomTopic.json + * EventSubscriptions_CreateOrUpdateForCustomTopic_StorageQueueDestination.json */ /** - * Sample code: EventSubscriptions_UpdateForCustomTopic. + * Sample code: EventSubscriptions_CreateOrUpdateForCustomTopic_StorageQueueDestination. * * @param manager Entry point to EventGridManager. */ - public static void - eventSubscriptionsUpdateForCustomTopic(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - EventSubscription resource = manager.eventSubscriptions() - .getWithResponse( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", - "examplesubscription1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withDestination(new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") - .withSubjectEndsWith("newSuffix") - .withIsSubjectCaseSensitive(true)) - .withLabels(Arrays.asList("label1", "label2")) - .apply(); + public static void eventSubscriptionsCreateOrUpdateForCustomTopicStorageQueueDestination( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .define("examplesubscription1") + .withExistingScope( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1") + .withDestination(new StorageQueueEventSubscriptionDestination().withResourceId( + "/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg") + .withQueueName("queue1")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") + .withSubjectEndsWith("ExampleSuffix") + .withIsSubjectCaseSensitive(false)) + .withDeadLetterDestination(new StorageBlobDeadLetterDestination().withResourceId( + "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg") + .withBlobContainerName("contosocontainer")) + .create(); } /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_UpdateForResource.json + * EventSubscriptions_CreateOrUpdateForCustomTopic_AzureFunctionDestination.json */ /** - * Sample code: EventSubscriptions_UpdateForResource. + * Sample code: EventSubscriptions_CreateOrUpdateForCustomTopic_AzureFunctionDestination. * * @param manager Entry point to EventGridManager. */ - public static void - eventSubscriptionsUpdateForResource(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - EventSubscription resource = manager.eventSubscriptions() - .getWithResponse( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1", - "examplesubscription1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withDestination(new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") - .withSubjectEndsWith("newSuffix") - .withIsSubjectCaseSensitive(true)) - .withLabels(Arrays.asList("label1", "label2")) - .apply(); + public static void eventSubscriptionsCreateOrUpdateForCustomTopicAzureFunctionDestination( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .define("examplesubscription1") + .withExistingScope( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1") + .withDestination(new AzureFunctionEventSubscriptionDestination().withResourceId( + "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Web/sites/ContosoSite/funtions/ContosoFunc")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") + .withSubjectEndsWith("ExampleSuffix") + .withIsSubjectCaseSensitive(false)) + .withDeadLetterDestination(new StorageBlobDeadLetterDestination().withResourceId( + "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg") + .withBlobContainerName("contosocontainer")) + .create(); } /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_UpdateForResourceGroup.json + * EventSubscriptions_CreateOrUpdateForCustomTopic_HybridConnectionDestination.json */ /** - * Sample code: EventSubscriptions_UpdateForResourceGroup. + * Sample code: EventSubscriptions_CreateOrUpdateForCustomTopic_HybridConnectionDestination. * * @param manager Entry point to EventGridManager. */ - public static void - eventSubscriptionsUpdateForResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - EventSubscription resource = manager.eventSubscriptions() - .getWithResponse("subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg", - "examplesubscription2", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withDestination(new EventHubEventSubscriptionDestination().withResourceId( - "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") - .withSubjectEndsWith("newSuffix") - .withIsSubjectCaseSensitive(true)) - .withLabels(Arrays.asList("label1", "label2")) - .apply(); + public static void eventSubscriptionsCreateOrUpdateForCustomTopicHybridConnectionDestination( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .define("examplesubscription1") + .withExistingScope( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1") + .withDestination(new HybridConnectionEventSubscriptionDestination().withResourceId( + "/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Relay/namespaces/ContosoNamespace/hybridConnections/HC1")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") + .withSubjectEndsWith("ExampleSuffix") + .withIsSubjectCaseSensitive(false)) + .withDeadLetterDestination(new StorageBlobDeadLetterDestination().withResourceId( + "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg") + .withBlobContainerName("contosocontainer")) + .create(); } /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * EventSubscriptions_UpdateForSubscription.json + * EventSubscriptions_CreateOrUpdateForCustomTopic_ServiceBusQueueDestination.json */ /** - * Sample code: EventSubscriptions_UpdateForSubscription. + * Sample code: EventSubscriptions_CreateOrUpdateForCustomTopic_ServiceBusQueueDestination. * * @param manager Entry point to EventGridManager. */ - public static void - eventSubscriptionsUpdateForSubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - EventSubscription resource = manager.eventSubscriptions() - .getWithResponse("subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4", "examplesubscription3", - com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withDestination(new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") - .withSubjectEndsWith("newSuffix") - .withIsSubjectCaseSensitive(true)) - .withLabels(Arrays.asList("label1", "label2")) - .apply(); + public static void eventSubscriptionsCreateOrUpdateForCustomTopicServiceBusQueueDestination( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .define("examplesubscription1") + .withExistingScope( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1") + .withDestination(new ServiceBusQueueEventSubscriptionDestination().withResourceId( + "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/queues/SBQ")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") + .withSubjectEndsWith("ExampleSuffix") + .withIsSubjectCaseSensitive(false)) + .withDeadLetterDestination(new StorageBlobDeadLetterDestination().withResourceId( + "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg") + .withBlobContainerName("contosocontainer")) + .create(); } } ``` -### ExtensionTopics_Get +### NamespaceTopics_Update ```java +import com.azure.resourcemanager.eventgrid.models.PartnerConfigurationUpdateParameters; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for ExtensionTopics Get. + * Samples for PartnerConfigurations Update. */ -public final class ExtensionTopicsGetSamples { +public final class PartnerConfigurationsUpdateSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ExtensionTopics_Get.json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * PartnerConfigurations_Update.json */ /** - * Sample code: ExtensionTopics_Get. + * Sample code: PartnerConfigurations_Update. * * @param manager Entry point to EventGridManager. */ - public static void extensionTopicsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.extensionTopics() - .getWithResponse( - "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.storage/storageaccounts/exampleResourceName/providers/Microsoft.eventgrid/extensionTopics/default", + public static void partnerConfigurationsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerConfigurations() + .update("examplerg", + new PartnerConfigurationUpdateParameters().withTags(mapOf("tag1", "value11", "tag2", "value22")) + .withDefaultMaximumExpirationTimeInDays(100), com.azure.core.util.Context.NONE); } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } ``` -### NamespaceTopicEventSubscriptions_CreateOrUpdate +### Namespaces_CreateOrUpdate ```java -import com.azure.resourcemanager.eventgrid.models.DeliveryConfiguration; -import com.azure.resourcemanager.eventgrid.models.DeliveryMode; -import com.azure.resourcemanager.eventgrid.models.DeliverySchema; -import com.azure.resourcemanager.eventgrid.models.QueueInfo; -import java.time.Duration; - /** - * Samples for NamespaceTopicEventSubscriptions CreateOrUpdate. + * Samples for SystemTopics ListByResourceGroup. */ -public final class NamespaceTopicEventSubscriptionsCreateOrUpdateSamples { +public final class SystemTopicsListByResourceGroupSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * NamespaceTopicEventSubscriptions_CreateOrUpdate.json + * SystemTopics_ListByResourceGroup.json */ /** - * Sample code: NamespaceTopicEventSubscriptions_CreateOrUpdate. + * Sample code: SystemTopics_ListByResourceGroup. * * @param manager Entry point to EventGridManager. */ - public static void - namespaceTopicEventSubscriptionsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.namespaceTopicEventSubscriptions() - .define("examplenamespacetopicEventSub2") - .withExistingTopic("examplerg", "examplenamespace2", "examplenamespacetopic2") - .withDeliveryConfiguration(new DeliveryConfiguration().withDeliveryMode(DeliveryMode.QUEUE) - .withQueue(new QueueInfo().withReceiveLockDurationInSeconds(60) - .withMaxDeliveryCount(4) - .withEventTimeToLive(Duration.parse("P1D")))) - .withEventDeliverySchema(DeliverySchema.CLOUD_EVENT_SCHEMA_V1_0) - .create(); + public static void systemTopicsListByResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.systemTopics().listByResourceGroup("examplerg", null, null, com.azure.core.util.Context.NONE); } } ``` -### NamespaceTopicEventSubscriptions_Delete +### Namespaces_Delete ```java /** - * Samples for NamespaceTopicEventSubscriptions Delete. + * Samples for PartnerTopics List. */ -public final class NamespaceTopicEventSubscriptionsDeleteSamples { +public final class PartnerTopicsListSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * NamespaceTopicEventSubscriptions_Delete.json + * PartnerTopics_ListBySubscription.json */ /** - * Sample code: NamespaceTopicEventSubscriptions_Delete. + * Sample code: PartnerTopics_ListBySubscription. * * @param manager Entry point to EventGridManager. */ - public static void - namespaceTopicEventSubscriptionsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.namespaceTopicEventSubscriptions() - .delete("examplerg", "examplenamespace2", "examplenamespacetopic2", "examplenamespacetopicEventSub2", - com.azure.core.util.Context.NONE); + public static void partnerTopicsListBySubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerTopics().list(null, null, com.azure.core.util.Context.NONE); } } ``` -### NamespaceTopicEventSubscriptions_Get +### Namespaces_GetByResourceGroup ```java /** - * Samples for NamespaceTopicEventSubscriptions Get. + * Samples for PartnerRegistrations ListByResourceGroup. */ -public final class NamespaceTopicEventSubscriptionsGetSamples { +public final class PartnerRegistrationsListByResourceGroupSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * NamespaceTopicEventSubscriptions_Get.json + * PartnerRegistrations_ListByResourceGroup.json */ /** - * Sample code: NamespaceTopicEventSubscriptions_Get. + * Sample code: PartnerRegistrations_ListByResourceGroup. * * @param manager Entry point to EventGridManager. */ public static void - namespaceTopicEventSubscriptionsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.namespaceTopicEventSubscriptions() - .getWithResponse("examplerg", "examplenamespace2", "examplenamespacetopic2", - "examplenamespacetopicEventSub1", com.azure.core.util.Context.NONE); + partnerRegistrationsListByResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerRegistrations().listByResourceGroup("examplerg", null, null, com.azure.core.util.Context.NONE); } } ``` -### NamespaceTopicEventSubscriptions_GetDeliveryAttributes +### Namespaces_List ```java +import com.azure.resourcemanager.eventgrid.models.PrivateEndpointConnectionsParentType; + /** - * Samples for NamespaceTopicEventSubscriptions GetDeliveryAttributes. + * Samples for PrivateEndpointConnections Delete. */ -public final class NamespaceTopicEventSubscriptionsGetDeliveryAttributesSamples { +public final class PrivateEndpointConnectionsDeleteSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * NamespaceTopicEventSubscriptions_GetDeliveryAttributes.json + * PrivateEndpointConnections_Delete.json */ /** - * Sample code: NamespaceTopicEventSubscriptions_GetDeliveryAttributes. + * Sample code: PrivateEndpointConnections_Delete. * * @param manager Entry point to EventGridManager. */ - public static void namespaceTopicEventSubscriptionsGetDeliveryAttributes( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.namespaceTopicEventSubscriptions() - .getDeliveryAttributesWithResponse("examplerg", "exampleNamespace", "exampleNamespaceTopic", - "exampleEventSubscriptionName", com.azure.core.util.Context.NONE); + public static void privateEndpointConnectionsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.privateEndpointConnections() + .delete("examplerg", PrivateEndpointConnectionsParentType.TOPICS, "exampletopic1", + "BMTPE5.8A30D251-4C61-489D-A1AA-B37C4A329B8B", com.azure.core.util.Context.NONE); } } ``` -### NamespaceTopicEventSubscriptions_GetFullUrl +### Namespaces_ListByResourceGroup ```java /** - * Samples for NamespaceTopicEventSubscriptions GetFullUrl. + * Samples for DomainTopics Get. */ -public final class NamespaceTopicEventSubscriptionsGetFullUrlSamples { +public final class DomainTopicsGetSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * NamespaceTopicEventSubscriptions_GetFullUrl.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainTopics_Get.json */ /** - * Sample code: NamespaceTopicEventSubscriptions_GetFullUrl. + * Sample code: DomainTopics_Get. * * @param manager Entry point to EventGridManager. */ - public static void - namespaceTopicEventSubscriptionsGetFullUrl(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.namespaceTopicEventSubscriptions() - .getFullUrlWithResponse("examplerg", "exampleNamespaceName1", "exampleDomainTopic1", "examplesubscription1", - com.azure.core.util.Context.NONE); + public static void domainTopicsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domainTopics() + .getWithResponse("examplerg", "exampledomain2", "topic1", com.azure.core.util.Context.NONE); } } ``` -### NamespaceTopicEventSubscriptions_ListByNamespaceTopic +### Namespaces_ListSharedAccessKeys ```java /** - * Samples for NamespaceTopicEventSubscriptions ListByNamespaceTopic. + * Samples for PartnerTopicEventSubscriptions ListByPartnerTopic. */ -public final class NamespaceTopicEventSubscriptionsListByNamespaceTopicSamples { +public final class PartnerTopicEventSubscriptionsListByPartnerTopicSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * NamespaceTopicEventSubscriptions_ListByNamespaceTopic.json + * PartnerTopicEventSubscriptions_ListByPartnerTopic.json */ /** - * Sample code: NamespaceTopicEventSubscriptions_ListByNamespaceTopic. + * Sample code: PartnerTopicEventSubscriptions_ListByPartnerTopic. * * @param manager Entry point to EventGridManager. */ - public static void namespaceTopicEventSubscriptionsListByNamespaceTopic( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.namespaceTopicEventSubscriptions() - .listByNamespaceTopic("examplerg", "examplenamespace2", "examplenamespacetopic2", null, null, - com.azure.core.util.Context.NONE); + public static void + partnerTopicEventSubscriptionsListByPartnerTopic(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerTopicEventSubscriptions() + .listByPartnerTopic("examplerg", "examplePartnerTopic1", null, null, com.azure.core.util.Context.NONE); } } ``` -### NamespaceTopicEventSubscriptions_Update +### Namespaces_RegenerateKey ```java -import com.azure.resourcemanager.eventgrid.models.DeliveryConfiguration; -import com.azure.resourcemanager.eventgrid.models.DeliveryMode; -import com.azure.resourcemanager.eventgrid.models.DeliverySchema; -import com.azure.resourcemanager.eventgrid.models.QueueInfo; -import com.azure.resourcemanager.eventgrid.models.Subscription; -import java.time.Duration; +import com.azure.resourcemanager.eventgrid.models.ChannelUpdateParameters; +import java.time.OffsetDateTime; /** - * Samples for NamespaceTopicEventSubscriptions Update. + * Samples for Channels Update. */ -public final class NamespaceTopicEventSubscriptionsUpdateSamples { +public final class ChannelsUpdateSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * NamespaceTopicEventSubscriptions_Update.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Channels_Update.json */ /** - * Sample code: NamespaceTopicEventSubscriptions_Update. + * Sample code: Channels_Update. * * @param manager Entry point to EventGridManager. */ - public static void - namespaceTopicEventSubscriptionsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - Subscription resource = manager.namespaceTopicEventSubscriptions() - .getWithResponse("examplerg", "exampleNamespaceName1", "exampleNamespaceTopicName1", - "exampleNamespaceTopicEventSubscriptionName1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withDeliveryConfiguration(new DeliveryConfiguration().withDeliveryMode(DeliveryMode.QUEUE) - .withQueue(new QueueInfo().withReceiveLockDurationInSeconds(60) - .withMaxDeliveryCount(3) - .withEventTimeToLive(Duration.parse("P1D")))) - .withEventDeliverySchema(DeliverySchema.CLOUD_EVENT_SCHEMA_V1_0) - .apply(); + public static void channelsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.channels() + .updateWithResponse( + "examplerg", "examplePartnerNamespaceName1", "exampleChannelName1", new ChannelUpdateParameters() + .withExpirationTimeIfNotActivatedUtc(OffsetDateTime.parse("2022-03-23T23:06:11.785Z")), + com.azure.core.util.Context.NONE); } } ``` -### NamespaceTopics_CreateOrUpdate +### Namespaces_Update ```java -import com.azure.resourcemanager.eventgrid.models.EventInputSchema; -import com.azure.resourcemanager.eventgrid.models.PublisherType; +import com.azure.resourcemanager.eventgrid.models.InboundIpRule; +import com.azure.resourcemanager.eventgrid.models.IpActionType; +import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; /** - * Samples for NamespaceTopics CreateOrUpdate. + * Samples for Domains CreateOrUpdate. */ -public final class NamespaceTopicsCreateOrUpdateSamples { +public final class DomainsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * NamespaceTopics_CreateOrUpdate.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Domains_CreateOrUpdate. + * json */ /** - * Sample code: NamespaceTopics_CreateOrUpdate. + * Sample code: Domains_CreateOrUpdate. * * @param manager Entry point to EventGridManager. */ - public static void namespaceTopicsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.namespaceTopics() - .define("examplenamespacetopic2") - .withExistingNamespace("examplerg", "examplenamespace2") - .withPublisherType(PublisherType.CUSTOM) - .withInputSchema(EventInputSchema.CLOUD_EVENT_SCHEMA_V1_0) - .withEventRetentionInDays(1) + public static void domainsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domains() + .define("exampledomain1") + .withRegion("westus2") + .withExistingResourceGroup("examplerg") + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) + .withInboundIpRules( + Arrays.asList(new InboundIpRule().withIpMask("12.18.30.15").withAction(IpActionType.ALLOW), + new InboundIpRule().withIpMask("12.18.176.1").withAction(IpActionType.ALLOW))) .create(); } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } ``` -### NamespaceTopics_Delete +### Namespaces_ValidateCustomDomainOwnership ```java /** - * Samples for NamespaceTopics Delete. + * Samples for PartnerTopics ListByResourceGroup. */ -public final class NamespaceTopicsDeleteSamples { +public final class PartnerTopicsListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/NamespaceTopics_Delete. - * json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * PartnerTopics_ListByResourceGroup.json */ /** - * Sample code: NamespaceTopics_Delete. + * Sample code: PartnerTopics_ListByResourceGroup. * * @param manager Entry point to EventGridManager. */ - public static void namespaceTopicsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.namespaceTopics() - .delete("examplerg", "examplenamespace2", "examplenamespacetopic2", com.azure.core.util.Context.NONE); + public static void partnerTopicsListByResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerTopics().listByResourceGroup("examplerg", null, null, com.azure.core.util.Context.NONE); } } ``` -### NamespaceTopics_Get +### Operations_List ```java +import java.util.HashMap; +import java.util.Map; + /** - * Samples for NamespaceTopics Get. + * Samples for SystemTopics CreateOrUpdate. */ -public final class NamespaceTopicsGetSamples { +public final class SystemTopicsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/NamespaceTopics_Get.json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * SystemTopics_CreateOrUpdate.json */ /** - * Sample code: NamespaceTopics_Get. + * Sample code: SystemTopics_CreateOrUpdate. * * @param manager Entry point to EventGridManager. */ - public static void namespaceTopicsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.namespaceTopics() - .getWithResponse("examplerg", "examplenamespace2", "examplenamespacetopic2", - com.azure.core.util.Context.NONE); + public static void systemTopicsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.systemTopics() + .define("exampleSystemTopic1") + .withRegion("westus2") + .withExistingResourceGroup("examplerg") + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withSource( + "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/azureeventgridrunnerrgcentraluseuap/providers/microsoft.storage/storageaccounts/pubstgrunnerb71cd29e") + .withTopicType("microsoft.storage.storageaccounts") + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### NamespaceTopics_ListByNamespace +### PartnerConfigurations_AuthorizePartner ```java /** - * Samples for NamespaceTopics ListByNamespace. + * Samples for Domains ListByResourceGroup. */ -public final class NamespaceTopicsListByNamespaceSamples { +public final class DomainsListByResourceGroupSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * NamespaceTopics_ListByNamespace.json + * Domains_ListByResourceGroup.json */ /** - * Sample code: NamespaceTopics_ListByNamespace. + * Sample code: Domains_ListByResourceGroup. * * @param manager Entry point to EventGridManager. */ - public static void namespaceTopicsListByNamespace(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.namespaceTopics() - .listByNamespace("examplerg", "examplenamespace2", null, null, com.azure.core.util.Context.NONE); + public static void domainsListByResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domains().listByResourceGroup("examplerg", null, null, com.azure.core.util.Context.NONE); } } ``` -### NamespaceTopics_ListSharedAccessKeys +### PartnerConfigurations_CreateOrUpdate ```java /** - * Samples for NamespaceTopics ListSharedAccessKeys. + * Samples for Domains Delete. */ -public final class NamespaceTopicsListSharedAccessKeysSamples { +public final class DomainsDeleteSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * NamespaceTopics_ListSharedAccessKeys.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Domains_Delete.json */ /** - * Sample code: NamespaceTopics_ListSharedAccessKeys. + * Sample code: Domains_Delete. * * @param manager Entry point to EventGridManager. */ - public static void - namespaceTopicsListSharedAccessKeys(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.namespaceTopics() - .listSharedAccessKeysWithResponse("examplerg", "examplenamespace2", "examplenamespacetopic2", - com.azure.core.util.Context.NONE); + public static void domainsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domains().delete("examplerg", "exampledomain1", com.azure.core.util.Context.NONE); } } ``` -### NamespaceTopics_RegenerateKey +### PartnerConfigurations_Delete ```java -import com.azure.resourcemanager.eventgrid.models.TopicRegenerateKeyRequest; - /** - * Samples for NamespaceTopics RegenerateKey. + * Samples for PrivateLinkResources ListByResource. */ -public final class NamespaceTopicsRegenerateKeySamples { +public final class PrivateLinkResourcesListByResourceSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * NamespaceTopics_RegenerateKey.json + * PrivateLinkResources_ListByResource.json */ /** - * Sample code: NamespaceTopics_RegenerateKey. + * Sample code: PrivateLinkResources_ListByResource. * * @param manager Entry point to EventGridManager. */ - public static void namespaceTopicsRegenerateKey(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.namespaceTopics() - .regenerateKey("examplerg", "examplenamespace2", "examplenamespacetopic2", - new TopicRegenerateKeyRequest().withKeyName("fakeTokenPlaceholder"), com.azure.core.util.Context.NONE); + public static void + privateLinkResourcesListByResource(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.privateLinkResources() + .listByResource("examplerg", "topics", "exampletopic1", null, null, com.azure.core.util.Context.NONE); } } ``` -### NamespaceTopics_Update +### PartnerConfigurations_GetByResourceGroup ```java -import com.azure.resourcemanager.eventgrid.models.NamespaceTopic; +import com.azure.resourcemanager.eventgrid.models.NamespaceRegenerateKeyRequest; /** - * Samples for NamespaceTopics Update. + * Samples for Namespaces RegenerateKey. */ -public final class NamespaceTopicsUpdateSamples { +public final class NamespacesRegenerateKeySamples { /* * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/NamespaceTopics_Update. + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Namespaces_RegenerateKey. * json */ /** - * Sample code: NamespaceTopics_Update. + * Sample code: Namespaces_RegenerateKey. * * @param manager Entry point to EventGridManager. */ - public static void namespaceTopicsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - NamespaceTopic resource = manager.namespaceTopics() - .getWithResponse("examplerg", "exampleNamespaceName1", "exampleNamespaceTopicName1", - com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withEventRetentionInDays(1).apply(); + public static void namespacesRegenerateKey(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.namespaces() + .regenerateKey("examplerg", "exampleNamespaceName1", + new NamespaceRegenerateKeyRequest().withKeyName("fakeTokenPlaceholder"), + com.azure.core.util.Context.NONE); } } ``` -### Namespaces_CreateOrUpdate +### PartnerConfigurations_List ```java -import com.azure.resourcemanager.eventgrid.models.TopicSpacesConfiguration; -import com.azure.resourcemanager.eventgrid.models.TopicSpacesConfigurationState; +/** + * Samples for DomainTopics CreateOrUpdate. + */ +public final class DomainTopicsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * DomainTopics_CreateOrUpdate.json + */ + /** + * Sample code: DomainTopics_CreateOrUpdate. + * + * @param manager Entry point to EventGridManager. + */ + public static void domainTopicsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domainTopics() + .createOrUpdate("examplerg", "exampledomain1", "exampledomaintopic1", com.azure.core.util.Context.NONE); + } +} +``` + +### PartnerConfigurations_ListByResourceGroup + +```java +import com.azure.resourcemanager.eventgrid.models.InboundIpRule; +import com.azure.resourcemanager.eventgrid.models.IpActionType; +import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; /** - * Samples for Namespaces CreateOrUpdate. + * Samples for Topics CreateOrUpdate. */ -public final class NamespacesCreateOrUpdateSamples { +public final class TopicsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Namespaces_CreateOrUpdate - * .json + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_CreateOrUpdate. + * json */ /** - * Sample code: Namespaces_CreateOrUpdate. + * Sample code: Topics_CreateOrUpdate. * * @param manager Entry point to EventGridManager. */ - public static void namespacesCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.namespaces() - .define("exampleNamespaceName1") - .withRegion("westus") + public static void topicsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.topics() + .define("exampletopic1") + .withRegion("westus2") .withExistingResourceGroup("examplerg") - .withTags(mapOf("tag1", "value11", "tag2", "value22")) - .withTopicSpacesConfiguration(new TopicSpacesConfiguration() - .withState(TopicSpacesConfigurationState.ENABLED) - .withRouteTopicResourceId( - "/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampleTopic1")) + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) + .withInboundIpRules( + Arrays.asList(new InboundIpRule().withIpMask("12.18.30.15").withAction(IpActionType.ALLOW), + new InboundIpRule().withIpMask("12.18.176.1").withAction(IpActionType.ALLOW))) .create(); } @@ -3120,1476 +3232,1383 @@ public final class NamespacesCreateOrUpdateSamples { } ``` -### Namespaces_Delete +### PartnerConfigurations_UnauthorizePartner ```java +import com.azure.resourcemanager.eventgrid.models.Namespace; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for Namespaces Delete. + * Samples for Namespaces Update. */ -public final class NamespacesDeleteSamples { +public final class NamespacesUpdateSamples { /* * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Namespaces_Delete.json + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Namespaces_Update.json */ /** - * Sample code: Namespaces_Delete. + * Sample code: Namespaces_Update. * * @param manager Entry point to EventGridManager. */ - public static void namespacesDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.namespaces().delete("examplerg", "exampleNamespaceName1", com.azure.core.util.Context.NONE); + public static void namespacesUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + Namespace resource = manager.namespaces() + .getByResourceGroupWithResponse("examplerg", "exampleNamespaceName1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1Updated")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### Namespaces_GetByResourceGroup +### PartnerConfigurations_Update ```java /** - * Samples for Namespaces GetByResourceGroup. + * Samples for Channels ListByPartnerNamespace. */ -public final class NamespacesGetByResourceGroupSamples { +public final class ChannelsListByPartnerNamespaceSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Namespaces_Get.json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * Channels_ListByPartnerNamespace.json */ /** - * Sample code: Namespaces_Get. + * Sample code: Channels_ListByPartnerNamespace. * * @param manager Entry point to EventGridManager. */ - public static void namespacesGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.namespaces() - .getByResourceGroupWithResponse("examplerg", "exampleNamespaceName1", com.azure.core.util.Context.NONE); + public static void channelsListByPartnerNamespace(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.channels() + .listByPartnerNamespace("examplerg", "examplePartnerNamespaceName1", null, null, + com.azure.core.util.Context.NONE); } } ``` -### Namespaces_List +### PartnerNamespaces_CreateOrUpdate ```java /** - * Samples for Namespaces List. + * Samples for VerifiedPartners List. */ -public final class NamespacesListSamples { +public final class VerifiedPartnersListSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * Namespaces_ListBySubscription.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/VerifiedPartners_List. + * json */ /** - * Sample code: Namespaces_ListBySubscription. + * Sample code: VerifiedPartners_List. * * @param manager Entry point to EventGridManager. */ - public static void namespacesListBySubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.namespaces().list(null, null, com.azure.core.util.Context.NONE); + public static void verifiedPartnersList(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.verifiedPartners().list(null, null, com.azure.core.util.Context.NONE); } } ``` -### Namespaces_ListByResourceGroup +### PartnerNamespaces_Delete ```java +import com.azure.resourcemanager.eventgrid.models.PartnerTopic; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for Namespaces ListByResourceGroup. + * Samples for PartnerTopics Update. */ -public final class NamespacesListByResourceGroupSamples { +public final class PartnerTopicsUpdateSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * Namespaces_ListByResourceGroup.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopics_Update.json */ /** - * Sample code: Namespaces_ListByResourceGroup. + * Sample code: PartnerTopics_Update. * * @param manager Entry point to EventGridManager. */ - public static void namespacesListByResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.namespaces().listByResourceGroup("examplerg", null, null, com.azure.core.util.Context.NONE); + public static void partnerTopicsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + PartnerTopic resource = manager.partnerTopics() + .getByResourceGroupWithResponse("examplerg", "examplePartnerTopicName1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### Namespaces_ListSharedAccessKeys +### PartnerNamespaces_GetByResourceGroup ```java /** - * Samples for Namespaces ListSharedAccessKeys. + * Samples for Namespaces List. */ -public final class NamespacesListSharedAccessKeysSamples { +public final class NamespacesListSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * Namespaces_ListSharedAccessKeys.json + * Namespaces_ListBySubscription.json */ /** - * Sample code: Namespaces_ListSharedAccessKeys. + * Sample code: Namespaces_ListBySubscription. * * @param manager Entry point to EventGridManager. */ - public static void namespacesListSharedAccessKeys(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.namespaces() - .listSharedAccessKeysWithResponse("examplerg", "exampleNamespaceName1", com.azure.core.util.Context.NONE); + public static void namespacesListBySubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.namespaces().list(null, null, com.azure.core.util.Context.NONE); } } ``` -### Namespaces_RegenerateKey +### PartnerNamespaces_List ```java -import com.azure.resourcemanager.eventgrid.models.NamespaceRegenerateKeyRequest; - /** - * Samples for Namespaces RegenerateKey. + * Samples for PermissionBindings ListByNamespace. */ -public final class NamespacesRegenerateKeySamples { +public final class PermissionBindingsListByNamespaceSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Namespaces_RegenerateKey. - * json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * PermissionBindings_ListByNamespace.json */ /** - * Sample code: Namespaces_RegenerateKey. + * Sample code: PermissionBindings_ListByNamespace. * * @param manager Entry point to EventGridManager. */ - public static void namespacesRegenerateKey(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.namespaces() - .regenerateKey("examplerg", "exampleNamespaceName1", - new NamespaceRegenerateKeyRequest().withKeyName("fakeTokenPlaceholder"), - com.azure.core.util.Context.NONE); + public static void permissionBindingsListByNamespace(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.permissionBindings() + .listByNamespace("examplerg", "namespace123", null, null, com.azure.core.util.Context.NONE); } } ``` -### Namespaces_Update +### PartnerNamespaces_ListByResourceGroup ```java -import com.azure.resourcemanager.eventgrid.models.Namespace; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for Namespaces Update. + * Samples for NamespaceTopicEventSubscriptions ListByNamespaceTopic. */ -public final class NamespacesUpdateSamples { +public final class NamespaceTopicEventSubscriptionsListByNamespaceTopicSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Namespaces_Update.json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * NamespaceTopicEventSubscriptions_ListByNamespaceTopic.json */ /** - * Sample code: Namespaces_Update. + * Sample code: NamespaceTopicEventSubscriptions_ListByNamespaceTopic. * * @param manager Entry point to EventGridManager. */ - public static void namespacesUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - Namespace resource = manager.namespaces() - .getByResourceGroupWithResponse("examplerg", "exampleNamespaceName1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withTags(mapOf("tag1", "value1Updated")).apply(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + public static void namespaceTopicEventSubscriptionsListByNamespaceTopic( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.namespaceTopicEventSubscriptions() + .listByNamespaceTopic("examplerg", "examplenamespace2", "examplenamespacetopic2", null, null, + com.azure.core.util.Context.NONE); } } ``` -### Namespaces_ValidateCustomDomainOwnership +### PartnerNamespaces_ListSharedAccessKeys ```java /** - * Samples for Namespaces ValidateCustomDomainOwnership. + * Samples for NamespaceTopics ListSharedAccessKeys. */ -public final class NamespacesValidateCustomDomainOwnershipSamples { +public final class NamespaceTopicsListSharedAccessKeysSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * Namespaces_ValidateCustomDomainOwnership.json + * NamespaceTopics_ListSharedAccessKeys.json */ /** - * Sample code: Namespaces_ValidateCustomDomainOwnership. + * Sample code: NamespaceTopics_ListSharedAccessKeys. * * @param manager Entry point to EventGridManager. */ public static void - namespacesValidateCustomDomainOwnership(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.namespaces() - .validateCustomDomainOwnership("examplerg", "exampleNamespaceName1", com.azure.core.util.Context.NONE); + namespaceTopicsListSharedAccessKeys(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.namespaceTopics() + .listSharedAccessKeysWithResponse("examplerg", "examplenamespace2", "examplenamespacetopic2", + com.azure.core.util.Context.NONE); } } ``` -### Operations_List +### PartnerNamespaces_RegenerateKey ```java /** - * Samples for Operations List. + * Samples for TopicEventSubscriptions Delete. */ -public final class OperationsListSamples { +public final class TopicEventSubscriptionsDeleteSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Operations_List.json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * TopicEventSubscriptions_Delete.json */ /** - * Sample code: Operations_List. + * Sample code: TopicEventSubscriptions_Delete. * * @param manager Entry point to EventGridManager. */ - public static void operationsList(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); + public static void topicEventSubscriptionsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.topicEventSubscriptions() + .delete("examplerg", "exampleTopic", "examplesubscription", com.azure.core.util.Context.NONE); } } ``` -### PartnerConfigurations_AuthorizePartner +### PartnerNamespaces_Update ```java -import com.azure.resourcemanager.eventgrid.models.Partner; -import java.time.OffsetDateTime; -import java.util.UUID; +import java.util.HashMap; +import java.util.Map; /** - * Samples for PartnerConfigurations AuthorizePartner. + * Samples for PartnerRegistrations CreateOrUpdate. */ -public final class PartnerConfigurationsAuthorizePartnerSamples { +public final class PartnerRegistrationsCreateOrUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerConfigurations_AuthorizePartner.json + * PartnerRegistrations_CreateOrUpdate.json */ /** - * Sample code: PartnerConfigurations_AuthorizePartner. + * Sample code: PartnerRegistrations_CreateOrUpdate. * * @param manager Entry point to EventGridManager. */ public static void - partnerConfigurationsAuthorizePartner(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerConfigurations() - .authorizePartnerWithResponse("examplerg", - new Partner() - .withPartnerRegistrationImmutableId(UUID.fromString("941892bc-f5d0-4d1c-8fb5-477570fc2b71")) - .withPartnerName("Contoso.Finance") - .withAuthorizationExpirationTimeInUtc(OffsetDateTime.parse("2022-01-28T01:20:55.142Z")), - com.azure.core.util.Context.NONE); + partnerRegistrationsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerRegistrations() + .define("examplePartnerRegistrationName1") + .withRegion("global") + .withExistingResourceGroup("examplerg") + .withTags( + mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder", "key3", "fakeTokenPlaceholder")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### PartnerConfigurations_CreateOrUpdate +### PartnerRegistrations_CreateOrUpdate ```java -import com.azure.resourcemanager.eventgrid.fluent.models.PartnerConfigurationInner; -import com.azure.resourcemanager.eventgrid.models.Partner; -import com.azure.resourcemanager.eventgrid.models.PartnerAuthorization; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.UUID; - /** - * Samples for PartnerConfigurations CreateOrUpdate. + * Samples for TopicEventSubscriptions List. */ -public final class PartnerConfigurationsCreateOrUpdateSamples { +public final class TopicEventSubscriptionsListSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerConfigurations_CreateOrUpdate.json + * TopicEventSubscriptions_List.json */ /** - * Sample code: PartnerConfigurations_CreateOrUpdate. + * Sample code: TopicEventSubscriptions_List. * * @param manager Entry point to EventGridManager. */ - public static void - partnerConfigurationsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerConfigurations() - .createOrUpdate("examplerg", - new PartnerConfigurationInner() - .withPartnerAuthorization(new PartnerAuthorization().withDefaultMaximumExpirationTimeInDays(10) - .withAuthorizedPartnersList(Arrays.asList( - new Partner() - .withPartnerRegistrationImmutableId( - UUID.fromString("941892bc-f5d0-4d1c-8fb5-477570fc2b71")) - .withPartnerName("Contoso.Finance") - .withAuthorizationExpirationTimeInUtc(OffsetDateTime.parse("2022-01-28T01:20:55.142Z")), - new Partner() - .withPartnerRegistrationImmutableId( - UUID.fromString("5362bdb6-ce3e-4d0d-9a5b-3eb92c8aab38")) - .withPartnerName("fabrikam.HR") - .withAuthorizationExpirationTimeInUtc( - OffsetDateTime.parse("2022-02-20T01:00:00.142Z"))))), - com.azure.core.util.Context.NONE); + public static void topicEventSubscriptionsList(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.topicEventSubscriptions() + .list("examplerg", "exampleTopic1", null, null, com.azure.core.util.Context.NONE); } } ``` -### PartnerConfigurations_Delete +### PartnerRegistrations_Delete ```java /** - * Samples for PartnerConfigurations Delete. + * Samples for TopicEventSubscriptions GetFullUrl. */ -public final class PartnerConfigurationsDeleteSamples { +public final class TopicEventSubscriptionsGetFullUrlSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerConfigurations_Delete.json + * TopicEventSubscriptions_GetFullUrl.json */ /** - * Sample code: PartnerConfigurations_Delete. + * Sample code: TopicEventSubscriptions_GetFullUrl. * * @param manager Entry point to EventGridManager. */ - public static void partnerConfigurationsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerConfigurations().delete("examplerg", com.azure.core.util.Context.NONE); + public static void topicEventSubscriptionsGetFullUrl(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.topicEventSubscriptions() + .getFullUrlWithResponse("examplerg", "exampleTopic1", "examplesubscription1", + com.azure.core.util.Context.NONE); } } ``` -### PartnerConfigurations_GetByResourceGroup +### PartnerRegistrations_GetByResourceGroup ```java /** - * Samples for PartnerConfigurations GetByResourceGroup. + * Samples for PrivateLinkResources Get. */ -public final class PartnerConfigurationsGetByResourceGroupSamples { +public final class PrivateLinkResourcesGetSamples { /* * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerConfigurations_Get - * .json + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PrivateLinkResources_Get. + * json */ /** - * Sample code: PartnerConfigurations_Get. + * Sample code: PrivateLinkResources_Get. * * @param manager Entry point to EventGridManager. */ - public static void partnerConfigurationsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerConfigurations().getByResourceGroupWithResponse("examplerg", com.azure.core.util.Context.NONE); + public static void privateLinkResourcesGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.privateLinkResources() + .getWithResponse("examplerg", "topics", "exampletopic1", "topic", com.azure.core.util.Context.NONE); } } ``` -### PartnerConfigurations_List +### PartnerRegistrations_List ```java /** - * Samples for PartnerConfigurations List. + * Samples for Channels Delete. */ -public final class PartnerConfigurationsListSamples { +public final class ChannelsDeleteSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerConfigurations_ListBySubscription.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Channels_Delete.json */ /** - * Sample code: PartnerConfigurations_ListBySubscription. + * Sample code: Channels_Delete. * * @param manager Entry point to EventGridManager. */ - public static void - partnerConfigurationsListBySubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerConfigurations().list(null, null, com.azure.core.util.Context.NONE); + public static void channelsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.channels() + .delete("examplerg", "examplePartnerNamespaceName1", "exampleEventChannelName1", + com.azure.core.util.Context.NONE); } } ``` -### PartnerConfigurations_ListByResourceGroup +### PartnerRegistrations_ListByResourceGroup ```java /** - * Samples for PartnerConfigurations ListByResourceGroup. + * Samples for PartnerTopics Deactivate. */ -public final class PartnerConfigurationsListByResourceGroupSamples { +public final class PartnerTopicsDeactivateSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerConfigurations_ListByResourceGroup.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopics_Deactivate. + * json */ /** - * Sample code: PartnerConfigurations_ListByResourceGroup. + * Sample code: PartnerTopics_Deactivate. * * @param manager Entry point to EventGridManager. */ - public static void - partnerConfigurationsListByResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerConfigurations().listByResourceGroup("examplerg", com.azure.core.util.Context.NONE); + public static void partnerTopicsDeactivate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerTopics() + .deactivateWithResponse("examplerg", "examplePartnerTopic1", com.azure.core.util.Context.NONE); } } ``` -### PartnerConfigurations_UnauthorizePartner +### PartnerRegistrations_Update ```java -import com.azure.resourcemanager.eventgrid.models.Partner; -import java.time.OffsetDateTime; -import java.util.UUID; - /** - * Samples for PartnerConfigurations UnauthorizePartner. + * Samples for EventSubscriptions ListRegionalByResourceGroup. */ -public final class PartnerConfigurationsUnauthorizePartnerSamples { +public final class EventSubscriptionsListRegionalByResourceGroupSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerConfigurations_UnauthorizePartner.json + * EventSubscriptions_ListRegionalByResourceGroup.json */ /** - * Sample code: PartnerConfigurations_UnauthorizePartner. + * Sample code: EventSubscriptions_ListRegionalByResourceGroup. * * @param manager Entry point to EventGridManager. */ public static void - partnerConfigurationsUnauthorizePartner(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerConfigurations() - .unauthorizePartnerWithResponse("examplerg", - new Partner() - .withPartnerRegistrationImmutableId(UUID.fromString("941892bc-f5d0-4d1c-8fb5-477570fc2b71")) - .withPartnerName("Contoso.Finance") - .withAuthorizationExpirationTimeInUtc(OffsetDateTime.parse("2022-01-28T01:20:55.142Z")), - com.azure.core.util.Context.NONE); + eventSubscriptionsListRegionalByResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .listRegionalByResourceGroup("examplerg", "westus2", null, null, com.azure.core.util.Context.NONE); } } ``` -### PartnerConfigurations_Update +### PartnerTopicEventSubscriptions_CreateOrUpdate ```java -import com.azure.resourcemanager.eventgrid.models.PartnerConfigurationUpdateParameters; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for PartnerConfigurations Update. + * Samples for DomainTopics Delete. */ -public final class PartnerConfigurationsUpdateSamples { +public final class DomainTopicsDeleteSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerConfigurations_Update.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/DomainTopics_Delete.json */ /** - * Sample code: PartnerConfigurations_Update. + * Sample code: DomainTopics_Delete. * * @param manager Entry point to EventGridManager. */ - public static void partnerConfigurationsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerConfigurations() - .update("examplerg", - new PartnerConfigurationUpdateParameters().withTags(mapOf("tag1", "value11", "tag2", "value22")) - .withDefaultMaximumExpirationTimeInDays(100), - com.azure.core.util.Context.NONE); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + public static void domainTopicsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domainTopics() + .delete("examplerg", "exampledomain1", "exampledomaintopic1", com.azure.core.util.Context.NONE); } } ``` -### PartnerNamespaces_CreateOrUpdate +### PartnerTopicEventSubscriptions_Delete ```java -import java.util.HashMap; -import java.util.Map; - /** - * Samples for PartnerNamespaces CreateOrUpdate. + * Samples for DomainTopicEventSubscriptions GetDeliveryAttributes. */ -public final class PartnerNamespacesCreateOrUpdateSamples { +public final class DomainTopicEventSubscriptionsGetDeliveryAttributesSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerNamespaces_CreateOrUpdate.json + * DomainTopicEventSubscriptions_GetDeliveryAttributes.json */ /** - * Sample code: PartnerNamespaces_CreateOrUpdate. + * Sample code: DomainTopicEventSubscriptions_GetDeliveryAttributes. * * @param manager Entry point to EventGridManager. */ - public static void partnerNamespacesCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerNamespaces() - .define("examplePartnerNamespaceName1") - .withRegion("westus") - .withExistingResourceGroup("examplerg") - .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withPartnerRegistrationFullyQualifiedId( - "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerRegistrations/ContosoCorpAccount1") - .create(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + public static void domainTopicEventSubscriptionsGetDeliveryAttributes( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domainTopicEventSubscriptions() + .getDeliveryAttributesWithResponse("examplerg", "exampleDomain1", "exampleDomainTopic1", + "examplesubscription1", com.azure.core.util.Context.NONE); } } ``` -### PartnerNamespaces_Delete +### PartnerTopicEventSubscriptions_Get ```java /** - * Samples for PartnerNamespaces Delete. + * Samples for NamespaceTopics Delete. */ -public final class PartnerNamespacesDeleteSamples { +public final class NamespaceTopicsDeleteSamples { /* * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerNamespaces_Delete. + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/NamespaceTopics_Delete. * json */ /** - * Sample code: PartnerNamespaces_Delete. + * Sample code: NamespaceTopics_Delete. * * @param manager Entry point to EventGridManager. */ - public static void partnerNamespacesDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerNamespaces() - .delete("examplerg", "examplePartnerNamespaceName1", com.azure.core.util.Context.NONE); + public static void namespaceTopicsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.namespaceTopics() + .delete("examplerg", "examplenamespace2", "examplenamespacetopic2", com.azure.core.util.Context.NONE); } } ``` -### PartnerNamespaces_GetByResourceGroup +### PartnerTopicEventSubscriptions_GetDeliveryAttributes ```java /** - * Samples for PartnerNamespaces GetByResourceGroup. + * Samples for CaCertificates Delete. */ -public final class PartnerNamespacesGetByResourceGroupSamples { +public final class CaCertificatesDeleteSamples { /* * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerNamespaces_Get. + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/CaCertificates_Delete. * json */ /** - * Sample code: PartnerNamespaces_Get. + * Sample code: CaCertificates_Delete. * * @param manager Entry point to EventGridManager. */ - public static void partnerNamespacesGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerNamespaces() - .getByResourceGroupWithResponse("examplerg", "examplePartnerNamespaceName1", + public static void caCertificatesDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.caCertificates() + .delete("examplerg", "exampleNamespaceName1", "exampleCACertificateName1", com.azure.core.util.Context.NONE); } } ``` -### PartnerNamespaces_List +### PartnerTopicEventSubscriptions_GetFullUrl ```java -/** - * Samples for PartnerNamespaces List. - */ -public final class PartnerNamespacesListSamples { - /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerNamespaces_ListBySubscription.json - */ - /** - * Sample code: PartnerNamespaces_ListBySubscription. - * - * @param manager Entry point to EventGridManager. - */ - public static void - partnerNamespacesListBySubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerNamespaces().list(null, null, com.azure.core.util.Context.NONE); - } -} -``` - -### PartnerNamespaces_ListByResourceGroup +import com.azure.resourcemanager.eventgrid.models.AzureFunctionEventSubscriptionDestination; +import com.azure.resourcemanager.eventgrid.models.EventHubEventSubscriptionDestination; +import com.azure.resourcemanager.eventgrid.models.EventSubscription; +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; +import com.azure.resourcemanager.eventgrid.models.HybridConnectionEventSubscriptionDestination; +import com.azure.resourcemanager.eventgrid.models.ServiceBusQueueEventSubscriptionDestination; +import com.azure.resourcemanager.eventgrid.models.ServiceBusTopicEventSubscriptionDestination; +import com.azure.resourcemanager.eventgrid.models.StorageBlobDeadLetterDestination; +import com.azure.resourcemanager.eventgrid.models.StorageQueueEventSubscriptionDestination; +import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination; +import java.util.Arrays; -```java /** - * Samples for PartnerNamespaces ListByResourceGroup. + * Samples for EventSubscriptions Update. */ -public final class PartnerNamespacesListByResourceGroupSamples { +public final class EventSubscriptionsUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerNamespaces_ListByResourceGroup.json + * EventSubscriptions_UpdateForCustomTopic_EventHubDestination.json */ /** - * Sample code: PartnerNamespaces_ListByResourceGroup. + * Sample code: EventSubscriptions_UpdateForCustomTopic_EventHubDestination. * * @param manager Entry point to EventGridManager. */ - public static void - partnerNamespacesListByResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerNamespaces().listByResourceGroup("examplerg", null, null, com.azure.core.util.Context.NONE); + public static void eventSubscriptionsUpdateForCustomTopicEventHubDestination( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + EventSubscription resource = manager.eventSubscriptions() + .getWithResponse( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", + "examplesubscription1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withDestination(new EventHubEventSubscriptionDestination().withResourceId( + "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") + .withSubjectEndsWith("newSuffix") + .withIsSubjectCaseSensitive(true)) + .withLabels(Arrays.asList("label1", "label2")) + .apply(); } -} -``` -### PartnerNamespaces_ListSharedAccessKeys - -```java -/** - * Samples for PartnerNamespaces ListSharedAccessKeys. - */ -public final class PartnerNamespacesListSharedAccessKeysSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerNamespaces_ListSharedAccessKeys.json + * EventSubscriptions_UpdateForCustomTopic_AzureFunctionDestination.json */ /** - * Sample code: PartnerNamespaces_ListSharedAccessKeys. + * Sample code: EventSubscriptions_UpdateForCustomTopic_AzureFunctionDestination. * * @param manager Entry point to EventGridManager. */ - public static void - partnerNamespacesListSharedAccessKeys(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerNamespaces() - .listSharedAccessKeysWithResponse("examplerg", "examplePartnerNamespaceName1", - com.azure.core.util.Context.NONE); + public static void eventSubscriptionsUpdateForCustomTopicAzureFunctionDestination( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + EventSubscription resource = manager.eventSubscriptions() + .getWithResponse( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1", + "examplesubscription1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withDestination(new AzureFunctionEventSubscriptionDestination().withResourceId( + "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Web/sites/ContosoSite/funtions/ContosoFunc")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") + .withSubjectEndsWith("ExampleSuffix") + .withIsSubjectCaseSensitive(false)) + .withDeadLetterDestination(new StorageBlobDeadLetterDestination().withResourceId( + "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg") + .withBlobContainerName("contosocontainer")) + .apply(); } -} -``` - -### PartnerNamespaces_RegenerateKey -```java -import com.azure.resourcemanager.eventgrid.models.PartnerNamespaceRegenerateKeyRequest; - -/** - * Samples for PartnerNamespaces RegenerateKey. - */ -public final class PartnerNamespacesRegenerateKeySamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerNamespaces_RegenerateKey.json + * EventSubscriptions_UpdateForCustomTopic_WebhookDestination.json */ /** - * Sample code: PartnerNamespaces_RegenerateKey. + * Sample code: EventSubscriptions_UpdateForCustomTopic_WebhookDestination. * * @param manager Entry point to EventGridManager. */ - public static void partnerNamespacesRegenerateKey(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerNamespaces() - .regenerateKeyWithResponse("examplerg", "examplePartnerNamespaceName1", - new PartnerNamespaceRegenerateKeyRequest().withKeyName("fakeTokenPlaceholder"), - com.azure.core.util.Context.NONE); + public static void eventSubscriptionsUpdateForCustomTopicWebhookDestination( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + EventSubscription resource = manager.eventSubscriptions() + .getWithResponse( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", + "examplesubscription1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withDestination(new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") + .withSubjectEndsWith("newSuffix") + .withIsSubjectCaseSensitive(true)) + .withLabels(Arrays.asList("label1", "label2")) + .apply(); } -} -``` - -### PartnerNamespaces_Update - -```java -import com.azure.resourcemanager.eventgrid.models.PartnerNamespace; -import java.util.HashMap; -import java.util.Map; -/** - * Samples for PartnerNamespaces Update. - */ -public final class PartnerNamespacesUpdateSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerNamespaces_Update. - * json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * EventSubscriptions_UpdateForCustomTopic_StorageQueueDestination.json */ /** - * Sample code: PartnerNamespaces_Update. + * Sample code: EventSubscriptions_UpdateForCustomTopic_StorageQueueDestination. * * @param manager Entry point to EventGridManager. */ - public static void partnerNamespacesUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - PartnerNamespace resource = manager.partnerNamespaces() - .getByResourceGroupWithResponse("examplerg", "examplePartnerNamespaceName1", - com.azure.core.util.Context.NONE) + public static void eventSubscriptionsUpdateForCustomTopicStorageQueueDestination( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + EventSubscription resource = manager.eventSubscriptions() + .getWithResponse( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1", + "examplesubscription1", com.azure.core.util.Context.NONE) .getValue(); - resource.update().withTags(mapOf("tag1", "value1")).apply(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + resource.update() + .withDestination(new StorageQueueEventSubscriptionDestination().withResourceId( + "/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg") + .withQueueName("queue1") + .withQueueMessageTimeToLiveInSeconds(300L)) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") + .withSubjectEndsWith("ExampleSuffix") + .withIsSubjectCaseSensitive(false)) + .withDeadLetterDestination(new StorageBlobDeadLetterDestination().withResourceId( + "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg") + .withBlobContainerName("contosocontainer")) + .apply(); } -} -``` -### PartnerRegistrations_CreateOrUpdate - -```java -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for PartnerRegistrations CreateOrUpdate. - */ -public final class PartnerRegistrationsCreateOrUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerRegistrations_CreateOrUpdate.json + * EventSubscriptions_UpdateForCustomTopic_ServiceBusTopicDestination.json */ /** - * Sample code: PartnerRegistrations_CreateOrUpdate. + * Sample code: EventSubscriptions_UpdateForCustomTopic_ServiceBusTopicDestination. * * @param manager Entry point to EventGridManager. */ - public static void - partnerRegistrationsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerRegistrations() - .define("examplePartnerRegistrationName1") - .withRegion("global") - .withExistingResourceGroup("examplerg") - .withTags( - mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder", "key3", "fakeTokenPlaceholder")) - .create(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + public static void eventSubscriptionsUpdateForCustomTopicServiceBusTopicDestination( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + EventSubscription resource = manager.eventSubscriptions() + .getWithResponse( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", + "examplesubscription1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withDestination(new ServiceBusTopicEventSubscriptionDestination().withResourceId( + "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/topics/SBT")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") + .withSubjectEndsWith("newSuffix") + .withIsSubjectCaseSensitive(true)) + .withLabels(Arrays.asList("label1", "label2")) + .apply(); } -} -``` - -### PartnerRegistrations_Delete -```java -/** - * Samples for PartnerRegistrations Delete. - */ -public final class PartnerRegistrationsDeleteSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerRegistrations_Delete.json + * EventSubscriptions_UpdateForCustomTopic_HybridConnectionDestination.json */ /** - * Sample code: PartnerRegistrations_Delete. + * Sample code: EventSubscriptions_UpdateForCustomTopic_HybridConnectionDestination. * * @param manager Entry point to EventGridManager. */ - public static void partnerRegistrationsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerRegistrations() - .delete("examplerg", "examplePartnerRegistrationName1", com.azure.core.util.Context.NONE); + public static void eventSubscriptionsUpdateForCustomTopicHybridConnectionDestination( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + EventSubscription resource = manager.eventSubscriptions() + .getWithResponse( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", + "examplesubscription1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withDestination(new HybridConnectionEventSubscriptionDestination().withResourceId( + "/subscriptions/d33c5f7a-02ea-40f4-bf52-07f17e84d6a8/resourceGroups/TestRG/providers/Microsoft.Relay/namespaces/ContosoNamespace/hybridConnections/HC1")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") + .withSubjectEndsWith("newSuffix") + .withIsSubjectCaseSensitive(true)) + .withLabels(Arrays.asList("label1", "label2")) + .apply(); } -} -``` -### PartnerRegistrations_GetByResourceGroup - -```java -/** - * Samples for PartnerRegistrations GetByResourceGroup. - */ -public final class PartnerRegistrationsGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerRegistrations_Get. - * json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * EventSubscriptions_UpdateForCustomTopic_ServiceBusQueueDestination.json */ /** - * Sample code: PartnerRegistrations_Get. + * Sample code: EventSubscriptions_UpdateForCustomTopic_ServiceBusQueueDestination. * * @param manager Entry point to EventGridManager. */ - public static void partnerRegistrationsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerRegistrations() - .getByResourceGroupWithResponse("examplerg", "examplePartnerRegistrationName1", - com.azure.core.util.Context.NONE); + public static void eventSubscriptionsUpdateForCustomTopicServiceBusQueueDestination( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + EventSubscription resource = manager.eventSubscriptions() + .getWithResponse( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1", + "examplesubscription1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withDestination(new ServiceBusQueueEventSubscriptionDestination().withResourceId( + "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ContosoNamespace/queues/SBQ")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") + .withSubjectEndsWith("ExampleSuffix") + .withIsSubjectCaseSensitive(false)) + .withDeadLetterDestination(new StorageBlobDeadLetterDestination().withResourceId( + "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg") + .withBlobContainerName("contosocontainer")) + .apply(); } -} -``` -### PartnerRegistrations_List - -```java -/** - * Samples for PartnerRegistrations List. - */ -public final class PartnerRegistrationsListSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerRegistrations_ListBySubscription.json + * EventSubscriptions_UpdateForCustomTopic.json */ /** - * Sample code: PartnerRegistrations_ListBySubscription. + * Sample code: EventSubscriptions_UpdateForCustomTopic. * * @param manager Entry point to EventGridManager. */ public static void - partnerRegistrationsListBySubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerRegistrations().list(null, null, com.azure.core.util.Context.NONE); + eventSubscriptionsUpdateForCustomTopic(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + EventSubscription resource = manager.eventSubscriptions() + .getWithResponse( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", + "examplesubscription1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withDestination(new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") + .withSubjectEndsWith("newSuffix") + .withIsSubjectCaseSensitive(true)) + .withLabels(Arrays.asList("label1", "label2")) + .apply(); } -} -``` -### PartnerRegistrations_ListByResourceGroup - -```java -/** - * Samples for PartnerRegistrations ListByResourceGroup. - */ -public final class PartnerRegistrationsListByResourceGroupSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerRegistrations_ListByResourceGroup.json + * EventSubscriptions_UpdateForResource.json */ /** - * Sample code: PartnerRegistrations_ListByResourceGroup. + * Sample code: EventSubscriptions_UpdateForResource. * * @param manager Entry point to EventGridManager. */ public static void - partnerRegistrationsListByResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerRegistrations().listByResourceGroup("examplerg", null, null, com.azure.core.util.Context.NONE); + eventSubscriptionsUpdateForResource(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + EventSubscription resource = manager.eventSubscriptions() + .getWithResponse( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1", + "examplesubscription1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withDestination(new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") + .withSubjectEndsWith("newSuffix") + .withIsSubjectCaseSensitive(true)) + .withLabels(Arrays.asList("label1", "label2")) + .apply(); } -} -``` - -### PartnerRegistrations_Update - -```java -import com.azure.resourcemanager.eventgrid.models.PartnerRegistration; -import java.util.HashMap; -import java.util.Map; -/** - * Samples for PartnerRegistrations Update. - */ -public final class PartnerRegistrationsUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerRegistrations_Update.json + * EventSubscriptions_UpdateForResourceGroup.json */ /** - * Sample code: PartnerRegistrations_Update. + * Sample code: EventSubscriptions_UpdateForResourceGroup. * * @param manager Entry point to EventGridManager. */ - public static void partnerRegistrationsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - PartnerRegistration resource = manager.partnerRegistrations() - .getByResourceGroupWithResponse("examplerg", "examplePartnerRegistrationName1", - com.azure.core.util.Context.NONE) + public static void + eventSubscriptionsUpdateForResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + EventSubscription resource = manager.eventSubscriptions() + .getWithResponse("subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg", + "examplesubscription2", com.azure.core.util.Context.NONE) .getValue(); - resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + resource.update() + .withDestination(new EventHubEventSubscriptionDestination().withResourceId( + "/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/ContosoNamespace/eventhubs/EH1")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") + .withSubjectEndsWith("newSuffix") + .withIsSubjectCaseSensitive(true)) + .withLabels(Arrays.asList("label1", "label2")) + .apply(); } -} -``` -### PartnerTopicEventSubscriptions_CreateOrUpdate - -```java -import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; -import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination; - -/** - * Samples for PartnerTopicEventSubscriptions CreateOrUpdate. - */ -public final class PartnerTopicEventSubscriptionsCreateOrUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerTopicEventSubscriptions_CreateOrUpdate.json + * EventSubscriptions_UpdateForSubscription.json */ /** - * Sample code: PartnerTopicEventSubscriptions_CreateOrUpdate. + * Sample code: EventSubscriptions_UpdateForSubscription. * * @param manager Entry point to EventGridManager. */ public static void - partnerTopicEventSubscriptionsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerTopicEventSubscriptions() - .createOrUpdate("examplerg", "examplePartnerTopic1", "exampleEventSubscriptionName1", - new EventSubscriptionInner() - .withDestination( - new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") - .withSubjectEndsWith("ExampleSuffix") - .withIsSubjectCaseSensitive(false)), - com.azure.core.util.Context.NONE); + eventSubscriptionsUpdateForSubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + EventSubscription resource = manager.eventSubscriptions() + .getWithResponse("subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4", "examplesubscription3", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withDestination(new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") + .withSubjectEndsWith("newSuffix") + .withIsSubjectCaseSensitive(true)) + .withLabels(Arrays.asList("label1", "label2")) + .apply(); } } ``` -### PartnerTopicEventSubscriptions_Delete +### PartnerTopicEventSubscriptions_ListByPartnerTopic ```java +import java.util.Arrays; + /** - * Samples for PartnerTopicEventSubscriptions Delete. + * Samples for TopicSpaces CreateOrUpdate. */ -public final class PartnerTopicEventSubscriptionsDeleteSamples { +public final class TopicSpacesCreateOrUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerTopicEventSubscriptions_Delete.json + * TopicSpaces_CreateOrUpdate.json */ /** - * Sample code: PartnerTopicEventSubscriptions_Delete. + * Sample code: TopicSpaces_CreateOrUpdate. * * @param manager Entry point to EventGridManager. */ - public static void - partnerTopicEventSubscriptionsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerTopicEventSubscriptions() - .delete("examplerg", "examplePartnerTopic1", "examplesubscription1", com.azure.core.util.Context.NONE); + public static void topicSpacesCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.topicSpaces() + .define("exampleTopicSpaceName1") + .withExistingNamespace("examplerg", "exampleNamespaceName1") + .withTopicTemplates(Arrays.asList("filter1", "filter2")) + .create(); } } ``` -### PartnerTopicEventSubscriptions_Get +### PartnerTopicEventSubscriptions_Update ```java +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters; +import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination; +import java.util.Arrays; + /** - * Samples for PartnerTopicEventSubscriptions Get. + * Samples for PartnerTopicEventSubscriptions Update. */ -public final class PartnerTopicEventSubscriptionsGetSamples { +public final class PartnerTopicEventSubscriptionsUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerTopicEventSubscriptions_Get.json + * PartnerTopicEventSubscriptions_Update.json */ /** - * Sample code: PartnerTopicEventSubscriptions_Get. + * Sample code: PartnerTopicEventSubscriptions_Update. * * @param manager Entry point to EventGridManager. */ - public static void partnerTopicEventSubscriptionsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + public static void + partnerTopicEventSubscriptionsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { manager.partnerTopicEventSubscriptions() - .getWithResponse("examplerg", "examplePartnerTopic1", "examplesubscription1", + .update("examplerg", "examplePartnerTopic1", "exampleEventSubscriptionName1", + new EventSubscriptionUpdateParameters() + .withDestination( + new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") + .withSubjectEndsWith("newSuffix") + .withIsSubjectCaseSensitive(true)) + .withLabels(Arrays.asList("label1", "label2")), com.azure.core.util.Context.NONE); } } ``` -### PartnerTopicEventSubscriptions_GetDeliveryAttributes +### PartnerTopics_Activate ```java /** - * Samples for PartnerTopicEventSubscriptions GetDeliveryAttributes. + * Samples for TopicSpaces Delete. */ -public final class PartnerTopicEventSubscriptionsGetDeliveryAttributesSamples { +public final class TopicSpacesDeleteSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerTopicEventSubscriptions_GetDeliveryAttributes.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicSpaces_Delete.json */ /** - * Sample code: PartnerTopicEventSubscriptions_GetDeliveryAttributes. + * Sample code: TopicSpaces_Delete. * * @param manager Entry point to EventGridManager. */ - public static void partnerTopicEventSubscriptionsGetDeliveryAttributes( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerTopicEventSubscriptions() - .getDeliveryAttributesWithResponse("examplerg", "examplePartnerTopic1", "examplesubscription1", - com.azure.core.util.Context.NONE); + public static void topicSpacesDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.topicSpaces() + .delete("examplerg", "exampleNamespaceName1", "exampleTopicSpaceName1", com.azure.core.util.Context.NONE); } } ``` -### PartnerTopicEventSubscriptions_GetFullUrl +### PartnerTopics_CreateOrUpdate ```java /** - * Samples for PartnerTopicEventSubscriptions GetFullUrl. + * Samples for Namespaces Delete. */ -public final class PartnerTopicEventSubscriptionsGetFullUrlSamples { +public final class NamespacesDeleteSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerTopicEventSubscriptions_GetFullUrl.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Namespaces_Delete.json */ /** - * Sample code: PartnerTopicEventSubscriptions_GetFullUrl. + * Sample code: Namespaces_Delete. * * @param manager Entry point to EventGridManager. */ - public static void - partnerTopicEventSubscriptionsGetFullUrl(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerTopicEventSubscriptions() - .getFullUrlWithResponse("examplerg", "examplePartnerTopic1", "examplesubscription1", - com.azure.core.util.Context.NONE); + public static void namespacesDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.namespaces().delete("examplerg", "exampleNamespaceName1", com.azure.core.util.Context.NONE); } } ``` -### PartnerTopicEventSubscriptions_ListByPartnerTopic +### PartnerTopics_Deactivate ```java /** - * Samples for PartnerTopicEventSubscriptions ListByPartnerTopic. + * Samples for EventSubscriptions List. */ -public final class PartnerTopicEventSubscriptionsListByPartnerTopicSamples { +public final class EventSubscriptionsListSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerTopicEventSubscriptions_ListByPartnerTopic.json + * EventSubscriptions_ListGlobalBySubscription.json */ /** - * Sample code: PartnerTopicEventSubscriptions_ListByPartnerTopic. + * Sample code: EventSubscriptions_ListGlobalBySubscription. * * @param manager Entry point to EventGridManager. */ public static void - partnerTopicEventSubscriptionsListByPartnerTopic(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerTopicEventSubscriptions() - .listByPartnerTopic("examplerg", "examplePartnerTopic1", null, null, com.azure.core.util.Context.NONE); + eventSubscriptionsListGlobalBySubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions().list(null, null, com.azure.core.util.Context.NONE); } } ``` -### PartnerTopicEventSubscriptions_Update +### PartnerTopics_Delete ```java +import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner; import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters; import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination; -import java.util.Arrays; /** - * Samples for PartnerTopicEventSubscriptions Update. + * Samples for TopicEventSubscriptions CreateOrUpdate. */ -public final class PartnerTopicEventSubscriptionsUpdateSamples { +public final class TopicEventSubscriptionsCreateOrUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerTopicEventSubscriptions_Update.json + * TopicEventSubscriptions_CreateOrUpdate.json */ /** - * Sample code: PartnerTopicEventSubscriptions_Update. + * Sample code: TopicEventSubscriptions_CreateOrUpdate. * * @param manager Entry point to EventGridManager. */ public static void - partnerTopicEventSubscriptionsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerTopicEventSubscriptions() - .update("examplerg", "examplePartnerTopic1", "exampleEventSubscriptionName1", - new EventSubscriptionUpdateParameters() + topicEventSubscriptionsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.topicEventSubscriptions() + .createOrUpdate("examplerg", "exampleTopic1", "exampleEventSubscriptionName1", + new EventSubscriptionInner() .withDestination( new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") - .withSubjectEndsWith("newSuffix") - .withIsSubjectCaseSensitive(true)) - .withLabels(Arrays.asList("label1", "label2")), + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") + .withSubjectEndsWith("ExampleSuffix") + .withIsSubjectCaseSensitive(false)), com.azure.core.util.Context.NONE); } } ``` -### PartnerTopics_Activate - -```java -/** - * Samples for PartnerTopics Activate. - */ -public final class PartnerTopicsActivateSamples { - /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopics_Activate. - * json - */ - /** - * Sample code: PartnerTopics_Activate. - * - * @param manager Entry point to EventGridManager. - */ - public static void partnerTopicsActivate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerTopics() - .activateWithResponse("examplerg", "examplePartnerTopic1", com.azure.core.util.Context.NONE); - } -} -``` - -### PartnerTopics_CreateOrUpdate +### PartnerTopics_GetByResourceGroup ```java -import java.time.OffsetDateTime; -import java.util.UUID; - /** - * Samples for PartnerTopics CreateOrUpdate. + * Samples for Operations List. */ -public final class PartnerTopicsCreateOrUpdateSamples { +public final class OperationsListSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerTopics_CreateOrUpdate.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Operations_List.json */ /** - * Sample code: PartnerTopics_CreateOrUpdate. + * Sample code: Operations_List. * * @param manager Entry point to EventGridManager. */ - public static void partnerTopicsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerTopics() - .define("examplePartnerTopicName1") - .withRegion("westus2") - .withExistingResourceGroup("examplerg") - .withPartnerRegistrationImmutableId(UUID.fromString("6f541064-031d-4cc8-9ec3-a3b4fc0f7185")) - .withSource("ContosoCorp.Accounts.User1") - .withExpirationTimeIfNotActivatedUtc(OffsetDateTime.parse("2022-03-23T23:06:13.109Z")) - .withPartnerTopicFriendlyDescription("Example description") - .withMessageForActivation("Example message for activation") - .create(); + public static void operationsList(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` -### PartnerTopics_Deactivate +### PartnerTopics_List ```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.eventgrid.models.ClientCertificateAuthentication; +import com.azure.resourcemanager.eventgrid.models.ClientCertificateValidationScheme; +import com.azure.resourcemanager.eventgrid.models.ClientState; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for PartnerTopics Deactivate. + * Samples for Clients CreateOrUpdate. */ -public final class PartnerTopicsDeactivateSamples { +public final class ClientsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopics_Deactivate. + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Clients_CreateOrUpdate. * json */ /** - * Sample code: PartnerTopics_Deactivate. + * Sample code: Clients_CreateOrUpdate. * * @param manager Entry point to EventGridManager. */ - public static void partnerTopicsDeactivate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerTopics() - .deactivateWithResponse("examplerg", "examplePartnerTopic1", com.azure.core.util.Context.NONE); + public static void clientsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) + throws IOException { + manager.clients() + .define("exampleClientName1") + .withExistingNamespace("examplerg", "exampleNamespaceName1") + .withDescription("This is a test client") + .withClientCertificateAuthentication(new ClientCertificateAuthentication() + .withValidationScheme(ClientCertificateValidationScheme.SUBJECT_MATCHES_AUTHENTICATION_NAME)) + .withState(ClientState.ENABLED) + .withAttributes(mapOf("deviceTypes", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("[\"Fan\",\"Light\",\"AC\"]", Object.class, SerializerEncoding.JSON), + "floor", 3, "room", "345")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### PartnerTopics_Delete +### PartnerTopics_ListByResourceGroup ```java +import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner; +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; +import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination; + /** - * Samples for PartnerTopics Delete. + * Samples for DomainTopicEventSubscriptions CreateOrUpdate. */ -public final class PartnerTopicsDeleteSamples { +public final class DomainTopicEventSubscriptionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopics_Delete.json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * DomainTopicEventSubscriptions_CreateOrUpdate.json */ /** - * Sample code: PartnerTopics_Delete. + * Sample code: DomainTopicEventSubscriptions_CreateOrUpdate. * * @param manager Entry point to EventGridManager. */ - public static void partnerTopicsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerTopics().delete("examplerg", "examplePartnerTopicName1", com.azure.core.util.Context.NONE); + public static void + domainTopicEventSubscriptionsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domainTopicEventSubscriptions() + .createOrUpdate("examplerg", "exampleDomain1", "exampleDomainTopic1", "exampleEventSubscriptionName1", + new EventSubscriptionInner() + .withDestination( + new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") + .withSubjectEndsWith("ExampleSuffix") + .withIsSubjectCaseSensitive(false)), + com.azure.core.util.Context.NONE); } } ``` -### PartnerTopics_GetByResourceGroup +### PartnerTopics_Update ```java /** - * Samples for PartnerTopics GetByResourceGroup. + * Samples for Namespaces GetByResourceGroup. */ -public final class PartnerTopicsGetByResourceGroupSamples { +public final class NamespacesGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopics_Get.json + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Namespaces_Get.json */ /** - * Sample code: PartnerTopics_Get. + * Sample code: Namespaces_Get. * * @param manager Entry point to EventGridManager. */ - public static void partnerTopicsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerTopics() - .getByResourceGroupWithResponse("examplerg", "examplePartnerTopicName1", com.azure.core.util.Context.NONE); + public static void namespacesGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.namespaces() + .getByResourceGroupWithResponse("examplerg", "exampleNamespaceName1", com.azure.core.util.Context.NONE); } } ``` -### PartnerTopics_List +### PermissionBindings_CreateOrUpdate ```java +import com.azure.resourcemanager.eventgrid.models.TopicRegenerateKeyRequest; + /** - * Samples for PartnerTopics List. + * Samples for Topics RegenerateKey. */ -public final class PartnerTopicsListSamples { +public final class TopicsRegenerateKeySamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerTopics_ListBySubscription.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_RegenerateKey.json */ /** - * Sample code: PartnerTopics_ListBySubscription. + * Sample code: Topics_RegenerateKey. * * @param manager Entry point to EventGridManager. */ - public static void partnerTopicsListBySubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerTopics().list(null, null, com.azure.core.util.Context.NONE); + public static void topicsRegenerateKey(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.topics() + .regenerateKey("examplerg", "exampletopic2", + new TopicRegenerateKeyRequest().withKeyName("fakeTokenPlaceholder"), com.azure.core.util.Context.NONE); } } ``` -### PartnerTopics_ListByResourceGroup +### PermissionBindings_Delete ```java +import com.azure.resourcemanager.eventgrid.models.Partner; +import java.time.OffsetDateTime; +import java.util.UUID; + /** - * Samples for PartnerTopics ListByResourceGroup. + * Samples for PartnerConfigurations UnauthorizePartner. */ -public final class PartnerTopicsListByResourceGroupSamples { +public final class PartnerConfigurationsUnauthorizePartnerSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PartnerTopics_ListByResourceGroup.json + * PartnerConfigurations_UnauthorizePartner.json */ /** - * Sample code: PartnerTopics_ListByResourceGroup. + * Sample code: PartnerConfigurations_UnauthorizePartner. * * @param manager Entry point to EventGridManager. */ - public static void partnerTopicsListByResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.partnerTopics().listByResourceGroup("examplerg", null, null, com.azure.core.util.Context.NONE); + public static void + partnerConfigurationsUnauthorizePartner(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerConfigurations() + .unauthorizePartnerWithResponse("examplerg", + new Partner() + .withPartnerRegistrationImmutableId(UUID.fromString("941892bc-f5d0-4d1c-8fb5-477570fc2b71")) + .withPartnerName("Contoso.Finance") + .withAuthorizationExpirationTimeInUtc(OffsetDateTime.parse("2022-01-28T01:20:55.142Z")), + com.azure.core.util.Context.NONE); } } ``` -### PartnerTopics_Update +### PermissionBindings_Get ```java -import com.azure.resourcemanager.eventgrid.models.PartnerTopic; -import java.util.HashMap; -import java.util.Map; +import com.azure.resourcemanager.eventgrid.models.DomainRegenerateKeyRequest; /** - * Samples for PartnerTopics Update. + * Samples for Domains RegenerateKey. */ -public final class PartnerTopicsUpdateSamples { +public final class DomainsRegenerateKeySamples { /* * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopics_Update.json + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Domains_RegenerateKey. + * json */ /** - * Sample code: PartnerTopics_Update. + * Sample code: Domains_RegenerateKey. * * @param manager Entry point to EventGridManager. */ - public static void partnerTopicsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - PartnerTopic resource = manager.partnerTopics() - .getByResourceGroupWithResponse("examplerg", "examplePartnerTopicName1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + public static void domainsRegenerateKey(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domains() + .regenerateKeyWithResponse("examplerg", "exampledomain2", + new DomainRegenerateKeyRequest().withKeyName("fakeTokenPlaceholder"), com.azure.core.util.Context.NONE); } } ``` -### PermissionBindings_CreateOrUpdate +### PermissionBindings_ListByNamespace ```java -import com.azure.resourcemanager.eventgrid.models.PermissionType; - /** - * Samples for PermissionBindings CreateOrUpdate. + * Samples for Topics List. */ -public final class PermissionBindingsCreateOrUpdateSamples { +public final class TopicsListSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PermissionBindings_CreateOrUpdate.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_ListBySubscription + * .json */ /** - * Sample code: PermissionBindings_CreateOrUpdate. + * Sample code: Topics_ListBySubscription. * * @param manager Entry point to EventGridManager. */ - public static void permissionBindingsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.permissionBindings() - .define("examplePermissionBindingName1") - .withExistingNamespace("examplerg", "exampleNamespaceName1") - .withTopicSpaceName("exampleTopicSpaceName1") - .withPermission(PermissionType.PUBLISHER) - .withClientGroupName("exampleClientGroupName1") - .create(); + public static void topicsListBySubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.topics().list(null, null, com.azure.core.util.Context.NONE); } } ``` -### PermissionBindings_Delete +### PrivateEndpointConnections_Delete ```java +import com.azure.resourcemanager.eventgrid.models.NamespaceTopic; + /** - * Samples for PermissionBindings Delete. + * Samples for NamespaceTopics Update. */ -public final class PermissionBindingsDeleteSamples { +public final class NamespaceTopicsUpdateSamples { /* * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PermissionBindings_Delete - * .json + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/NamespaceTopics_Update. + * json */ /** - * Sample code: PermissionBindings_Delete. + * Sample code: NamespaceTopics_Update. * * @param manager Entry point to EventGridManager. */ - public static void permissionBindingsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.permissionBindings() - .delete("examplerg", "exampleNamespaceName1", "examplePermissionBindingName1", - com.azure.core.util.Context.NONE); + public static void namespaceTopicsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + NamespaceTopic resource = manager.namespaceTopics() + .getWithResponse("examplerg", "exampleNamespaceName1", "exampleNamespaceTopicName1", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withEventRetentionInDays(1).apply(); } } ``` -### PermissionBindings_Get +### PrivateEndpointConnections_Get ```java /** - * Samples for PermissionBindings Get. + * Samples for Channels GetFullUrl. */ -public final class PermissionBindingsGetSamples { +public final class ChannelsGetFullUrlSamples { /* * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PermissionBindings_Get. - * json + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Channels_GetFullUrl.json */ /** - * Sample code: PermissionBindings_Get. + * Sample code: Channels_GetFullUrl. * * @param manager Entry point to EventGridManager. */ - public static void permissionBindingsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.permissionBindings() - .getWithResponse("examplerg", "exampleNamespaceName1", "examplePermissionBindingName1", + public static void channelsGetFullUrl(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.channels() + .getFullUrlWithResponse("examplerg", "examplenamespace", "examplechannel", com.azure.core.util.Context.NONE); } } ``` -### PermissionBindings_ListByNamespace +### PrivateEndpointConnections_ListByResource ```java /** - * Samples for PermissionBindings ListByNamespace. + * Samples for EventSubscriptions Delete. */ -public final class PermissionBindingsListByNamespaceSamples { +public final class EventSubscriptionsDeleteSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PermissionBindings_ListByNamespace.json + * EventSubscriptions_DeleteForCustomTopic.json */ /** - * Sample code: PermissionBindings_ListByNamespace. + * Sample code: EventSubscriptions_DeleteForCustomTopic. * * @param manager Entry point to EventGridManager. */ - public static void permissionBindingsListByNamespace(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.permissionBindings() - .listByNamespace("examplerg", "namespace123", null, null, com.azure.core.util.Context.NONE); + public static void + eventSubscriptionsDeleteForCustomTopic(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .delete( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic1", + "examplesubscription1", com.azure.core.util.Context.NONE); } -} -``` - -### PrivateEndpointConnections_Delete - -```java -import com.azure.resourcemanager.eventgrid.models.PrivateEndpointConnectionsParentType; -/** - * Samples for PrivateEndpointConnections Delete. - */ -public final class PrivateEndpointConnectionsDeleteSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PrivateEndpointConnections_Delete.json + * EventSubscriptions_DeleteForResourceGroup.json */ /** - * Sample code: PrivateEndpointConnections_Delete. + * Sample code: EventSubscriptions_DeleteForResourceGroup. * * @param manager Entry point to EventGridManager. */ - public static void privateEndpointConnectionsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.privateEndpointConnections() - .delete("examplerg", PrivateEndpointConnectionsParentType.TOPICS, "exampletopic1", - "BMTPE5.8A30D251-4C61-489D-A1AA-B37C4A329B8B", com.azure.core.util.Context.NONE); + public static void + eventSubscriptionsDeleteForResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .delete("subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg", + "examplesubscription2", com.azure.core.util.Context.NONE); } -} -``` - -### PrivateEndpointConnections_Get - -```java -import com.azure.resourcemanager.eventgrid.models.PrivateEndpointConnectionsParentType; -/** - * Samples for PrivateEndpointConnections Get. - */ -public final class PrivateEndpointConnectionsGetSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PrivateEndpointConnections_Get.json + * EventSubscriptions_DeleteForSubscription.json */ /** - * Sample code: PrivateEndpointConnections_Get. + * Sample code: EventSubscriptions_DeleteForSubscription. * * @param manager Entry point to EventGridManager. */ - public static void privateEndpointConnectionsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.privateEndpointConnections() - .getWithResponse("examplerg", PrivateEndpointConnectionsParentType.TOPICS, "exampletopic1", - "BMTPE5.8A30D251-4C61-489D-A1AA-B37C4A329B8B", com.azure.core.util.Context.NONE); + public static void + eventSubscriptionsDeleteForSubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .delete("subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4", "examplesubscription3", + com.azure.core.util.Context.NONE); } -} -``` - -### PrivateEndpointConnections_ListByResource - -```java -import com.azure.resourcemanager.eventgrid.models.PrivateEndpointConnectionsParentType; -/** - * Samples for PrivateEndpointConnections ListByResource. - */ -public final class PrivateEndpointConnectionsListByResourceSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PrivateEndpointConnections_ListByResource.json + * EventSubscriptions_DeleteForResource.json */ /** - * Sample code: PrivateEndpointConnections_ListByResource. + * Sample code: EventSubscriptions_DeleteForResource. * * @param manager Entry point to EventGridManager. */ public static void - privateEndpointConnectionsListByResource(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.privateEndpointConnections() - .listByResource("examplerg", PrivateEndpointConnectionsParentType.TOPICS, "exampletopic1", null, null, - com.azure.core.util.Context.NONE); + eventSubscriptionsDeleteForResource(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .delete( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1", + "examplesubscription10", com.azure.core.util.Context.NONE); } } ``` @@ -4597,32 +4616,23 @@ public final class PrivateEndpointConnectionsListByResourceSamples { ### PrivateEndpointConnections_Update ```java -import com.azure.resourcemanager.eventgrid.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.eventgrid.models.ConnectionState; -import com.azure.resourcemanager.eventgrid.models.PersistedConnectionStatus; -import com.azure.resourcemanager.eventgrid.models.PrivateEndpointConnectionsParentType; - /** - * Samples for PrivateEndpointConnections Update. + * Samples for DomainTopicEventSubscriptions GetFullUrl. */ -public final class PrivateEndpointConnectionsUpdateSamples { +public final class DomainTopicEventSubscriptionsGetFullUrlSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PrivateEndpointConnections_Update.json + * DomainTopicEventSubscriptions_GetFullUrl.json */ /** - * Sample code: PrivateEndpointConnections_Update. + * Sample code: DomainTopicEventSubscriptions_GetFullUrl. * * @param manager Entry point to EventGridManager. */ - public static void privateEndpointConnectionsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.privateEndpointConnections() - .update("examplerg", PrivateEndpointConnectionsParentType.TOPICS, "exampletopic1", - "BMTPE5.8A30D251-4C61-489D-A1AA-B37C4A329B8B", - new PrivateEndpointConnectionInner().withPrivateLinkServiceConnectionState( - new ConnectionState().withStatus(PersistedConnectionStatus.APPROVED) - .withDescription("approving connection") - .withActionsRequired("None")), + public static void + domainTopicEventSubscriptionsGetFullUrl(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domainTopicEventSubscriptions() + .getFullUrlWithResponse("examplerg", "exampleDomain1", "exampleDomainTopic1", "examplesubscription1", com.azure.core.util.Context.NONE); } } @@ -4632,22 +4642,21 @@ public final class PrivateEndpointConnectionsUpdateSamples { ```java /** - * Samples for PrivateLinkResources Get. + * Samples for DomainTopicEventSubscriptions List. */ -public final class PrivateLinkResourcesGetSamples { +public final class DomainTopicEventSubscriptionsListSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PrivateLinkResources_Get. - * json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * DomainTopicEventSubscriptions_List.json */ /** - * Sample code: PrivateLinkResources_Get. + * Sample code: DomainTopicEventSubscriptions_List. * * @param manager Entry point to EventGridManager. */ - public static void privateLinkResourcesGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.privateLinkResources() - .getWithResponse("examplerg", "topics", "exampletopic1", "topic", com.azure.core.util.Context.NONE); + public static void domainTopicEventSubscriptionsList(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domainTopicEventSubscriptions() + .list("examplerg", "exampleDomain1", "exampleDomainTopic1", null, null, com.azure.core.util.Context.NONE); } } ``` @@ -4656,22 +4665,23 @@ public final class PrivateLinkResourcesGetSamples { ```java /** - * Samples for PrivateLinkResources ListByResource. + * Samples for PartnerRegistrations GetByResourceGroup. */ -public final class PrivateLinkResourcesListByResourceSamples { +public final class PartnerRegistrationsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * PrivateLinkResources_ListByResource.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerRegistrations_Get. + * json */ /** - * Sample code: PrivateLinkResources_ListByResource. + * Sample code: PartnerRegistrations_Get. * * @param manager Entry point to EventGridManager. */ - public static void - privateLinkResourcesListByResource(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.privateLinkResources() - .listByResource("examplerg", "topics", "exampletopic1", null, null, com.azure.core.util.Context.NONE); + public static void partnerRegistrationsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerRegistrations() + .getByResourceGroupWithResponse("examplerg", "examplePartnerRegistrationName1", + com.azure.core.util.Context.NONE); } } ``` @@ -4679,34 +4689,33 @@ public final class PrivateLinkResourcesListByResourceSamples { ### SystemTopicEventSubscriptions_CreateOrUpdate ```java -import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; -import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination; +import java.time.OffsetDateTime; +import java.util.UUID; /** - * Samples for SystemTopicEventSubscriptions CreateOrUpdate. + * Samples for PartnerTopics CreateOrUpdate. */ -public final class SystemTopicEventSubscriptionsCreateOrUpdateSamples { +public final class PartnerTopicsCreateOrUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * SystemTopicEventSubscriptions_CreateOrUpdate.json + * PartnerTopics_CreateOrUpdate.json */ /** - * Sample code: SystemTopicEventSubscriptions_CreateOrUpdate. + * Sample code: PartnerTopics_CreateOrUpdate. * * @param manager Entry point to EventGridManager. */ - public static void - systemTopicEventSubscriptionsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.systemTopicEventSubscriptions() - .createOrUpdate("examplerg", "exampleSystemTopic1", "exampleEventSubscriptionName1", - new EventSubscriptionInner() - .withDestination( - new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") - .withSubjectEndsWith("ExampleSuffix") - .withIsSubjectCaseSensitive(false)), - com.azure.core.util.Context.NONE); + public static void partnerTopicsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerTopics() + .define("examplePartnerTopicName1") + .withRegion("westus2") + .withExistingResourceGroup("examplerg") + .withPartnerRegistrationImmutableId(UUID.fromString("6f541064-031d-4cc8-9ec3-a3b4fc0f7185")) + .withSource("ContosoCorp.Accounts.User1") + .withExpirationTimeIfNotActivatedUtc(OffsetDateTime.parse("2022-03-23T23:06:13.109Z")) + .withPartnerTopicFriendlyDescription("Example description") + .withMessageForActivation("Example message for activation") + .create(); } } ``` @@ -4715,22 +4724,20 @@ public final class SystemTopicEventSubscriptionsCreateOrUpdateSamples { ```java /** - * Samples for SystemTopicEventSubscriptions Delete. + * Samples for Topics GetByResourceGroup. */ -public final class SystemTopicEventSubscriptionsDeleteSamples { +public final class TopicsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * SystemTopicEventSubscriptions_Delete.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_Get.json */ /** - * Sample code: SystemTopicEventSubscriptions_Delete. + * Sample code: Topics_Get. * * @param manager Entry point to EventGridManager. */ - public static void - systemTopicEventSubscriptionsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.systemTopicEventSubscriptions() - .delete("examplerg", "exampleSystemTopic1", "examplesubscription1", com.azure.core.util.Context.NONE); + public static void topicsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.topics().getByResourceGroupWithResponse("examplerg", "exampletopic2", com.azure.core.util.Context.NONE); } } ``` @@ -4739,21 +4746,22 @@ public final class SystemTopicEventSubscriptionsDeleteSamples { ```java /** - * Samples for SystemTopicEventSubscriptions Get. + * Samples for PartnerNamespaces GetByResourceGroup. */ -public final class SystemTopicEventSubscriptionsGetSamples { +public final class PartnerNamespacesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * SystemTopicEventSubscriptions_Get.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerNamespaces_Get. + * json */ /** - * Sample code: SystemTopicEventSubscriptions_Get. + * Sample code: PartnerNamespaces_Get. * * @param manager Entry point to EventGridManager. */ - public static void systemTopicEventSubscriptionsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.systemTopicEventSubscriptions() - .getWithResponse("examplerg", "exampleSystemTopic1", "examplesubscription1", + public static void partnerNamespacesGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerNamespaces() + .getByResourceGroupWithResponse("examplerg", "examplePartnerNamespaceName1", com.azure.core.util.Context.NONE); } } @@ -4763,23 +4771,25 @@ public final class SystemTopicEventSubscriptionsGetSamples { ```java /** - * Samples for SystemTopicEventSubscriptions GetDeliveryAttributes. + * Samples for ClientGroups CreateOrUpdate. */ -public final class SystemTopicEventSubscriptionsGetDeliveryAttributesSamples { +public final class ClientGroupsCreateOrUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * SystemTopicEventSubscriptions_GetDeliveryAttributes.json + * ClientGroups_CreateOrUpdate.json */ /** - * Sample code: SystemTopicEventSubscriptions_GetDeliveryAttributes. + * Sample code: ClientGroups_CreateOrUpdate. * * @param manager Entry point to EventGridManager. */ - public static void systemTopicEventSubscriptionsGetDeliveryAttributes( - com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.systemTopicEventSubscriptions() - .getDeliveryAttributesWithResponse("examplerg", "exampleSystemTopic1", "examplesubscription1", - com.azure.core.util.Context.NONE); + public static void clientGroupsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.clientGroups() + .define("exampleClientGroupName1") + .withExistingNamespace("examplerg", "exampleNamespaceName1") + .withDescription("This is a test client group") + .withQuery("attributes.b IN ['a', 'b', 'c']") + .create(); } } ``` @@ -4788,22 +4798,22 @@ public final class SystemTopicEventSubscriptionsGetDeliveryAttributesSamples { ```java /** - * Samples for SystemTopicEventSubscriptions GetFullUrl. + * Samples for NamespaceTopicEventSubscriptions GetFullUrl. */ -public final class SystemTopicEventSubscriptionsGetFullUrlSamples { +public final class NamespaceTopicEventSubscriptionsGetFullUrlSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * SystemTopicEventSubscriptions_GetFullUrl.json + * NamespaceTopicEventSubscriptions_GetFullUrl.json */ /** - * Sample code: SystemTopicEventSubscriptions_GetFullUrl. + * Sample code: NamespaceTopicEventSubscriptions_GetFullUrl. * * @param manager Entry point to EventGridManager. */ public static void - systemTopicEventSubscriptionsGetFullUrl(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.systemTopicEventSubscriptions() - .getFullUrlWithResponse("examplerg", "exampleSystemTopic1", "examplesubscription1", + namespaceTopicEventSubscriptionsGetFullUrl(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.namespaceTopicEventSubscriptions() + .getFullUrlWithResponse("examplerg", "exampleNamespaceName1", "exampleDomainTopic1", "examplesubscription1", com.azure.core.util.Context.NONE); } } @@ -4813,22 +4823,23 @@ public final class SystemTopicEventSubscriptionsGetFullUrlSamples { ```java /** - * Samples for SystemTopicEventSubscriptions ListBySystemTopic. + * Samples for PermissionBindings Get. */ -public final class SystemTopicEventSubscriptionsListBySystemTopicSamples { +public final class PermissionBindingsGetSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * SystemTopicEventSubscriptions_ListBySystemTopic.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PermissionBindings_Get. + * json */ /** - * Sample code: SystemTopicEventSubscriptions_ListBySystemTopic. + * Sample code: PermissionBindings_Get. * * @param manager Entry point to EventGridManager. */ - public static void - systemTopicEventSubscriptionsListBySystemTopic(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.systemTopicEventSubscriptions() - .listBySystemTopic("examplerg", "exampleSystemTopic1", null, null, com.azure.core.util.Context.NONE); + public static void permissionBindingsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.permissionBindings() + .getWithResponse("examplerg", "exampleNamespaceName1", "examplePermissionBindingName1", + com.azure.core.util.Context.NONE); } } ``` @@ -4836,36 +4847,22 @@ public final class SystemTopicEventSubscriptionsListBySystemTopicSamples { ### SystemTopicEventSubscriptions_Update ```java -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters; -import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination; -import java.util.Arrays; - /** - * Samples for SystemTopicEventSubscriptions Update. + * Samples for TopicSpaces ListByNamespace. */ -public final class SystemTopicEventSubscriptionsUpdateSamples { +public final class TopicSpacesListByNamespaceSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * SystemTopicEventSubscriptions_Update.json + * TopicSpaces_ListByNamespace.json */ /** - * Sample code: SystemTopicEventSubscriptions_Update. + * Sample code: TopicSpaces_ListByNamespace. * * @param manager Entry point to EventGridManager. */ - public static void - systemTopicEventSubscriptionsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.systemTopicEventSubscriptions() - .update("examplerg", "exampleSystemTopic1", "exampleEventSubscriptionName1", - new EventSubscriptionUpdateParameters() - .withDestination( - new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") - .withSubjectEndsWith("newSuffix") - .withIsSubjectCaseSensitive(true)) - .withLabels(Arrays.asList("label1", "label2")), - com.azure.core.util.Context.NONE); + public static void topicSpacesListByNamespace(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.topicSpaces() + .listByNamespace("examplerg", "namespace123", null, null, com.azure.core.util.Context.NONE); } } ``` @@ -4873,44 +4870,24 @@ public final class SystemTopicEventSubscriptionsUpdateSamples { ### SystemTopics_CreateOrUpdate ```java -import java.util.HashMap; -import java.util.Map; - /** - * Samples for SystemTopics CreateOrUpdate. + * Samples for DomainEventSubscriptions GetDeliveryAttributes. */ -public final class SystemTopicsCreateOrUpdateSamples { +public final class DomainEventSubscriptionsGetDeliveryAttributesSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * SystemTopics_CreateOrUpdate.json + * DomainEventSubscriptions_GetDeliveryAttributes.json */ /** - * Sample code: SystemTopics_CreateOrUpdate. + * Sample code: DomainEventSubscriptions_GetDeliveryAttributes. * * @param manager Entry point to EventGridManager. */ - public static void systemTopicsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.systemTopics() - .define("exampleSystemTopic1") - .withRegion("westus2") - .withExistingResourceGroup("examplerg") - .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withSource( - "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/azureeventgridrunnerrgcentraluseuap/providers/microsoft.storage/storageaccounts/pubstgrunnerb71cd29e") - .withTopicType("microsoft.storage.storageaccounts") - .create(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + public static void + domainEventSubscriptionsGetDeliveryAttributes(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domainEventSubscriptions() + .getDeliveryAttributesWithResponse("examplerg", "exampleDomain1", "examplesubscription1", + com.azure.core.util.Context.NONE); } } ``` @@ -4940,22 +4917,50 @@ public final class SystemTopicsDeleteSamples { ### SystemTopics_GetByResourceGroup ```java +import com.azure.resourcemanager.eventgrid.models.InboundIpRule; +import com.azure.resourcemanager.eventgrid.models.IpActionType; +import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; +import com.azure.resourcemanager.eventgrid.models.Topic; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for SystemTopics GetByResourceGroup. + * Samples for Topics Update. */ -public final class SystemTopicsGetByResourceGroupSamples { +public final class TopicsUpdateSamples { /* * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/SystemTopics_Get.json + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_Update.json */ /** - * Sample code: SystemTopics_Get. + * Sample code: Topics_Update. * * @param manager Entry point to EventGridManager. */ - public static void systemTopicsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.systemTopics() - .getByResourceGroupWithResponse("examplerg", "exampleSystemTopic2", com.azure.core.util.Context.NONE); + public static void topicsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + Topic resource = manager.topics() + .getByResourceGroupWithResponse("examplerg", "exampletopic1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) + .withInboundIpRules( + Arrays.asList(new InboundIpRule().withIpMask("12.18.30.15").withAction(IpActionType.ALLOW), + new InboundIpRule().withIpMask("12.18.176.1").withAction(IpActionType.ALLOW))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` @@ -4963,21 +4968,29 @@ public final class SystemTopicsGetByResourceGroupSamples { ### SystemTopics_List ```java +import com.azure.resourcemanager.eventgrid.models.PermissionType; + /** - * Samples for SystemTopics List. + * Samples for PermissionBindings CreateOrUpdate. */ -public final class SystemTopicsListSamples { +public final class PermissionBindingsCreateOrUpdateSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * SystemTopics_ListBySubscription.json + * PermissionBindings_CreateOrUpdate.json */ /** - * Sample code: SystemTopics_ListBySubscription. + * Sample code: PermissionBindings_CreateOrUpdate. * * @param manager Entry point to EventGridManager. */ - public static void systemTopicsListBySubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.systemTopics().list(null, null, com.azure.core.util.Context.NONE); + public static void permissionBindingsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.permissionBindings() + .define("examplePermissionBindingName1") + .withExistingNamespace("examplerg", "exampleNamespaceName1") + .withTopicSpaceName("exampleTopicSpaceName1") + .withPermission(PermissionType.PUBLISHER) + .withClientGroupName("exampleClientGroupName1") + .create(); } } ``` @@ -4986,20 +4999,21 @@ public final class SystemTopicsListSamples { ```java /** - * Samples for SystemTopics ListByResourceGroup. + * Samples for DomainEventSubscriptions List. */ -public final class SystemTopicsListByResourceGroupSamples { +public final class DomainEventSubscriptionsListSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * SystemTopics_ListByResourceGroup.json + * DomainEventSubscriptions_List.json */ /** - * Sample code: SystemTopics_ListByResourceGroup. + * Sample code: DomainEventSubscriptions_List. * * @param manager Entry point to EventGridManager. */ - public static void systemTopicsListByResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.systemTopics().listByResourceGroup("examplerg", null, null, com.azure.core.util.Context.NONE); + public static void domainEventSubscriptionsList(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domainEventSubscriptions() + .list("examplerg", "exampleDomain1", null, null, com.azure.core.util.Context.NONE); } } ``` @@ -5007,40 +5021,22 @@ public final class SystemTopicsListByResourceGroupSamples { ### SystemTopics_Update ```java -import com.azure.resourcemanager.eventgrid.models.SystemTopic; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for SystemTopics Update. + * Samples for Domains GetByResourceGroup. */ -public final class SystemTopicsUpdateSamples { +public final class DomainsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/SystemTopics_Update.json + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Domains_Get.json */ /** - * Sample code: SystemTopics_Update. + * Sample code: Domains_Get. * * @param manager Entry point to EventGridManager. */ - public static void systemTopicsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - SystemTopic resource = manager.systemTopics() - .getByResourceGroupWithResponse("examplerg", "exampleSystemTopic1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + public static void domainsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domains() + .getByResourceGroupWithResponse("examplerg", "exampledomain2", com.azure.core.util.Context.NONE); } } ``` @@ -5048,33 +5044,22 @@ public final class SystemTopicsUpdateSamples { ### TopicEventSubscriptions_CreateOrUpdate ```java -import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; -import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination; - /** - * Samples for TopicEventSubscriptions CreateOrUpdate. + * Samples for Clients Get. */ -public final class TopicEventSubscriptionsCreateOrUpdateSamples { +public final class ClientsGetSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * TopicEventSubscriptions_CreateOrUpdate.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Clients_Get.json */ /** - * Sample code: TopicEventSubscriptions_CreateOrUpdate. + * Sample code: Clients_Get. * * @param manager Entry point to EventGridManager. */ - public static void - topicEventSubscriptionsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.topicEventSubscriptions() - .createOrUpdate("examplerg", "exampleTopic1", "exampleEventSubscriptionName1", - new EventSubscriptionInner() - .withDestination( - new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("ExamplePrefix") - .withSubjectEndsWith("ExampleSuffix") - .withIsSubjectCaseSensitive(false)), + public static void clientsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.clients() + .getWithResponse("examplerg", "exampleNamespaceName1", "exampleClientName1", com.azure.core.util.Context.NONE); } } @@ -5084,21 +5069,21 @@ public final class TopicEventSubscriptionsCreateOrUpdateSamples { ```java /** - * Samples for TopicEventSubscriptions Delete. + * Samples for EventSubscriptions ListByResourceGroup. */ -public final class TopicEventSubscriptionsDeleteSamples { +public final class EventSubscriptionsListByResourceGroupSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * TopicEventSubscriptions_Delete.json + * EventSubscriptions_ListGlobalByResourceGroup.json */ /** - * Sample code: TopicEventSubscriptions_Delete. + * Sample code: EventSubscriptions_ListGlobalByResourceGroup. * * @param manager Entry point to EventGridManager. */ - public static void topicEventSubscriptionsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.topicEventSubscriptions() - .delete("examplerg", "exampleTopic", "examplesubscription", com.azure.core.util.Context.NONE); + public static void + eventSubscriptionsListGlobalByResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions().listByResourceGroup("examplerg", null, null, com.azure.core.util.Context.NONE); } } ``` @@ -5107,21 +5092,23 @@ public final class TopicEventSubscriptionsDeleteSamples { ```java /** - * Samples for TopicEventSubscriptions Get. + * Samples for SystemTopicEventSubscriptions GetFullUrl. */ -public final class TopicEventSubscriptionsGetSamples { +public final class SystemTopicEventSubscriptionsGetFullUrlSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * TopicEventSubscriptions_Get.json + * SystemTopicEventSubscriptions_GetFullUrl.json */ /** - * Sample code: TopicEventSubscriptions_Get. + * Sample code: SystemTopicEventSubscriptions_GetFullUrl. * - * @param manager Entry point to EventGridManager. - */ - public static void topicEventSubscriptionsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.topicEventSubscriptions() - .getWithResponse("examplerg", "exampleTopic1", "examplesubscription1", com.azure.core.util.Context.NONE); + * @param manager Entry point to EventGridManager. + */ + public static void + systemTopicEventSubscriptionsGetFullUrl(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.systemTopicEventSubscriptions() + .getFullUrlWithResponse("examplerg", "exampleSystemTopic1", "examplesubscription1", + com.azure.core.util.Context.NONE); } } ``` @@ -5130,22 +5117,22 @@ public final class TopicEventSubscriptionsGetSamples { ```java /** - * Samples for TopicEventSubscriptions GetDeliveryAttributes. + * Samples for SystemTopicEventSubscriptions GetDeliveryAttributes. */ -public final class TopicEventSubscriptionsGetDeliveryAttributesSamples { +public final class SystemTopicEventSubscriptionsGetDeliveryAttributesSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * TopicEventSubscriptions_GetDeliveryAttributes.json + * SystemTopicEventSubscriptions_GetDeliveryAttributes.json */ /** - * Sample code: TopicEventSubscriptions_GetDeliveryAttributes. + * Sample code: SystemTopicEventSubscriptions_GetDeliveryAttributes. * * @param manager Entry point to EventGridManager. */ - public static void - topicEventSubscriptionsGetDeliveryAttributes(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.topicEventSubscriptions() - .getDeliveryAttributesWithResponse("examplerg", "exampleTopic1", "examplesubscription1", + public static void systemTopicEventSubscriptionsGetDeliveryAttributes( + com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.systemTopicEventSubscriptions() + .getDeliveryAttributesWithResponse("examplerg", "exampleSystemTopic1", "examplesubscription1", com.azure.core.util.Context.NONE); } } @@ -5155,22 +5142,20 @@ public final class TopicEventSubscriptionsGetDeliveryAttributesSamples { ```java /** - * Samples for TopicEventSubscriptions GetFullUrl. + * Samples for TopicTypes List. */ -public final class TopicEventSubscriptionsGetFullUrlSamples { +public final class TopicTypesListSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * TopicEventSubscriptions_GetFullUrl.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicTypes_List.json */ /** - * Sample code: TopicEventSubscriptions_GetFullUrl. + * Sample code: TopicTypes_List. * * @param manager Entry point to EventGridManager. */ - public static void topicEventSubscriptionsGetFullUrl(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.topicEventSubscriptions() - .getFullUrlWithResponse("examplerg", "exampleTopic1", "examplesubscription1", - com.azure.core.util.Context.NONE); + public static void topicTypesList(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.topicTypes().list(com.azure.core.util.Context.NONE); } } ``` @@ -5179,21 +5164,22 @@ public final class TopicEventSubscriptionsGetFullUrlSamples { ```java /** - * Samples for TopicEventSubscriptions List. + * Samples for SystemTopicEventSubscriptions Get. */ -public final class TopicEventSubscriptionsListSamples { +public final class SystemTopicEventSubscriptionsGetSamples { /* * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * TopicEventSubscriptions_List.json + * SystemTopicEventSubscriptions_Get.json */ /** - * Sample code: TopicEventSubscriptions_List. + * Sample code: SystemTopicEventSubscriptions_Get. * * @param manager Entry point to EventGridManager. */ - public static void topicEventSubscriptionsList(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.topicEventSubscriptions() - .list("examplerg", "exampleTopic1", null, null, com.azure.core.util.Context.NONE); + public static void systemTopicEventSubscriptionsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.systemTopicEventSubscriptions() + .getWithResponse("examplerg", "exampleSystemTopic1", "examplesubscription1", + com.azure.core.util.Context.NONE); } } ``` @@ -5201,35 +5187,21 @@ public final class TopicEventSubscriptionsListSamples { ### TopicEventSubscriptions_Update ```java -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters; -import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination; -import java.util.Arrays; - /** - * Samples for TopicEventSubscriptions Update. + * Samples for PartnerTopics Delete. */ -public final class TopicEventSubscriptionsUpdateSamples { +public final class PartnerTopicsDeleteSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * TopicEventSubscriptions_Update.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopics_Delete.json */ /** - * Sample code: TopicEventSubscriptions_Update. + * Sample code: PartnerTopics_Delete. * * @param manager Entry point to EventGridManager. */ - public static void topicEventSubscriptionsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.topicEventSubscriptions() - .update("examplerg", "exampleTopic1", "exampleEventSubscriptionName1", - new EventSubscriptionUpdateParameters() - .withDestination( - new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") - .withSubjectEndsWith("newSuffix") - .withIsSubjectCaseSensitive(true)) - .withLabels(Arrays.asList("label1", "label2")), - com.azure.core.util.Context.NONE); + public static void partnerTopicsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerTopics().delete("examplerg", "examplePartnerTopicName1", com.azure.core.util.Context.NONE); } } ``` @@ -5237,27 +5209,21 @@ public final class TopicEventSubscriptionsUpdateSamples { ### TopicSpaces_CreateOrUpdate ```java -import java.util.Arrays; - /** - * Samples for TopicSpaces CreateOrUpdate. + * Samples for TopicTypes Get. */ -public final class TopicSpacesCreateOrUpdateSamples { +public final class TopicTypesGetSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * TopicSpaces_CreateOrUpdate.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicTypes_Get.json */ /** - * Sample code: TopicSpaces_CreateOrUpdate. + * Sample code: TopicTypes_Get. * * @param manager Entry point to EventGridManager. */ - public static void topicSpacesCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.topicSpaces() - .define("exampleTopicSpaceName1") - .withExistingNamespace("examplerg", "exampleNamespaceName1") - .withTopicTemplates(Arrays.asList("filter1", "filter2")) - .create(); + public static void topicTypesGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.topicTypes().getWithResponse("Microsoft.Storage.StorageAccounts", com.azure.core.util.Context.NONE); } } ``` @@ -5266,21 +5232,21 @@ public final class TopicSpacesCreateOrUpdateSamples { ```java /** - * Samples for TopicSpaces Delete. + * Samples for Topics ListSharedAccessKeys. */ -public final class TopicSpacesDeleteSamples { +public final class TopicsListSharedAccessKeysSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicSpaces_Delete.json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * Topics_ListSharedAccessKeys.json */ /** - * Sample code: TopicSpaces_Delete. + * Sample code: Topics_ListSharedAccessKeys. * * @param manager Entry point to EventGridManager. */ - public static void topicSpacesDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.topicSpaces() - .delete("examplerg", "exampleNamespaceName1", "exampleTopicSpaceName1", com.azure.core.util.Context.NONE); + public static void topicsListSharedAccessKeys(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.topics() + .listSharedAccessKeysWithResponse("examplerg", "exampletopic2", com.azure.core.util.Context.NONE); } } ``` @@ -5289,22 +5255,21 @@ public final class TopicSpacesDeleteSamples { ```java /** - * Samples for TopicSpaces Get. + * Samples for PartnerConfigurations ListByResourceGroup. */ -public final class TopicSpacesGetSamples { +public final class PartnerConfigurationsListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicSpaces_Get.json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * PartnerConfigurations_ListByResourceGroup.json */ /** - * Sample code: TopicSpaces_Get. + * Sample code: PartnerConfigurations_ListByResourceGroup. * * @param manager Entry point to EventGridManager. */ - public static void topicSpacesGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.topicSpaces() - .getWithResponse("examplerg", "exampleNamespaceName1", "exampleTopicSpaceName1", - com.azure.core.util.Context.NONE); + public static void + partnerConfigurationsListByResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerConfigurations().listByResourceGroup("examplerg", com.azure.core.util.Context.NONE); } } ``` @@ -5313,21 +5278,22 @@ public final class TopicSpacesGetSamples { ```java /** - * Samples for TopicSpaces ListByNamespace. + * Samples for Channels Get. */ -public final class TopicSpacesListByNamespaceSamples { +public final class ChannelsGetSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * TopicSpaces_ListByNamespace.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Channels_Get.json */ /** - * Sample code: TopicSpaces_ListByNamespace. + * Sample code: Channels_Get. * * @param manager Entry point to EventGridManager. */ - public static void topicSpacesListByNamespace(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.topicSpaces() - .listByNamespace("examplerg", "namespace123", null, null, com.azure.core.util.Context.NONE); + public static void channelsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.channels() + .getWithResponse("examplerg", "examplePartnerNamespaceName1", "exampleChannelName1", + com.azure.core.util.Context.NONE); } } ``` @@ -5336,20 +5302,22 @@ public final class TopicSpacesListByNamespaceSamples { ```java /** - * Samples for TopicTypes Get. + * Samples for Namespaces ValidateCustomDomainOwnership. */ -public final class TopicTypesGetSamples { +public final class NamespacesValidateCustomDomainOwnershipSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicTypes_Get.json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * Namespaces_ValidateCustomDomainOwnership.json */ /** - * Sample code: TopicTypes_Get. + * Sample code: Namespaces_ValidateCustomDomainOwnership. * * @param manager Entry point to EventGridManager. */ - public static void topicTypesGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.topicTypes().getWithResponse("Microsoft.Storage.StorageAccounts", com.azure.core.util.Context.NONE); + public static void + namespacesValidateCustomDomainOwnership(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.namespaces() + .validateCustomDomainOwnership("examplerg", "exampleNamespaceName1", com.azure.core.util.Context.NONE); } } ``` @@ -5357,21 +5325,25 @@ public final class TopicTypesGetSamples { ### TopicTypes_List ```java +import com.azure.resourcemanager.eventgrid.models.PrivateEndpointConnectionsParentType; + /** - * Samples for TopicTypes List. + * Samples for PrivateEndpointConnections Get. */ -public final class TopicTypesListSamples { +public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicTypes_List.json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * PrivateEndpointConnections_Get.json */ /** - * Sample code: TopicTypes_List. + * Sample code: PrivateEndpointConnections_Get. * * @param manager Entry point to EventGridManager. */ - public static void topicTypesList(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.topicTypes().list(com.azure.core.util.Context.NONE); + public static void privateEndpointConnectionsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.privateEndpointConnections() + .getWithResponse("examplerg", PrivateEndpointConnectionsParentType.TOPICS, "exampletopic1", + "BMTPE5.8A30D251-4C61-489D-A1AA-B37C4A329B8B", com.azure.core.util.Context.NONE); } } ``` @@ -5379,22 +5351,40 @@ public final class TopicTypesListSamples { ### TopicTypes_ListEventTypes ```java +import com.azure.resourcemanager.eventgrid.models.SystemTopic; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for TopicTypes ListEventTypes. + * Samples for SystemTopics Update. */ -public final class TopicTypesListEventTypesSamples { +public final class SystemTopicsUpdateSamples { /* * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/TopicTypes_ListEventTypes - * .json + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/SystemTopics_Update.json */ /** - * Sample code: TopicTypes_ListEventTypes. + * Sample code: SystemTopics_Update. * * @param manager Entry point to EventGridManager. */ - public static void topicTypesListEventTypes(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.topicTypes().listEventTypes("Microsoft.Storage.StorageAccounts", com.azure.core.util.Context.NONE); + public static void systemTopicsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + SystemTopic resource = manager.systemTopics() + .getByResourceGroupWithResponse("examplerg", "exampleSystemTopic1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` @@ -5402,50 +5392,74 @@ public final class TopicTypesListEventTypesSamples { ### Topics_CreateOrUpdate ```java -import com.azure.resourcemanager.eventgrid.models.InboundIpRule; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; +/** + * Samples for EventSubscriptions GetFullUrl. + */ +public final class EventSubscriptionsGetFullUrlSamples { + /* + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * EventSubscriptions_GetFullUrlForResource.json + */ + /** + * Sample code: EventSubscriptions_GetFullUrlForResource. + * + * @param manager Entry point to EventGridManager. + */ + public static void + eventSubscriptionsGetFullUrlForResource(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .getFullUrlWithResponse( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventHub/namespaces/examplenamespace1", + "examplesubscription1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * EventSubscriptions_GetFullUrlForResourceGroup.json + */ + /** + * Sample code: EventSubscriptions_GetFullUrlForResourceGroup. + * + * @param manager Entry point to EventGridManager. + */ + public static void + eventSubscriptionsGetFullUrlForResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .getFullUrlWithResponse("subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg", + "examplesubscription2", com.azure.core.util.Context.NONE); + } -/** - * Samples for Topics CreateOrUpdate. - */ -public final class TopicsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_CreateOrUpdate. - * json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * EventSubscriptions_GetFullUrlForSubscription.json */ /** - * Sample code: Topics_CreateOrUpdate. + * Sample code: EventSubscriptions_GetFullUrlForSubscription. * * @param manager Entry point to EventGridManager. */ - public static void topicsCreateOrUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.topics() - .define("exampletopic1") - .withRegion("westus2") - .withExistingResourceGroup("examplerg") - .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withInboundIpRules( - Arrays.asList(new InboundIpRule().withIpMask("12.18.30.15").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("12.18.176.1").withAction(IpActionType.ALLOW))) - .create(); + public static void + eventSubscriptionsGetFullUrlForSubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .getFullUrlWithResponse("subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4", "examplesubscription3", + com.azure.core.util.Context.NONE); } - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + /* + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * EventSubscriptions_GetFullUrlForCustomTopic.json + */ + /** + * Sample code: EventSubscriptions_GetFullUrlForCustomTopic. + * + * @param manager Entry point to EventGridManager. + */ + public static void + eventSubscriptionsGetFullUrlForCustomTopic(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .getFullUrlWithResponse( + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", + "examplesubscription1", com.azure.core.util.Context.NONE); } } ``` @@ -5454,20 +5468,21 @@ public final class TopicsCreateOrUpdateSamples { ```java /** - * Samples for Topics Delete. + * Samples for PartnerRegistrations List. */ -public final class TopicsDeleteSamples { +public final class PartnerRegistrationsListSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_Delete.json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * PartnerRegistrations_ListBySubscription.json */ /** - * Sample code: Topics_Delete. + * Sample code: PartnerRegistrations_ListBySubscription. * * @param manager Entry point to EventGridManager. */ - public static void topicsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.topics().delete("examplerg", "exampletopic", com.azure.core.util.Context.NONE); + public static void + partnerRegistrationsListBySubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerRegistrations().list(null, null, com.azure.core.util.Context.NONE); } } ``` @@ -5475,21 +5490,35 @@ public final class TopicsDeleteSamples { ### Topics_GetByResourceGroup ```java +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFilter; +import com.azure.resourcemanager.eventgrid.models.EventSubscriptionUpdateParameters; +import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination; +import java.util.Arrays; + /** - * Samples for Topics GetByResourceGroup. + * Samples for TopicEventSubscriptions Update. */ -public final class TopicsGetByResourceGroupSamples { +public final class TopicEventSubscriptionsUpdateSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_Get.json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * TopicEventSubscriptions_Update.json */ /** - * Sample code: Topics_Get. + * Sample code: TopicEventSubscriptions_Update. * * @param manager Entry point to EventGridManager. */ - public static void topicsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.topics().getByResourceGroupWithResponse("examplerg", "exampletopic2", com.azure.core.util.Context.NONE); + public static void topicEventSubscriptionsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.topicEventSubscriptions() + .update("examplerg", "exampleTopic1", "exampleEventSubscriptionName1", + new EventSubscriptionUpdateParameters() + .withDestination( + new WebhookEventSubscriptionDestination().withEndpointUrl("https://requestb.in/15ksip71")) + .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("existingPrefix") + .withSubjectEndsWith("newSuffix") + .withIsSubjectCaseSensitive(true)) + .withLabels(Arrays.asList("label1", "label2")), + com.azure.core.util.Context.NONE); } } ``` @@ -5498,21 +5527,21 @@ public final class TopicsGetByResourceGroupSamples { ```java /** - * Samples for Topics List. + * Samples for NamespaceTopics ListByNamespace. */ -public final class TopicsListSamples { +public final class NamespaceTopicsListByNamespaceSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_ListBySubscription - * .json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * NamespaceTopics_ListByNamespace.json */ /** - * Sample code: Topics_ListBySubscription. + * Sample code: NamespaceTopics_ListByNamespace. * * @param manager Entry point to EventGridManager. */ - public static void topicsListBySubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.topics().list(null, null, com.azure.core.util.Context.NONE); + public static void namespaceTopicsListByNamespace(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.namespaceTopics() + .listByNamespace("examplerg", "examplenamespace2", null, null, com.azure.core.util.Context.NONE); } } ``` @@ -5521,20 +5550,21 @@ public final class TopicsListSamples { ```java /** - * Samples for Topics ListByResourceGroup. + * Samples for Clients Delete. */ -public final class TopicsListByResourceGroupSamples { +public final class ClientsDeleteSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * Topics_ListByResourceGroup.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Clients_Delete.json */ /** - * Sample code: Topics_ListByResourceGroup. + * Sample code: Clients_Delete. * * @param manager Entry point to EventGridManager. */ - public static void topicsListByResourceGroup(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.topics().listByResourceGroup("examplerg", null, null, com.azure.core.util.Context.NONE); + public static void clientsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.clients() + .delete("examplerg", "exampleNamespaceName1", "exampleClientName1", com.azure.core.util.Context.NONE); } } ``` @@ -5543,23 +5573,21 @@ public final class TopicsListByResourceGroupSamples { ```java /** - * Samples for Topics ListEventTypes. + * Samples for PartnerConfigurations GetByResourceGroup. */ -public final class TopicsListEventTypesSamples { +public final class PartnerConfigurationsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_ListEventTypes. - * json + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerConfigurations_Get + * .json */ /** - * Sample code: Topics_ListEventTypes. + * Sample code: PartnerConfigurations_Get. * * @param manager Entry point to EventGridManager. */ - public static void topicsListEventTypes(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.topics() - .listEventTypes("examplerg", "Microsoft.Storage", "storageAccounts", "ExampleStorageAccount", - com.azure.core.util.Context.NONE); + public static void partnerConfigurationsGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerConfigurations().getByResourceGroupWithResponse("examplerg", com.azure.core.util.Context.NONE); } } ``` @@ -5568,21 +5596,22 @@ public final class TopicsListEventTypesSamples { ```java /** - * Samples for Topics ListSharedAccessKeys. + * Samples for PartnerTopics Activate. */ -public final class TopicsListSharedAccessKeysSamples { +public final class PartnerTopicsActivateSamples { /* - * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ - * Topics_ListSharedAccessKeys.json + * x-ms-original-file: + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/PartnerTopics_Activate. + * json */ /** - * Sample code: Topics_ListSharedAccessKeys. + * Sample code: PartnerTopics_Activate. * * @param manager Entry point to EventGridManager. */ - public static void topicsListSharedAccessKeys(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.topics() - .listSharedAccessKeysWithResponse("examplerg", "exampletopic2", com.azure.core.util.Context.NONE); + public static void partnerTopicsActivate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerTopics() + .activateWithResponse("examplerg", "examplePartnerTopic1", com.azure.core.util.Context.NONE); } } ``` @@ -5590,25 +5619,21 @@ public final class TopicsListSharedAccessKeysSamples { ### Topics_RegenerateKey ```java -import com.azure.resourcemanager.eventgrid.models.TopicRegenerateKeyRequest; - /** - * Samples for Topics RegenerateKey. + * Samples for VerifiedPartners Get. */ -public final class TopicsRegenerateKeySamples { +public final class VerifiedPartnersGetSamples { /* * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_RegenerateKey.json + * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/VerifiedPartners_Get.json */ /** - * Sample code: Topics_RegenerateKey. + * Sample code: VerifiedPartners_Get. * * @param manager Entry point to EventGridManager. */ - public static void topicsRegenerateKey(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.topics() - .regenerateKey("examplerg", "exampletopic2", - new TopicRegenerateKeyRequest().withKeyName("fakeTokenPlaceholder"), com.azure.core.util.Context.NONE); + public static void verifiedPartnersGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.verifiedPartners().getWithResponse("Contoso.Finance", com.azure.core.util.Context.NONE); } } ``` @@ -5616,50 +5641,23 @@ public final class TopicsRegenerateKeySamples { ### Topics_Update ```java -import com.azure.resourcemanager.eventgrid.models.InboundIpRule; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.Topic; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for Topics Update. + * Samples for PartnerTopicEventSubscriptions Delete. */ -public final class TopicsUpdateSamples { +public final class PartnerTopicEventSubscriptionsDeleteSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/Topics_Update.json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * PartnerTopicEventSubscriptions_Delete.json */ /** - * Sample code: Topics_Update. + * Sample code: PartnerTopicEventSubscriptions_Delete. * * @param manager Entry point to EventGridManager. */ - public static void topicsUpdate(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - Topic resource = manager.topics() - .getByResourceGroupWithResponse("examplerg", "exampletopic1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withInboundIpRules( - Arrays.asList(new InboundIpRule().withIpMask("12.18.30.15").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("12.18.176.1").withAction(IpActionType.ALLOW))) - .apply(); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + public static void + partnerTopicEventSubscriptionsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.partnerTopicEventSubscriptions() + .delete("examplerg", "examplePartnerTopic1", "examplesubscription1", com.azure.core.util.Context.NONE); } } ``` @@ -5668,20 +5666,21 @@ public final class TopicsUpdateSamples { ```java /** - * Samples for VerifiedPartners Get. + * Samples for DomainEventSubscriptions Delete. */ -public final class VerifiedPartnersGetSamples { +public final class DomainEventSubscriptionsDeleteSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/VerifiedPartners_Get.json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * DomainEventSubscriptions_Delete.json */ /** - * Sample code: VerifiedPartners_Get. + * Sample code: DomainEventSubscriptions_Delete. * * @param manager Entry point to EventGridManager. */ - public static void verifiedPartnersGet(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.verifiedPartners().getWithResponse("Contoso.Finance", com.azure.core.util.Context.NONE); + public static void domainEventSubscriptionsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.domainEventSubscriptions() + .delete("examplerg", "exampleDomain1", "examplesubscription1", com.azure.core.util.Context.NONE); } } ``` @@ -5690,21 +5689,22 @@ public final class VerifiedPartnersGetSamples { ```java /** - * Samples for VerifiedPartners List. + * Samples for EventSubscriptions ListRegionalBySubscription. */ -public final class VerifiedPartnersListSamples { +public final class EventSubscriptionsListRegionalBySubscriptionSamples { /* - * x-ms-original-file: - * specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/VerifiedPartners_List. - * json + * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2025-02-15/examples/ + * EventSubscriptions_ListRegionalBySubscription.json */ /** - * Sample code: VerifiedPartners_List. + * Sample code: EventSubscriptions_ListRegionalBySubscription. * * @param manager Entry point to EventGridManager. */ - public static void verifiedPartnersList(com.azure.resourcemanager.eventgrid.EventGridManager manager) { - manager.verifiedPartners().list(null, null, com.azure.core.util.Context.NONE); + public static void + eventSubscriptionsListRegionalBySubscription(com.azure.resourcemanager.eventgrid.EventGridManager manager) { + manager.eventSubscriptions() + .listRegionalBySubscription("westus2", null, null, com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml b/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml index d0d8576c8947..a2caf13383eb 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml @@ -45,7 +45,6 @@ UTF-8 0 0 - false true diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/AzureFunctionEventSubscriptionDestinationPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/AzureFunctionEventSubscriptionDestinationPropertiesTests.java deleted file mode 100644 index 02589631945c..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/AzureFunctionEventSubscriptionDestinationPropertiesTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.AzureFunctionEventSubscriptionDestinationProperties; -import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeMapping; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AzureFunctionEventSubscriptionDestinationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureFunctionEventSubscriptionDestinationProperties model = BinaryData.fromString( - "{\"resourceId\":\"goadyedmzr\",\"maxEventsPerBatch\":667032439,\"preferredBatchSizeInKilobytes\":41358152,\"deliveryAttributeMappings\":[{\"type\":\"DeliveryAttributeMapping\",\"name\":\"noitpkpztr\"}]}") - .toObject(AzureFunctionEventSubscriptionDestinationProperties.class); - Assertions.assertEquals("goadyedmzr", model.resourceId()); - Assertions.assertEquals(667032439, model.maxEventsPerBatch()); - Assertions.assertEquals(41358152, model.preferredBatchSizeInKilobytes()); - Assertions.assertEquals("noitpkpztr", model.deliveryAttributeMappings().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureFunctionEventSubscriptionDestinationProperties model - = new AzureFunctionEventSubscriptionDestinationProperties().withResourceId("goadyedmzr") - .withMaxEventsPerBatch(667032439) - .withPreferredBatchSizeInKilobytes(41358152) - .withDeliveryAttributeMappings(Arrays.asList(new DeliveryAttributeMapping().withName("noitpkpztr"))); - model = BinaryData.fromObject(model).toObject(AzureFunctionEventSubscriptionDestinationProperties.class); - Assertions.assertEquals("goadyedmzr", model.resourceId()); - Assertions.assertEquals(667032439, model.maxEventsPerBatch()); - Assertions.assertEquals(41358152, model.preferredBatchSizeInKilobytes()); - Assertions.assertEquals("noitpkpztr", model.deliveryAttributeMappings().get(0).name()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/AzureFunctionEventSubscriptionDestinationTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/AzureFunctionEventSubscriptionDestinationTests.java deleted file mode 100644 index bae18161a515..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/AzureFunctionEventSubscriptionDestinationTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.AzureFunctionEventSubscriptionDestination; -import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeMapping; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AzureFunctionEventSubscriptionDestinationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureFunctionEventSubscriptionDestination model = BinaryData.fromString( - "{\"endpointType\":\"AzureFunction\",\"properties\":{\"resourceId\":\"x\",\"maxEventsPerBatch\":1120237125,\"preferredBatchSizeInKilobytes\":857070249,\"deliveryAttributeMappings\":[{\"type\":\"DeliveryAttributeMapping\",\"name\":\"ugyxpqit\"}]}}") - .toObject(AzureFunctionEventSubscriptionDestination.class); - Assertions.assertEquals("x", model.resourceId()); - Assertions.assertEquals(1120237125, model.maxEventsPerBatch()); - Assertions.assertEquals(857070249, model.preferredBatchSizeInKilobytes()); - Assertions.assertEquals("ugyxpqit", model.deliveryAttributeMappings().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureFunctionEventSubscriptionDestination model - = new AzureFunctionEventSubscriptionDestination().withResourceId("x") - .withMaxEventsPerBatch(1120237125) - .withPreferredBatchSizeInKilobytes(857070249) - .withDeliveryAttributeMappings(Arrays.asList(new DeliveryAttributeMapping().withName("ugyxpqit"))); - model = BinaryData.fromObject(model).toObject(AzureFunctionEventSubscriptionDestination.class); - Assertions.assertEquals("x", model.resourceId()); - Assertions.assertEquals(1120237125, model.maxEventsPerBatch()); - Assertions.assertEquals(857070249, model.preferredBatchSizeInKilobytes()); - Assertions.assertEquals("ugyxpqit", model.deliveryAttributeMappings().get(0).name()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/CaCertificatesDeleteMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/CaCertificatesDeleteMockTests.java deleted file mode 100644 index 9f56f1ff019d..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/CaCertificatesDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CaCertificatesDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.caCertificates().delete("nuhiig", "yl", "ui", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelInnerTests.java deleted file mode 100644 index c03ad059f22c..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelInnerTests.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.ChannelInner; -import com.azure.resourcemanager.eventgrid.models.ChannelProvisioningState; -import com.azure.resourcemanager.eventgrid.models.ChannelType; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import com.azure.resourcemanager.eventgrid.models.PartnerTopicInfo; -import com.azure.resourcemanager.eventgrid.models.ReadinessState; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ChannelInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ChannelInner model = BinaryData.fromString( - "{\"properties\":{\"channelType\":\"PartnerTopic\",\"partnerTopicInfo\":{\"azureSubscriptionId\":\"oizh\",\"resourceGroupName\":\"rxybqsoq\",\"name\":\"gkdmb\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"qes\":{\"description\":\"ufpdznrbtcqq\",\"displayName\":\"qglhq\",\"documentationUrl\":\"ufo\",\"dataSchemaUrl\":\"jywif\"}}},\"source\":\"gdf\"},\"messageForActivation\":\"lzl\",\"provisioningState\":\"Canceled\",\"readinessState\":\"Activated\",\"expirationTimeIfNotActivatedUtc\":\"2021-02-26T02:19:15Z\"},\"id\":\"mrvktsizntoc\",\"name\":\"pa\",\"type\":\"uajpsquc\"}") - .toObject(ChannelInner.class); - Assertions.assertEquals(ChannelType.PARTNER_TOPIC, model.channelType()); - Assertions.assertEquals("oizh", model.partnerTopicInfo().azureSubscriptionId()); - Assertions.assertEquals("rxybqsoq", model.partnerTopicInfo().resourceGroupName()); - Assertions.assertEquals("gkdmb", model.partnerTopicInfo().name()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.partnerTopicInfo().eventTypeInfo().kind()); - Assertions.assertEquals("ufpdznrbtcqq", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("qes").description()); - Assertions.assertEquals("qglhq", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("qes").displayName()); - Assertions.assertEquals("ufo", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("qes").documentationUrl()); - Assertions.assertEquals("jywif", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("qes").dataSchemaUrl()); - Assertions.assertEquals("gdf", model.partnerTopicInfo().source()); - Assertions.assertEquals("lzl", model.messageForActivation()); - Assertions.assertEquals(ChannelProvisioningState.CANCELED, model.provisioningState()); - Assertions.assertEquals(ReadinessState.ACTIVATED, model.readinessState()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-26T02:19:15Z"), model.expirationTimeIfNotActivatedUtc()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ChannelInner model = new ChannelInner().withChannelType(ChannelType.PARTNER_TOPIC) - .withPartnerTopicInfo(new PartnerTopicInfo().withAzureSubscriptionId("oizh") - .withResourceGroupName("rxybqsoq") - .withName("gkdmb") - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("qes", - new InlineEventProperties().withDescription("ufpdznrbtcqq") - .withDisplayName("qglhq") - .withDocumentationUrl("ufo") - .withDataSchemaUrl("jywif")))) - .withSource("gdf")) - .withMessageForActivation("lzl") - .withProvisioningState(ChannelProvisioningState.CANCELED) - .withReadinessState(ReadinessState.ACTIVATED) - .withExpirationTimeIfNotActivatedUtc(OffsetDateTime.parse("2021-02-26T02:19:15Z")); - model = BinaryData.fromObject(model).toObject(ChannelInner.class); - Assertions.assertEquals(ChannelType.PARTNER_TOPIC, model.channelType()); - Assertions.assertEquals("oizh", model.partnerTopicInfo().azureSubscriptionId()); - Assertions.assertEquals("rxybqsoq", model.partnerTopicInfo().resourceGroupName()); - Assertions.assertEquals("gkdmb", model.partnerTopicInfo().name()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.partnerTopicInfo().eventTypeInfo().kind()); - Assertions.assertEquals("ufpdznrbtcqq", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("qes").description()); - Assertions.assertEquals("qglhq", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("qes").displayName()); - Assertions.assertEquals("ufo", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("qes").documentationUrl()); - Assertions.assertEquals("jywif", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("qes").dataSchemaUrl()); - Assertions.assertEquals("gdf", model.partnerTopicInfo().source()); - Assertions.assertEquals("lzl", model.messageForActivation()); - Assertions.assertEquals(ChannelProvisioningState.CANCELED, model.provisioningState()); - Assertions.assertEquals(ReadinessState.ACTIVATED, model.readinessState()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-26T02:19:15Z"), model.expirationTimeIfNotActivatedUtc()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelPropertiesTests.java deleted file mode 100644 index 5363f7755ecb..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelPropertiesTests.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.ChannelProperties; -import com.azure.resourcemanager.eventgrid.models.ChannelProvisioningState; -import com.azure.resourcemanager.eventgrid.models.ChannelType; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import com.azure.resourcemanager.eventgrid.models.PartnerTopicInfo; -import com.azure.resourcemanager.eventgrid.models.ReadinessState; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ChannelPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ChannelProperties model = BinaryData.fromString( - "{\"channelType\":\"PartnerTopic\",\"partnerTopicInfo\":{\"azureSubscriptionId\":\"dkfo\",\"resourceGroupName\":\"nygj\",\"name\":\"jddeqsrdeupewnw\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"arcryuanzwuxzdxt\":{\"description\":\"flusarhmof\",\"displayName\":\"hs\",\"documentationUrl\":\"urkdtmlx\",\"dataSchemaUrl\":\"kuksjtxukcdm\"}}},\"source\":\"rlhm\"},\"messageForActivation\":\"fp\",\"provisioningState\":\"Updating\",\"readinessState\":\"Activated\",\"expirationTimeIfNotActivatedUtc\":\"2021-02-24T20:47:16Z\"}") - .toObject(ChannelProperties.class); - Assertions.assertEquals(ChannelType.PARTNER_TOPIC, model.channelType()); - Assertions.assertEquals("dkfo", model.partnerTopicInfo().azureSubscriptionId()); - Assertions.assertEquals("nygj", model.partnerTopicInfo().resourceGroupName()); - Assertions.assertEquals("jddeqsrdeupewnw", model.partnerTopicInfo().name()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.partnerTopicInfo().eventTypeInfo().kind()); - Assertions.assertEquals("flusarhmof", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("arcryuanzwuxzdxt").description()); - Assertions.assertEquals("hs", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("arcryuanzwuxzdxt").displayName()); - Assertions.assertEquals("urkdtmlx", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("arcryuanzwuxzdxt").documentationUrl()); - Assertions.assertEquals("kuksjtxukcdm", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("arcryuanzwuxzdxt").dataSchemaUrl()); - Assertions.assertEquals("rlhm", model.partnerTopicInfo().source()); - Assertions.assertEquals("fp", model.messageForActivation()); - Assertions.assertEquals(ChannelProvisioningState.UPDATING, model.provisioningState()); - Assertions.assertEquals(ReadinessState.ACTIVATED, model.readinessState()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-24T20:47:16Z"), model.expirationTimeIfNotActivatedUtc()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ChannelProperties model = new ChannelProperties().withChannelType(ChannelType.PARTNER_TOPIC) - .withPartnerTopicInfo(new PartnerTopicInfo().withAzureSubscriptionId("dkfo") - .withResourceGroupName("nygj") - .withName("jddeqsrdeupewnw") - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("arcryuanzwuxzdxt", - new InlineEventProperties().withDescription("flusarhmof") - .withDisplayName("hs") - .withDocumentationUrl("urkdtmlx") - .withDataSchemaUrl("kuksjtxukcdm")))) - .withSource("rlhm")) - .withMessageForActivation("fp") - .withProvisioningState(ChannelProvisioningState.UPDATING) - .withReadinessState(ReadinessState.ACTIVATED) - .withExpirationTimeIfNotActivatedUtc(OffsetDateTime.parse("2021-02-24T20:47:16Z")); - model = BinaryData.fromObject(model).toObject(ChannelProperties.class); - Assertions.assertEquals(ChannelType.PARTNER_TOPIC, model.channelType()); - Assertions.assertEquals("dkfo", model.partnerTopicInfo().azureSubscriptionId()); - Assertions.assertEquals("nygj", model.partnerTopicInfo().resourceGroupName()); - Assertions.assertEquals("jddeqsrdeupewnw", model.partnerTopicInfo().name()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.partnerTopicInfo().eventTypeInfo().kind()); - Assertions.assertEquals("flusarhmof", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("arcryuanzwuxzdxt").description()); - Assertions.assertEquals("hs", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("arcryuanzwuxzdxt").displayName()); - Assertions.assertEquals("urkdtmlx", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("arcryuanzwuxzdxt").documentationUrl()); - Assertions.assertEquals("kuksjtxukcdm", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("arcryuanzwuxzdxt").dataSchemaUrl()); - Assertions.assertEquals("rlhm", model.partnerTopicInfo().source()); - Assertions.assertEquals("fp", model.messageForActivation()); - Assertions.assertEquals(ChannelProvisioningState.UPDATING, model.provisioningState()); - Assertions.assertEquals(ReadinessState.ACTIVATED, model.readinessState()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-24T20:47:16Z"), model.expirationTimeIfNotActivatedUtc()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelUpdateParametersPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelUpdateParametersPropertiesTests.java deleted file mode 100644 index 46894558016b..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelUpdateParametersPropertiesTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.ChannelUpdateParametersProperties; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import com.azure.resourcemanager.eventgrid.models.PartnerUpdateTopicInfo; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ChannelUpdateParametersPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ChannelUpdateParametersProperties model = BinaryData.fromString( - "{\"expirationTimeIfNotActivatedUtc\":\"2021-07-20T07:16:34Z\",\"partnerTopicInfo\":{\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"vndhkrwpdapp\":{\"description\":\"nzl\",\"displayName\":\"fmppe\",\"documentationUrl\":\"vmgxsab\",\"dataSchemaUrl\":\"qduujitcjczdz\"},\"gphuticndvka\":{\"description\":\"bdkvwrwjf\",\"displayName\":\"snhu\",\"documentationUrl\":\"eltmrldhugjzzdat\",\"dataSchemaUrl\":\"hocdgeab\"},\"lwckbasyypnddhs\":{\"description\":\"wyiftyhxhur\",\"displayName\":\"ftyxolniw\",\"documentationUrl\":\"cukjf\",\"dataSchemaUrl\":\"iawxklry\"}}}}}") - .toObject(ChannelUpdateParametersProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-20T07:16:34Z"), model.expirationTimeIfNotActivatedUtc()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.partnerTopicInfo().eventTypeInfo().kind()); - Assertions.assertEquals("nzl", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("vndhkrwpdapp").description()); - Assertions.assertEquals("fmppe", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("vndhkrwpdapp").displayName()); - Assertions.assertEquals("vmgxsab", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("vndhkrwpdapp").documentationUrl()); - Assertions.assertEquals("qduujitcjczdz", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("vndhkrwpdapp").dataSchemaUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ChannelUpdateParametersProperties model - = new ChannelUpdateParametersProperties() - .withExpirationTimeIfNotActivatedUtc(OffsetDateTime.parse("2021-07-20T07:16:34Z")) - .withPartnerTopicInfo(new PartnerUpdateTopicInfo() - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("vndhkrwpdapp", - new InlineEventProperties().withDescription("nzl") - .withDisplayName("fmppe") - .withDocumentationUrl("vmgxsab") - .withDataSchemaUrl("qduujitcjczdz"), - "gphuticndvka", - new InlineEventProperties().withDescription("bdkvwrwjf") - .withDisplayName("snhu") - .withDocumentationUrl("eltmrldhugjzzdat") - .withDataSchemaUrl("hocdgeab"), - "lwckbasyypnddhs", - new InlineEventProperties().withDescription("wyiftyhxhur") - .withDisplayName("ftyxolniw") - .withDocumentationUrl("cukjf") - .withDataSchemaUrl("iawxklry"))))); - model = BinaryData.fromObject(model).toObject(ChannelUpdateParametersProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-20T07:16:34Z"), model.expirationTimeIfNotActivatedUtc()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.partnerTopicInfo().eventTypeInfo().kind()); - Assertions.assertEquals("nzl", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("vndhkrwpdapp").description()); - Assertions.assertEquals("fmppe", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("vndhkrwpdapp").displayName()); - Assertions.assertEquals("vmgxsab", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("vndhkrwpdapp").documentationUrl()); - Assertions.assertEquals("qduujitcjczdz", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("vndhkrwpdapp").dataSchemaUrl()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelUpdateParametersTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelUpdateParametersTests.java deleted file mode 100644 index 87d6e2ad68d3..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelUpdateParametersTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.ChannelUpdateParameters; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import com.azure.resourcemanager.eventgrid.models.PartnerUpdateTopicInfo; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ChannelUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ChannelUpdateParameters model = BinaryData.fromString( - "{\"properties\":{\"expirationTimeIfNotActivatedUtc\":\"2021-07-13T23:15:24Z\",\"partnerTopicInfo\":{\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"bwjzr\":{\"description\":\"uvamiheognarxzxt\",\"displayName\":\"o\",\"documentationUrl\":\"si\",\"dataSchemaUrl\":\"evcciqihnhun\"},\"jhqjbasvmsmjqul\":{\"description\":\"ygxgispemvtz\",\"displayName\":\"ufubl\",\"documentationUrl\":\"fxqeof\",\"dataSchemaUrl\":\"e\"},\"hxbnjbiksqrg\":{\"description\":\"sntnbybkzgcw\",\"displayName\":\"clxxwrljdo\",\"documentationUrl\":\"kcqvkocrc\",\"dataSchemaUrl\":\"kwt\"}}}}}}") - .toObject(ChannelUpdateParameters.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-13T23:15:24Z"), model.expirationTimeIfNotActivatedUtc()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.partnerTopicInfo().eventTypeInfo().kind()); - Assertions.assertEquals("uvamiheognarxzxt", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("bwjzr").description()); - Assertions.assertEquals("o", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("bwjzr").displayName()); - Assertions.assertEquals("si", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("bwjzr").documentationUrl()); - Assertions.assertEquals("evcciqihnhun", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("bwjzr").dataSchemaUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ChannelUpdateParameters model - = new ChannelUpdateParameters() - .withExpirationTimeIfNotActivatedUtc(OffsetDateTime.parse("2021-07-13T23:15:24Z")) - .withPartnerTopicInfo(new PartnerUpdateTopicInfo() - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("bwjzr", - new InlineEventProperties().withDescription("uvamiheognarxzxt") - .withDisplayName("o") - .withDocumentationUrl("si") - .withDataSchemaUrl("evcciqihnhun"), - "jhqjbasvmsmjqul", - new InlineEventProperties().withDescription("ygxgispemvtz") - .withDisplayName("ufubl") - .withDocumentationUrl("fxqeof") - .withDataSchemaUrl("e"), - "hxbnjbiksqrg", - new InlineEventProperties().withDescription("sntnbybkzgcw") - .withDisplayName("clxxwrljdo") - .withDocumentationUrl("kcqvkocrc") - .withDataSchemaUrl("kwt"))))); - model = BinaryData.fromObject(model).toObject(ChannelUpdateParameters.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-13T23:15:24Z"), model.expirationTimeIfNotActivatedUtc()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.partnerTopicInfo().eventTypeInfo().kind()); - Assertions.assertEquals("uvamiheognarxzxt", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("bwjzr").description()); - Assertions.assertEquals("o", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("bwjzr").displayName()); - Assertions.assertEquals("si", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("bwjzr").documentationUrl()); - Assertions.assertEquals("evcciqihnhun", - model.partnerTopicInfo().eventTypeInfo().inlineEventTypes().get("bwjzr").dataSchemaUrl()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelsCreateOrUpdateWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index ff29e42e4a81..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.Channel; -import com.azure.resourcemanager.eventgrid.models.ChannelProvisioningState; -import com.azure.resourcemanager.eventgrid.models.ChannelType; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import com.azure.resourcemanager.eventgrid.models.PartnerTopicInfo; -import com.azure.resourcemanager.eventgrid.models.ReadinessState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ChannelsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"channelType\":\"PartnerTopic\",\"partnerTopicInfo\":{\"azureSubscriptionId\":\"mtuowogtgitsqhzv\",\"resourceGroupName\":\"zcdba\",\"name\":\"zndscxmxeatkdbmw\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"bqbnaomhjrmkuh\":{},\"axljal\":{},\"i\":{}}},\"source\":\"jmobca\"},\"messageForActivation\":\"de\",\"provisioningState\":\"Succeeded\",\"readinessState\":\"Activated\",\"expirationTimeIfNotActivatedUtc\":\"2021-12-08T09:52:24Z\"},\"id\":\"fgvaknokzwj\",\"name\":\"zrltixldzyyf\",\"type\":\"tpq\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - Channel response - = manager.channels() - .define("dfaifyzyzeyuube") - .withExistingPartnerNamespace("gxannnoytzposewx", "gpxvkqmaupxvpi") - .withChannelType(ChannelType.PARTNER_TOPIC) - .withPartnerTopicInfo( - new PartnerTopicInfo().withAzureSubscriptionId("ytoithgygvfl") - .withResourceGroupName("vdihoynkrx") - .withName("twk") - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("cpcunnuzdqum", new InlineEventProperties(), "enodna", - new InlineEventProperties(), "enhqhskndnelq", new InlineEventProperties(), "aadl", - new InlineEventProperties()))) - .withSource("wf")) - .withMessageForActivation("nniyopetxi") - .withProvisioningState(ChannelProvisioningState.CANCELED) - .withReadinessState(ReadinessState.ACTIVATED) - .withExpirationTimeIfNotActivatedUtc(OffsetDateTime.parse("2021-06-10T00:54:20Z")) - .create(); - - Assertions.assertEquals(ChannelType.PARTNER_TOPIC, response.channelType()); - Assertions.assertEquals("mtuowogtgitsqhzv", response.partnerTopicInfo().azureSubscriptionId()); - Assertions.assertEquals("zcdba", response.partnerTopicInfo().resourceGroupName()); - Assertions.assertEquals("zndscxmxeatkdbmw", response.partnerTopicInfo().name()); - Assertions.assertEquals(EventDefinitionKind.INLINE, response.partnerTopicInfo().eventTypeInfo().kind()); - Assertions.assertEquals("jmobca", response.partnerTopicInfo().source()); - Assertions.assertEquals("de", response.messageForActivation()); - Assertions.assertEquals(ChannelProvisioningState.SUCCEEDED, response.provisioningState()); - Assertions.assertEquals(ReadinessState.ACTIVATED, response.readinessState()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-08T09:52:24Z"), - response.expirationTimeIfNotActivatedUtc()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelsDeleteMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelsDeleteMockTests.java deleted file mode 100644 index a2250926cf44..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ChannelsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.channels().delete("iciijqpkzfbojx", "mcsmyqwixvcp", "nkwywzwofa", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelsGetFullUrlWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelsGetFullUrlWithResponseMockTests.java deleted file mode 100644 index 9c80d429ed58..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelsGetFullUrlWithResponseMockTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFullUrl; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ChannelsGetFullUrlWithResponseMockTests { - @Test - public void testGetFullUrlWithResponse() throws Exception { - String responseStr = "{\"endpointUrl\":\"pxklurccl\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - EventSubscriptionFullUrl response = manager.channels() - .getFullUrlWithResponse("abnsmj", "wynqxaekqsykvwj", "qpkevmyltjc", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("pxklurccl", response.endpointUrl()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelsGetWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelsGetWithResponseMockTests.java deleted file mode 100644 index 3945d97e08fc..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelsGetWithResponseMockTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.Channel; -import com.azure.resourcemanager.eventgrid.models.ChannelProvisioningState; -import com.azure.resourcemanager.eventgrid.models.ChannelType; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.ReadinessState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ChannelsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"channelType\":\"PartnerTopic\",\"partnerTopicInfo\":{\"azureSubscriptionId\":\"cdigpt\",\"resourceGroupName\":\"brzmqxucycijoclx\",\"name\":\"tgjcy\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"r\":{},\"jb\":{},\"xjeaoqaqbzgyh\":{}}},\"source\":\"wvua\"},\"messageForActivation\":\"wbqamteuliy\",\"provisioningState\":\"Succeeded\",\"readinessState\":\"Activated\",\"expirationTimeIfNotActivatedUtc\":\"2021-11-30T21:10:15Z\"},\"id\":\"f\",\"name\":\"uxx\",\"type\":\"pmywbormcq\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - Channel response = manager.channels() - .getWithResponse("mtbdrvcqgu", "fzhompheq", "urelyujlfyoump", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ChannelType.PARTNER_TOPIC, response.channelType()); - Assertions.assertEquals("cdigpt", response.partnerTopicInfo().azureSubscriptionId()); - Assertions.assertEquals("brzmqxucycijoclx", response.partnerTopicInfo().resourceGroupName()); - Assertions.assertEquals("tgjcy", response.partnerTopicInfo().name()); - Assertions.assertEquals(EventDefinitionKind.INLINE, response.partnerTopicInfo().eventTypeInfo().kind()); - Assertions.assertEquals("wvua", response.partnerTopicInfo().source()); - Assertions.assertEquals("wbqamteuliy", response.messageForActivation()); - Assertions.assertEquals(ChannelProvisioningState.SUCCEEDED, response.provisioningState()); - Assertions.assertEquals(ReadinessState.ACTIVATED, response.readinessState()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-30T21:10:15Z"), - response.expirationTimeIfNotActivatedUtc()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelsListByPartnerNamespaceMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelsListByPartnerNamespaceMockTests.java deleted file mode 100644 index d659bf6a286f..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelsListByPartnerNamespaceMockTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.Channel; -import com.azure.resourcemanager.eventgrid.models.ChannelProvisioningState; -import com.azure.resourcemanager.eventgrid.models.ChannelType; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.ReadinessState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ChannelsListByPartnerNamespaceMockTests { - @Test - public void testListByPartnerNamespace() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"channelType\":\"PartnerTopic\",\"partnerTopicInfo\":{\"azureSubscriptionId\":\"udqll\",\"resourceGroupName\":\"auzpjlx\",\"name\":\"huxiqhzlraymez\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"mxrfdsa\":{}}},\"source\":\"ednwyyshtu\"},\"messageForActivation\":\"mevuafpwzy\",\"provisioningState\":\"Succeeded\",\"readinessState\":\"Activated\",\"expirationTimeIfNotActivatedUtc\":\"2021-11-22T11:25Z\"},\"id\":\"xeqipx\",\"name\":\"zdyi\",\"type\":\"sfayorpravkjoges\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.channels() - .listByPartnerNamespace("meottawj", "osxw", "hnhjtfvpndpmi", 408225634, com.azure.core.util.Context.NONE); - - Assertions.assertEquals(ChannelType.PARTNER_TOPIC, response.iterator().next().channelType()); - Assertions.assertEquals("udqll", response.iterator().next().partnerTopicInfo().azureSubscriptionId()); - Assertions.assertEquals("auzpjlx", response.iterator().next().partnerTopicInfo().resourceGroupName()); - Assertions.assertEquals("huxiqhzlraymez", response.iterator().next().partnerTopicInfo().name()); - Assertions.assertEquals(EventDefinitionKind.INLINE, - response.iterator().next().partnerTopicInfo().eventTypeInfo().kind()); - Assertions.assertEquals("ednwyyshtu", response.iterator().next().partnerTopicInfo().source()); - Assertions.assertEquals("mevuafpwzy", response.iterator().next().messageForActivation()); - Assertions.assertEquals(ChannelProvisioningState.SUCCEEDED, response.iterator().next().provisioningState()); - Assertions.assertEquals(ReadinessState.ACTIVATED, response.iterator().next().readinessState()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-22T11:25Z"), - response.iterator().next().expirationTimeIfNotActivatedUtc()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelsListResultTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelsListResultTests.java deleted file mode 100644 index 2e613493998f..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelsListResultTests.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.ChannelInner; -import com.azure.resourcemanager.eventgrid.models.ChannelProvisioningState; -import com.azure.resourcemanager.eventgrid.models.ChannelType; -import com.azure.resourcemanager.eventgrid.models.ChannelsListResult; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import com.azure.resourcemanager.eventgrid.models.PartnerTopicInfo; -import com.azure.resourcemanager.eventgrid.models.ReadinessState; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ChannelsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ChannelsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"channelType\":\"PartnerTopic\",\"partnerTopicInfo\":{\"azureSubscriptionId\":\"bvpyss\",\"resourceGroupName\":\"nruj\",\"name\":\"uhmuouqfprwzwbn\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"uizga\":{}}},\"source\":\"ufizuckyf\"},\"messageForActivation\":\"rfidfvzwdz\",\"provisioningState\":\"Deleting\",\"readinessState\":\"Activated\",\"expirationTimeIfNotActivatedUtc\":\"2021-11-17T17:09:54Z\"},\"id\":\"dkfthwxmnt\",\"name\":\"i\",\"type\":\"aop\"}],\"nextLink\":\"mijcmmxdcufufs\"}") - .toObject(ChannelsListResult.class); - Assertions.assertEquals(ChannelType.PARTNER_TOPIC, model.value().get(0).channelType()); - Assertions.assertEquals("bvpyss", model.value().get(0).partnerTopicInfo().azureSubscriptionId()); - Assertions.assertEquals("nruj", model.value().get(0).partnerTopicInfo().resourceGroupName()); - Assertions.assertEquals("uhmuouqfprwzwbn", model.value().get(0).partnerTopicInfo().name()); - Assertions.assertEquals(EventDefinitionKind.INLINE, - model.value().get(0).partnerTopicInfo().eventTypeInfo().kind()); - Assertions.assertEquals("ufizuckyf", model.value().get(0).partnerTopicInfo().source()); - Assertions.assertEquals("rfidfvzwdz", model.value().get(0).messageForActivation()); - Assertions.assertEquals(ChannelProvisioningState.DELETING, model.value().get(0).provisioningState()); - Assertions.assertEquals(ReadinessState.ACTIVATED, model.value().get(0).readinessState()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-17T17:09:54Z"), - model.value().get(0).expirationTimeIfNotActivatedUtc()); - Assertions.assertEquals("mijcmmxdcufufs", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ChannelsListResult model = new ChannelsListResult() - .withValue(Arrays.asList(new ChannelInner().withChannelType(ChannelType.PARTNER_TOPIC) - .withPartnerTopicInfo(new PartnerTopicInfo().withAzureSubscriptionId("bvpyss") - .withResourceGroupName("nruj") - .withName("uhmuouqfprwzwbn") - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("uizga", new InlineEventProperties()))) - .withSource("ufizuckyf")) - .withMessageForActivation("rfidfvzwdz") - .withProvisioningState(ChannelProvisioningState.DELETING) - .withReadinessState(ReadinessState.ACTIVATED) - .withExpirationTimeIfNotActivatedUtc(OffsetDateTime.parse("2021-11-17T17:09:54Z")))) - .withNextLink("mijcmmxdcufufs"); - model = BinaryData.fromObject(model).toObject(ChannelsListResult.class); - Assertions.assertEquals(ChannelType.PARTNER_TOPIC, model.value().get(0).channelType()); - Assertions.assertEquals("bvpyss", model.value().get(0).partnerTopicInfo().azureSubscriptionId()); - Assertions.assertEquals("nruj", model.value().get(0).partnerTopicInfo().resourceGroupName()); - Assertions.assertEquals("uhmuouqfprwzwbn", model.value().get(0).partnerTopicInfo().name()); - Assertions.assertEquals(EventDefinitionKind.INLINE, - model.value().get(0).partnerTopicInfo().eventTypeInfo().kind()); - Assertions.assertEquals("ufizuckyf", model.value().get(0).partnerTopicInfo().source()); - Assertions.assertEquals("rfidfvzwdz", model.value().get(0).messageForActivation()); - Assertions.assertEquals(ChannelProvisioningState.DELETING, model.value().get(0).provisioningState()); - Assertions.assertEquals(ReadinessState.ACTIVATED, model.value().get(0).readinessState()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-17T17:09:54Z"), - model.value().get(0).expirationTimeIfNotActivatedUtc()); - Assertions.assertEquals("mijcmmxdcufufs", model.nextLink()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelsUpdateWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelsUpdateWithResponseMockTests.java deleted file mode 100644 index f171ca1ad3f4..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ChannelsUpdateWithResponseMockTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.ChannelUpdateParameters; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import com.azure.resourcemanager.eventgrid.models.PartnerUpdateTopicInfo; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ChannelsUpdateWithResponseMockTests { - @Test - public void testUpdateWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.channels() - .updateWithResponse("ickduoiqta", "t", "vsknxrwzawnv", - new ChannelUpdateParameters() - .withExpirationTimeIfNotActivatedUtc(OffsetDateTime.parse("2021-04-17T01:43:58Z")) - .withPartnerTopicInfo(new PartnerUpdateTopicInfo() - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("vhycvdimwrzregzg", new InlineEventProperties(), "ufutrwpw", - new InlineEventProperties(), "ryekzkd", new InlineEventProperties())))), - com.azure.core.util.Context.NONE); - - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientCertificateAuthenticationTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientCertificateAuthenticationTests.java deleted file mode 100644 index be73e1bf3fa0..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientCertificateAuthenticationTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.ClientCertificateAuthentication; -import com.azure.resourcemanager.eventgrid.models.ClientCertificateValidationScheme; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ClientCertificateAuthenticationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClientCertificateAuthentication model = BinaryData - .fromString("{\"validationScheme\":\"DnsMatchesAuthenticationName\",\"allowedThumbprints\":[\"igeho\"]}") - .toObject(ClientCertificateAuthentication.class); - Assertions.assertEquals(ClientCertificateValidationScheme.DNS_MATCHES_AUTHENTICATION_NAME, - model.validationScheme()); - Assertions.assertEquals("igeho", model.allowedThumbprints().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClientCertificateAuthentication model = new ClientCertificateAuthentication() - .withValidationScheme(ClientCertificateValidationScheme.DNS_MATCHES_AUTHENTICATION_NAME) - .withAllowedThumbprints(Arrays.asList("igeho")); - model = BinaryData.fromObject(model).toObject(ClientCertificateAuthentication.class); - Assertions.assertEquals(ClientCertificateValidationScheme.DNS_MATCHES_AUTHENTICATION_NAME, - model.validationScheme()); - Assertions.assertEquals("igeho", model.allowedThumbprints().get(0)); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientGroupInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientGroupInnerTests.java deleted file mode 100644 index 4742b0b3386a..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientGroupInnerTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.ClientGroupInner; -import org.junit.jupiter.api.Assertions; - -public final class ClientGroupInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClientGroupInner model = BinaryData.fromString( - "{\"properties\":{\"description\":\"cxtbzsg\",\"query\":\"c\",\"provisioningState\":\"Deleted\"},\"id\":\"wmdwzjeiachboo\",\"name\":\"flnrosfqpteehzz\",\"type\":\"ypyqrimzinp\"}") - .toObject(ClientGroupInner.class); - Assertions.assertEquals("cxtbzsg", model.description()); - Assertions.assertEquals("c", model.query()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClientGroupInner model = new ClientGroupInner().withDescription("cxtbzsg").withQuery("c"); - model = BinaryData.fromObject(model).toObject(ClientGroupInner.class); - Assertions.assertEquals("cxtbzsg", model.description()); - Assertions.assertEquals("c", model.query()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientGroupPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientGroupPropertiesTests.java deleted file mode 100644 index ab72badb0660..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientGroupPropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.ClientGroupProperties; -import org.junit.jupiter.api.Assertions; - -public final class ClientGroupPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClientGroupProperties model = BinaryData - .fromString("{\"description\":\"wjdk\",\"query\":\"soodqxhcrmnoh\",\"provisioningState\":\"Creating\"}") - .toObject(ClientGroupProperties.class); - Assertions.assertEquals("wjdk", model.description()); - Assertions.assertEquals("soodqxhcrmnoh", model.query()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClientGroupProperties model = new ClientGroupProperties().withDescription("wjdk").withQuery("soodqxhcrmnoh"); - model = BinaryData.fromObject(model).toObject(ClientGroupProperties.class); - Assertions.assertEquals("wjdk", model.description()); - Assertions.assertEquals("soodqxhcrmnoh", model.query()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientGroupsCreateOrUpdateMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientGroupsCreateOrUpdateMockTests.java deleted file mode 100644 index 2c55fbfbd2f6..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientGroupsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.ClientGroup; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ClientGroupsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"description\":\"wphpzfngqj\",\"query\":\"idftujwjjufwbe\",\"provisioningState\":\"Succeeded\"},\"id\":\"orhtss\",\"name\":\"uqnmdvhazcvj\",\"type\":\"tiq\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - ClientGroup response = manager.clientGroups() - .define("ygspnbonhpczykm") - .withExistingNamespace("wugiqjti", "gqgdminictteajoh") - .withDescription("vw") - .withQuery("csehchkhufm") - .create(); - - Assertions.assertEquals("wphpzfngqj", response.description()); - Assertions.assertEquals("idftujwjjufwbe", response.query()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientGroupsDeleteMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientGroupsDeleteMockTests.java deleted file mode 100644 index 42409ef197d8..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientGroupsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ClientGroupsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.clientGroups().delete("aglt", "xoe", "onql", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientGroupsGetWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientGroupsGetWithResponseMockTests.java deleted file mode 100644 index 7e21c27e6590..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientGroupsGetWithResponseMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.ClientGroup; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ClientGroupsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"description\":\"kcvtl\",\"query\":\"seskvcuar\",\"provisioningState\":\"Deleting\"},\"id\":\"nlp\",\"name\":\"rykycndzfqivjr\",\"type\":\"uykbbmn\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - ClientGroup response = manager.clientGroups() - .getWithResponse("ixymmpujivyql", "juvsmbmslzoyovw", "dbpqvybefgvm", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("kcvtl", response.description()); - Assertions.assertEquals("seskvcuar", response.query()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientGroupsListByNamespaceMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientGroupsListByNamespaceMockTests.java deleted file mode 100644 index f077ef188a63..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientGroupsListByNamespaceMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.ClientGroup; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ClientGroupsListByNamespaceMockTests { - @Test - public void testListByNamespace() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"description\":\"sbzhd\",\"query\":\"b\",\"provisioningState\":\"Failed\"},\"id\":\"b\",\"name\":\"h\",\"type\":\"alehpav\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.clientGroups() - .listByNamespace("fwmyymv", "dbpb", "fckdvez", 1420169641, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("sbzhd", response.iterator().next().description()); - Assertions.assertEquals("b", response.iterator().next().query()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientGroupsListResultTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientGroupsListResultTests.java deleted file mode 100644 index 8b8eaab1c5e6..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientGroupsListResultTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.ClientGroupInner; -import com.azure.resourcemanager.eventgrid.models.ClientGroupsListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ClientGroupsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClientGroupsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"description\":\"soifiyipjxsqw\",\"query\":\"rjb\",\"provisioningState\":\"Creating\"},\"id\":\"cjxvsnbyxqab\",\"name\":\"mocpc\",\"type\":\"shurzafbljjgpbto\"},{\"properties\":{\"description\":\"mkljavb\",\"query\":\"dtqajzyulpkudj\",\"provisioningState\":\"Canceled\"},\"id\":\"hbzhfepg\",\"name\":\"gqexzlocxs\",\"type\":\"paierh\"},{\"properties\":{\"description\":\"sglumma\",\"query\":\"j\",\"provisioningState\":\"Failed\"},\"id\":\"obnbdxkqpxokaj\",\"name\":\"onpimexgstxg\",\"type\":\"po\"}],\"nextLink\":\"maajrmvdjwzrlo\"}") - .toObject(ClientGroupsListResult.class); - Assertions.assertEquals("soifiyipjxsqw", model.value().get(0).description()); - Assertions.assertEquals("rjb", model.value().get(0).query()); - Assertions.assertEquals("maajrmvdjwzrlo", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClientGroupsListResult model = new ClientGroupsListResult() - .withValue(Arrays.asList(new ClientGroupInner().withDescription("soifiyipjxsqw").withQuery("rjb"), - new ClientGroupInner().withDescription("mkljavb").withQuery("dtqajzyulpkudj"), - new ClientGroupInner().withDescription("sglumma").withQuery("j"))) - .withNextLink("maajrmvdjwzrlo"); - model = BinaryData.fromObject(model).toObject(ClientGroupsListResult.class); - Assertions.assertEquals("soifiyipjxsqw", model.value().get(0).description()); - Assertions.assertEquals("rjb", model.value().get(0).query()); - Assertions.assertEquals("maajrmvdjwzrlo", model.nextLink()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientInnerTests.java deleted file mode 100644 index a10b10fc31a6..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientInnerTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.ClientInner; -import com.azure.resourcemanager.eventgrid.models.ClientCertificateAuthentication; -import com.azure.resourcemanager.eventgrid.models.ClientCertificateValidationScheme; -import com.azure.resourcemanager.eventgrid.models.ClientState; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ClientInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClientInner model = BinaryData.fromString( - "{\"properties\":{\"description\":\"lwhijcoejctbzaq\",\"authenticationName\":\"sycbkbfk\",\"clientCertificateAuthentication\":{\"validationScheme\":\"SubjectMatchesAuthenticationName\",\"allowedThumbprints\":[\"xxppofm\",\"axcfjpgddtocjjx\",\"vpmouexhdzxib\",\"eojnxqbzvddn\"]},\"state\":\"Enabled\",\"attributes\":{\"vuhrhcffcyddgl\":\"dataicbtwnpzao\"},\"provisioningState\":\"Deleted\"},\"id\":\"jqkwpyeicx\",\"name\":\"qciwqvhkhixuigdt\",\"type\":\"pbobjo\"}") - .toObject(ClientInner.class); - Assertions.assertEquals("lwhijcoejctbzaq", model.description()); - Assertions.assertEquals("sycbkbfk", model.authenticationName()); - Assertions.assertEquals(ClientCertificateValidationScheme.SUBJECT_MATCHES_AUTHENTICATION_NAME, - model.clientCertificateAuthentication().validationScheme()); - Assertions.assertEquals("xxppofm", model.clientCertificateAuthentication().allowedThumbprints().get(0)); - Assertions.assertEquals(ClientState.ENABLED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClientInner model = new ClientInner().withDescription("lwhijcoejctbzaq") - .withAuthenticationName("sycbkbfk") - .withClientCertificateAuthentication(new ClientCertificateAuthentication() - .withValidationScheme(ClientCertificateValidationScheme.SUBJECT_MATCHES_AUTHENTICATION_NAME) - .withAllowedThumbprints(Arrays.asList("xxppofm", "axcfjpgddtocjjx", "vpmouexhdzxib", "eojnxqbzvddn"))) - .withState(ClientState.ENABLED) - .withAttributes(mapOf("vuhrhcffcyddgl", "dataicbtwnpzao")); - model = BinaryData.fromObject(model).toObject(ClientInner.class); - Assertions.assertEquals("lwhijcoejctbzaq", model.description()); - Assertions.assertEquals("sycbkbfk", model.authenticationName()); - Assertions.assertEquals(ClientCertificateValidationScheme.SUBJECT_MATCHES_AUTHENTICATION_NAME, - model.clientCertificateAuthentication().validationScheme()); - Assertions.assertEquals("xxppofm", model.clientCertificateAuthentication().allowedThumbprints().get(0)); - Assertions.assertEquals(ClientState.ENABLED, model.state()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientPropertiesTests.java deleted file mode 100644 index a28762f60f69..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientPropertiesTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.ClientProperties; -import com.azure.resourcemanager.eventgrid.models.ClientCertificateAuthentication; -import com.azure.resourcemanager.eventgrid.models.ClientCertificateValidationScheme; -import com.azure.resourcemanager.eventgrid.models.ClientState; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ClientPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClientProperties model = BinaryData.fromString( - "{\"description\":\"m\",\"authenticationName\":\"u\",\"clientCertificateAuthentication\":{\"validationScheme\":\"EmailMatchesAuthenticationName\",\"allowedThumbprints\":[\"z\",\"yvvtpgvdfgio\"]},\"state\":\"Disabled\",\"attributes\":{\"xlefgugnxkrx\":\"datatqxln\",\"tthzrvqd\":\"dataqmi\"},\"provisioningState\":\"Canceled\"}") - .toObject(ClientProperties.class); - Assertions.assertEquals("m", model.description()); - Assertions.assertEquals("u", model.authenticationName()); - Assertions.assertEquals(ClientCertificateValidationScheme.EMAIL_MATCHES_AUTHENTICATION_NAME, - model.clientCertificateAuthentication().validationScheme()); - Assertions.assertEquals("z", model.clientCertificateAuthentication().allowedThumbprints().get(0)); - Assertions.assertEquals(ClientState.DISABLED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClientProperties model = new ClientProperties().withDescription("m") - .withAuthenticationName("u") - .withClientCertificateAuthentication(new ClientCertificateAuthentication() - .withValidationScheme(ClientCertificateValidationScheme.EMAIL_MATCHES_AUTHENTICATION_NAME) - .withAllowedThumbprints(Arrays.asList("z", "yvvtpgvdfgio"))) - .withState(ClientState.DISABLED) - .withAttributes(mapOf("xlefgugnxkrx", "datatqxln", "tthzrvqd", "dataqmi")); - model = BinaryData.fromObject(model).toObject(ClientProperties.class); - Assertions.assertEquals("m", model.description()); - Assertions.assertEquals("u", model.authenticationName()); - Assertions.assertEquals(ClientCertificateValidationScheme.EMAIL_MATCHES_AUTHENTICATION_NAME, - model.clientCertificateAuthentication().validationScheme()); - Assertions.assertEquals("z", model.clientCertificateAuthentication().allowedThumbprints().get(0)); - Assertions.assertEquals(ClientState.DISABLED, model.state()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientsCreateOrUpdateMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientsCreateOrUpdateMockTests.java deleted file mode 100644 index ec8cfdfbf31d..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.Client; -import com.azure.resourcemanager.eventgrid.models.ClientCertificateAuthentication; -import com.azure.resourcemanager.eventgrid.models.ClientCertificateValidationScheme; -import com.azure.resourcemanager.eventgrid.models.ClientState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ClientsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"description\":\"azvdhctmmkosz\",\"authenticationName\":\"blnsntrpcaqk\",\"clientCertificateAuthentication\":{\"validationScheme\":\"IpMatchesAuthenticationName\",\"allowedThumbprints\":[\"fmhklbnld\",\"vcb\",\"hez\",\"quwusq\"]},\"state\":\"Enabled\",\"attributes\":{\"mbjwcolbmxlb\":\"databrruyuuatv\",\"pcpahprzrvxhmtf\":\"dataw\"},\"provisioningState\":\"Succeeded\"},\"id\":\"xzcmjhngxno\",\"name\":\"rxtd\",\"type\":\"sn\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - Client response = manager.clients() - .define("valqjrhuzgfxo") - .withExistingNamespace("ixh", "fratqxmbjroumzz") - .withDescription("pusllywpv") - .withAuthenticationName("otz") - .withClientCertificateAuthentication(new ClientCertificateAuthentication() - .withValidationScheme(ClientCertificateValidationScheme.IP_MATCHES_AUTHENTICATION_NAME) - .withAllowedThumbprints(Arrays.asList("lgry", "qiuasigrows", "c", "equygdjboqgrmtq"))) - .withState(ClientState.DISABLED) - .withAttributes(mapOf("iidisczskoswoqiq", "dataadrmmwiuawvcmjzk", "amnppcce", "datazugamxzkrrcoiis")) - .create(); - - Assertions.assertEquals("azvdhctmmkosz", response.description()); - Assertions.assertEquals("blnsntrpcaqk", response.authenticationName()); - Assertions.assertEquals(ClientCertificateValidationScheme.IP_MATCHES_AUTHENTICATION_NAME, - response.clientCertificateAuthentication().validationScheme()); - Assertions.assertEquals("fmhklbnld", response.clientCertificateAuthentication().allowedThumbprints().get(0)); - Assertions.assertEquals(ClientState.ENABLED, response.state()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientsDeleteMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientsDeleteMockTests.java deleted file mode 100644 index 3240f2dbbd93..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ClientsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.clients().delete("lixqcah", "hxalybxawo", "jpodtbl", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientsGetWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientsGetWithResponseMockTests.java deleted file mode 100644 index 40a3a6fd3ec0..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientsGetWithResponseMockTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.Client; -import com.azure.resourcemanager.eventgrid.models.ClientCertificateValidationScheme; -import com.azure.resourcemanager.eventgrid.models.ClientState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ClientsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"description\":\"youambewr\",\"authenticationName\":\"wmowegmmute\",\"clientCertificateAuthentication\":{\"validationScheme\":\"SubjectMatchesAuthenticationName\",\"allowedThumbprints\":[\"qigijiitnspxlzde\"]},\"state\":\"Disabled\",\"attributes\":{\"n\":\"datajwaiuf\",\"qfrojsydgrhyd\":\"dataaybfu\"},\"provisioningState\":\"Succeeded\"},\"id\":\"wezskie\",\"name\":\"afygzmxieqvds\",\"type\":\"a\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - Client response = manager.clients() - .getWithResponse("wbqerzwxiytxtd", "ukvlb", "ktg", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("youambewr", response.description()); - Assertions.assertEquals("wmowegmmute", response.authenticationName()); - Assertions.assertEquals(ClientCertificateValidationScheme.SUBJECT_MATCHES_AUTHENTICATION_NAME, - response.clientCertificateAuthentication().validationScheme()); - Assertions.assertEquals("qigijiitnspxlzde", - response.clientCertificateAuthentication().allowedThumbprints().get(0)); - Assertions.assertEquals(ClientState.DISABLED, response.state()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientsListByNamespaceMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientsListByNamespaceMockTests.java deleted file mode 100644 index 4577f143bb90..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientsListByNamespaceMockTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.Client; -import com.azure.resourcemanager.eventgrid.models.ClientCertificateValidationScheme; -import com.azure.resourcemanager.eventgrid.models.ClientState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ClientsListByNamespaceMockTests { - @Test - public void testListByNamespace() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"description\":\"oqodkadpp\",\"authenticationName\":\"bngqladywrx\",\"clientCertificateAuthentication\":{\"validationScheme\":\"SubjectMatchesAuthenticationName\",\"allowedThumbprints\":[\"uvvadswzsnu\",\"emlowuowhl\"]},\"state\":\"Enabled\",\"attributes\":{\"gmokzkltrfowt\":\"datarmouvb\"},\"provisioningState\":\"Failed\"},\"id\":\"mvlihcvjdrqcrjid\",\"name\":\"ftukvhd\",\"type\":\"lwyojbfqzdkfnj\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.clients() - .listByNamespace("pkkwj", "jodqhykincn", "emehllizh", 1615748789, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("oqodkadpp", response.iterator().next().description()); - Assertions.assertEquals("bngqladywrx", response.iterator().next().authenticationName()); - Assertions.assertEquals(ClientCertificateValidationScheme.SUBJECT_MATCHES_AUTHENTICATION_NAME, - response.iterator().next().clientCertificateAuthentication().validationScheme()); - Assertions.assertEquals("uvvadswzsnu", - response.iterator().next().clientCertificateAuthentication().allowedThumbprints().get(0)); - Assertions.assertEquals(ClientState.ENABLED, response.iterator().next().state()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientsListResultTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientsListResultTests.java deleted file mode 100644 index 1f92367ee5fe..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ClientsListResultTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.ClientInner; -import com.azure.resourcemanager.eventgrid.models.ClientCertificateAuthentication; -import com.azure.resourcemanager.eventgrid.models.ClientCertificateValidationScheme; -import com.azure.resourcemanager.eventgrid.models.ClientState; -import com.azure.resourcemanager.eventgrid.models.ClientsListResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ClientsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClientsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"description\":\"skanyk\",\"authenticationName\":\"lcuiywgqywgndr\",\"clientCertificateAuthentication\":{\"validationScheme\":\"IpMatchesAuthenticationName\",\"allowedThumbprints\":[\"pphrcgynco\",\"pec\",\"vmmcoofs\"]},\"state\":\"Enabled\",\"attributes\":{\"w\":\"datagbmqjqabcypmiv\"},\"provisioningState\":\"Succeeded\"},\"id\":\"ccfwnfnbacfion\",\"name\":\"ebxetqgtzxdp\",\"type\":\"qbqqwxr\"},{\"properties\":{\"description\":\"al\",\"authenticationName\":\"wsubisnja\",\"clientCertificateAuthentication\":{\"validationScheme\":\"EmailMatchesAuthenticationName\",\"allowedThumbprints\":[\"zscxaqwo\",\"chcbonqvpkvlrxnj\"]},\"state\":\"Enabled\",\"attributes\":{\"enjbdlwtgrhp\":\"datapheoflokeyy\",\"umasxazjpq\":\"datajp\",\"ualhbxxhejj\":\"datae\",\"ynpwlbj\":\"datazvdudgwdslfhotwm\"},\"provisioningState\":\"Failed\"},\"id\":\"cftadeh\",\"name\":\"nltyfsoppusuesnz\",\"type\":\"dejbavo\"}],\"nextLink\":\"zdmohctbqvu\"}") - .toObject(ClientsListResult.class); - Assertions.assertEquals("skanyk", model.value().get(0).description()); - Assertions.assertEquals("lcuiywgqywgndr", model.value().get(0).authenticationName()); - Assertions.assertEquals(ClientCertificateValidationScheme.IP_MATCHES_AUTHENTICATION_NAME, - model.value().get(0).clientCertificateAuthentication().validationScheme()); - Assertions.assertEquals("pphrcgynco", - model.value().get(0).clientCertificateAuthentication().allowedThumbprints().get(0)); - Assertions.assertEquals(ClientState.ENABLED, model.value().get(0).state()); - Assertions.assertEquals("zdmohctbqvu", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClientsListResult model - = new ClientsListResult() - .withValue( - Arrays - .asList( - new ClientInner().withDescription("skanyk") - .withAuthenticationName("lcuiywgqywgndr") - .withClientCertificateAuthentication(new ClientCertificateAuthentication() - .withValidationScheme( - ClientCertificateValidationScheme.IP_MATCHES_AUTHENTICATION_NAME) - .withAllowedThumbprints(Arrays.asList("pphrcgynco", "pec", "vmmcoofs"))) - .withState(ClientState.ENABLED) - .withAttributes(mapOf("w", "datagbmqjqabcypmiv")), - new ClientInner().withDescription("al") - .withAuthenticationName("wsubisnja") - .withClientCertificateAuthentication(new ClientCertificateAuthentication() - .withValidationScheme( - ClientCertificateValidationScheme.EMAIL_MATCHES_AUTHENTICATION_NAME) - .withAllowedThumbprints(Arrays.asList("zscxaqwo", "chcbonqvpkvlrxnj"))) - .withState(ClientState.ENABLED) - .withAttributes(mapOf("enjbdlwtgrhp", "datapheoflokeyy", "umasxazjpq", "datajp", - "ualhbxxhejj", "datae", "ynpwlbj", "datazvdudgwdslfhotwm")))) - .withNextLink("zdmohctbqvu"); - model = BinaryData.fromObject(model).toObject(ClientsListResult.class); - Assertions.assertEquals("skanyk", model.value().get(0).description()); - Assertions.assertEquals("lcuiywgqywgndr", model.value().get(0).authenticationName()); - Assertions.assertEquals(ClientCertificateValidationScheme.IP_MATCHES_AUTHENTICATION_NAME, - model.value().get(0).clientCertificateAuthentication().validationScheme()); - Assertions.assertEquals("pphrcgynco", - model.value().get(0).clientCertificateAuthentication().allowedThumbprints().get(0)); - Assertions.assertEquals(ClientState.ENABLED, model.value().get(0).state()); - Assertions.assertEquals("zdmohctbqvu", model.nextLink()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ConnectionStateTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ConnectionStateTests.java deleted file mode 100644 index f6835f9ac858..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ConnectionStateTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.ConnectionState; -import com.azure.resourcemanager.eventgrid.models.PersistedConnectionStatus; -import org.junit.jupiter.api.Assertions; - -public final class ConnectionStateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectionState model - = BinaryData.fromString("{\"status\":\"Pending\",\"description\":\"hxw\",\"actionsRequired\":\"tyq\"}") - .toObject(ConnectionState.class); - Assertions.assertEquals(PersistedConnectionStatus.PENDING, model.status()); - Assertions.assertEquals("hxw", model.description()); - Assertions.assertEquals("tyq", model.actionsRequired()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectionState model = new ConnectionState().withStatus(PersistedConnectionStatus.PENDING) - .withDescription("hxw") - .withActionsRequired("tyq"); - model = BinaryData.fromObject(model).toObject(ConnectionState.class); - Assertions.assertEquals(PersistedConnectionStatus.PENDING, model.status()); - Assertions.assertEquals("hxw", model.description()); - Assertions.assertEquals("tyq", model.actionsRequired()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/CustomDomainConfigurationTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/CustomDomainConfigurationTests.java deleted file mode 100644 index 743957d23140..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/CustomDomainConfigurationTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.CustomDomainConfiguration; -import com.azure.resourcemanager.eventgrid.models.CustomDomainIdentity; -import com.azure.resourcemanager.eventgrid.models.CustomDomainIdentityType; -import com.azure.resourcemanager.eventgrid.models.CustomDomainValidationState; -import org.junit.jupiter.api.Assertions; - -public final class CustomDomainConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomDomainConfiguration model = BinaryData.fromString( - "{\"fullyQualifiedDomainName\":\"jjklff\",\"validationState\":\"Approved\",\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"gzrf\"},\"certificateUrl\":\"eyebizikayuhql\",\"expectedTxtRecordName\":\"bs\",\"expectedTxtRecordValue\":\"bqwrvtldgm\"}") - .toObject(CustomDomainConfiguration.class); - Assertions.assertEquals("jjklff", model.fullyQualifiedDomainName()); - Assertions.assertEquals(CustomDomainValidationState.APPROVED, model.validationState()); - Assertions.assertEquals(CustomDomainIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("gzrf", model.identity().userAssignedIdentity()); - Assertions.assertEquals("eyebizikayuhql", model.certificateUrl()); - Assertions.assertEquals("bs", model.expectedTxtRecordName()); - Assertions.assertEquals("bqwrvtldgm", model.expectedTxtRecordValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomDomainConfiguration model = new CustomDomainConfiguration().withFullyQualifiedDomainName("jjklff") - .withValidationState(CustomDomainValidationState.APPROVED) - .withIdentity(new CustomDomainIdentity().withType(CustomDomainIdentityType.USER_ASSIGNED) - .withUserAssignedIdentity("gzrf")) - .withCertificateUrl("eyebizikayuhql") - .withExpectedTxtRecordName("bs") - .withExpectedTxtRecordValue("bqwrvtldgm"); - model = BinaryData.fromObject(model).toObject(CustomDomainConfiguration.class); - Assertions.assertEquals("jjklff", model.fullyQualifiedDomainName()); - Assertions.assertEquals(CustomDomainValidationState.APPROVED, model.validationState()); - Assertions.assertEquals(CustomDomainIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("gzrf", model.identity().userAssignedIdentity()); - Assertions.assertEquals("eyebizikayuhql", model.certificateUrl()); - Assertions.assertEquals("bs", model.expectedTxtRecordName()); - Assertions.assertEquals("bqwrvtldgm", model.expectedTxtRecordValue()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/CustomDomainIdentityTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/CustomDomainIdentityTests.java deleted file mode 100644 index 80c11ef6ff96..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/CustomDomainIdentityTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.CustomDomainIdentity; -import com.azure.resourcemanager.eventgrid.models.CustomDomainIdentityType; -import org.junit.jupiter.api.Assertions; - -public final class CustomDomainIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomDomainIdentity model - = BinaryData.fromString("{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"mpipaslthaqfxs\"}") - .toObject(CustomDomainIdentity.class); - Assertions.assertEquals(CustomDomainIdentityType.USER_ASSIGNED, model.type()); - Assertions.assertEquals("mpipaslthaqfxs", model.userAssignedIdentity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomDomainIdentity model = new CustomDomainIdentity().withType(CustomDomainIdentityType.USER_ASSIGNED) - .withUserAssignedIdentity("mpipaslthaqfxs"); - model = BinaryData.fromObject(model).toObject(CustomDomainIdentity.class); - Assertions.assertEquals(CustomDomainIdentityType.USER_ASSIGNED, model.type()); - Assertions.assertEquals("mpipaslthaqfxs", model.userAssignedIdentity()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/CustomDomainOwnershipValidationResultInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/CustomDomainOwnershipValidationResultInnerTests.java deleted file mode 100644 index bfb7b2358ec6..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/CustomDomainOwnershipValidationResultInnerTests.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.CustomDomainOwnershipValidationResultInner; -import com.azure.resourcemanager.eventgrid.models.CustomDomainConfiguration; -import com.azure.resourcemanager.eventgrid.models.CustomDomainIdentity; -import com.azure.resourcemanager.eventgrid.models.CustomDomainIdentityType; -import com.azure.resourcemanager.eventgrid.models.CustomDomainValidationState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class CustomDomainOwnershipValidationResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomDomainOwnershipValidationResultInner model = BinaryData.fromString( - "{\"customDomainsForTopicsConfiguration\":[{\"fullyQualifiedDomainName\":\"qllizstac\",\"validationState\":\"ErrorRetrievingDnsRecord\",\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentity\":\"ftkwq\"},\"certificateUrl\":\"pmvssehaep\",\"expectedTxtRecordName\":\"mcxtczhu\",\"expectedTxtRecordValue\":\"uknijduyye\"},{\"fullyQualifiedDomainName\":\"pydjfboc\",\"validationState\":\"Pending\",\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"tywikd\"},\"certificateUrl\":\"lakuflgbhgauacd\",\"expectedTxtRecordName\":\"mxu\",\"expectedTxtRecordValue\":\"sryjqgdkfno\"}],\"customDomainsForTopicSpacesConfiguration\":[{\"fullyQualifiedDomainName\":\"oqbvjhvefgwbmqj\",\"validationState\":\"Approved\",\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentity\":\"ay\"},\"certificateUrl\":\"b\",\"expectedTxtRecordName\":\"pzealbmqkyojw\",\"expectedTxtRecordValue\":\"fkmbtsuahxsgxj\"},{\"fullyQualifiedDomainName\":\"mmzrrscub\",\"validationState\":\"Approved\",\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentity\":\"xqw\"},\"certificateUrl\":\"iffjxcjrm\",\"expectedTxtRecordName\":\"abwibvjogjo\",\"expectedTxtRecordValue\":\"cyefoyzbamwine\"},{\"fullyQualifiedDomainName\":\"fvfkak\",\"validationState\":\"ErrorRetrievingDnsRecord\",\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"vboclzhzjk\"},\"certificateUrl\":\"uxgvttxpnr\",\"expectedTxtRecordName\":\"zaamrdixtrekid\",\"expectedTxtRecordValue\":\"yskbruff\"},{\"fullyQualifiedDomainName\":\"l\",\"validationState\":\"ErrorRetrievingDnsRecord\",\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"lxhrp\"},\"certificateUrl\":\"vmblcouqe\",\"expectedTxtRecordName\":\"hbcdsziry\",\"expectedTxtRecordValue\":\"ndo\"}]}") - .toObject(CustomDomainOwnershipValidationResultInner.class); - Assertions.assertEquals("qllizstac", - model.customDomainsForTopicsConfiguration().get(0).fullyQualifiedDomainName()); - Assertions.assertEquals(CustomDomainValidationState.ERROR_RETRIEVING_DNS_RECORD, - model.customDomainsForTopicsConfiguration().get(0).validationState()); - Assertions.assertEquals(CustomDomainIdentityType.SYSTEM_ASSIGNED, - model.customDomainsForTopicsConfiguration().get(0).identity().type()); - Assertions.assertEquals("ftkwq", - model.customDomainsForTopicsConfiguration().get(0).identity().userAssignedIdentity()); - Assertions.assertEquals("pmvssehaep", model.customDomainsForTopicsConfiguration().get(0).certificateUrl()); - Assertions.assertEquals("mcxtczhu", model.customDomainsForTopicsConfiguration().get(0).expectedTxtRecordName()); - Assertions.assertEquals("uknijduyye", - model.customDomainsForTopicsConfiguration().get(0).expectedTxtRecordValue()); - Assertions.assertEquals("oqbvjhvefgwbmqj", - model.customDomainsForTopicSpacesConfiguration().get(0).fullyQualifiedDomainName()); - Assertions.assertEquals(CustomDomainValidationState.APPROVED, - model.customDomainsForTopicSpacesConfiguration().get(0).validationState()); - Assertions.assertEquals(CustomDomainIdentityType.SYSTEM_ASSIGNED, - model.customDomainsForTopicSpacesConfiguration().get(0).identity().type()); - Assertions.assertEquals("ay", - model.customDomainsForTopicSpacesConfiguration().get(0).identity().userAssignedIdentity()); - Assertions.assertEquals("b", model.customDomainsForTopicSpacesConfiguration().get(0).certificateUrl()); - Assertions.assertEquals("pzealbmqkyojw", - model.customDomainsForTopicSpacesConfiguration().get(0).expectedTxtRecordName()); - Assertions.assertEquals("fkmbtsuahxsgxj", - model.customDomainsForTopicSpacesConfiguration().get(0).expectedTxtRecordValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomDomainOwnershipValidationResultInner model = new CustomDomainOwnershipValidationResultInner() - .withCustomDomainsForTopicsConfiguration(Arrays.asList( - new CustomDomainConfiguration().withFullyQualifiedDomainName("qllizstac") - .withValidationState(CustomDomainValidationState.ERROR_RETRIEVING_DNS_RECORD) - .withIdentity(new CustomDomainIdentity().withType(CustomDomainIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentity("ftkwq")) - .withCertificateUrl("pmvssehaep") - .withExpectedTxtRecordName("mcxtczhu") - .withExpectedTxtRecordValue("uknijduyye"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("pydjfboc") - .withValidationState(CustomDomainValidationState.PENDING) - .withIdentity(new CustomDomainIdentity().withType(CustomDomainIdentityType.USER_ASSIGNED) - .withUserAssignedIdentity("tywikd")) - .withCertificateUrl("lakuflgbhgauacd") - .withExpectedTxtRecordName("mxu") - .withExpectedTxtRecordValue("sryjqgdkfno"))) - .withCustomDomainsForTopicSpacesConfiguration(Arrays.asList( - new CustomDomainConfiguration().withFullyQualifiedDomainName("oqbvjhvefgwbmqj") - .withValidationState(CustomDomainValidationState.APPROVED) - .withIdentity(new CustomDomainIdentity().withType(CustomDomainIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentity("ay")) - .withCertificateUrl("b") - .withExpectedTxtRecordName("pzealbmqkyojw") - .withExpectedTxtRecordValue("fkmbtsuahxsgxj"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("mmzrrscub") - .withValidationState(CustomDomainValidationState.APPROVED) - .withIdentity(new CustomDomainIdentity().withType(CustomDomainIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentity("xqw")) - .withCertificateUrl("iffjxcjrm") - .withExpectedTxtRecordName("abwibvjogjo") - .withExpectedTxtRecordValue("cyefoyzbamwine"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("fvfkak") - .withValidationState(CustomDomainValidationState.ERROR_RETRIEVING_DNS_RECORD) - .withIdentity(new CustomDomainIdentity().withType(CustomDomainIdentityType.USER_ASSIGNED) - .withUserAssignedIdentity("vboclzhzjk")) - .withCertificateUrl("uxgvttxpnr") - .withExpectedTxtRecordName("zaamrdixtrekid") - .withExpectedTxtRecordValue("yskbruff"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("l") - .withValidationState(CustomDomainValidationState.ERROR_RETRIEVING_DNS_RECORD) - .withIdentity(new CustomDomainIdentity().withType(CustomDomainIdentityType.USER_ASSIGNED) - .withUserAssignedIdentity("lxhrp")) - .withCertificateUrl("vmblcouqe") - .withExpectedTxtRecordName("hbcdsziry") - .withExpectedTxtRecordValue("ndo"))); - model = BinaryData.fromObject(model).toObject(CustomDomainOwnershipValidationResultInner.class); - Assertions.assertEquals("qllizstac", - model.customDomainsForTopicsConfiguration().get(0).fullyQualifiedDomainName()); - Assertions.assertEquals(CustomDomainValidationState.ERROR_RETRIEVING_DNS_RECORD, - model.customDomainsForTopicsConfiguration().get(0).validationState()); - Assertions.assertEquals(CustomDomainIdentityType.SYSTEM_ASSIGNED, - model.customDomainsForTopicsConfiguration().get(0).identity().type()); - Assertions.assertEquals("ftkwq", - model.customDomainsForTopicsConfiguration().get(0).identity().userAssignedIdentity()); - Assertions.assertEquals("pmvssehaep", model.customDomainsForTopicsConfiguration().get(0).certificateUrl()); - Assertions.assertEquals("mcxtczhu", model.customDomainsForTopicsConfiguration().get(0).expectedTxtRecordName()); - Assertions.assertEquals("uknijduyye", - model.customDomainsForTopicsConfiguration().get(0).expectedTxtRecordValue()); - Assertions.assertEquals("oqbvjhvefgwbmqj", - model.customDomainsForTopicSpacesConfiguration().get(0).fullyQualifiedDomainName()); - Assertions.assertEquals(CustomDomainValidationState.APPROVED, - model.customDomainsForTopicSpacesConfiguration().get(0).validationState()); - Assertions.assertEquals(CustomDomainIdentityType.SYSTEM_ASSIGNED, - model.customDomainsForTopicSpacesConfiguration().get(0).identity().type()); - Assertions.assertEquals("ay", - model.customDomainsForTopicSpacesConfiguration().get(0).identity().userAssignedIdentity()); - Assertions.assertEquals("b", model.customDomainsForTopicSpacesConfiguration().get(0).certificateUrl()); - Assertions.assertEquals("pzealbmqkyojw", - model.customDomainsForTopicSpacesConfiguration().get(0).expectedTxtRecordName()); - Assertions.assertEquals("fkmbtsuahxsgxj", - model.customDomainsForTopicSpacesConfiguration().get(0).expectedTxtRecordValue()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DeadLetterDestinationTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DeadLetterDestinationTests.java deleted file mode 100644 index b1193687817e..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DeadLetterDestinationTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.DeadLetterDestination; - -public final class DeadLetterDestinationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeadLetterDestination model = BinaryData.fromString("{\"endpointType\":\"DeadLetterDestination\"}") - .toObject(DeadLetterDestination.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeadLetterDestination model = new DeadLetterDestination(); - model = BinaryData.fromObject(model).toObject(DeadLetterDestination.class); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DeadLetterWithResourceIdentityTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DeadLetterWithResourceIdentityTests.java deleted file mode 100644 index c3f68a01cb87..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DeadLetterWithResourceIdentityTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.DeadLetterDestination; -import com.azure.resourcemanager.eventgrid.models.DeadLetterWithResourceIdentity; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionIdentity; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionIdentityType; -import org.junit.jupiter.api.Assertions; - -public final class DeadLetterWithResourceIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeadLetterWithResourceIdentity model = BinaryData.fromString( - "{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"gwq\"},\"deadLetterDestination\":{\"endpointType\":\"DeadLetterDestination\"}}") - .toObject(DeadLetterWithResourceIdentity.class); - Assertions.assertEquals(EventSubscriptionIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("gwq", model.identity().userAssignedIdentity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeadLetterWithResourceIdentity model = new DeadLetterWithResourceIdentity() - .withIdentity(new EventSubscriptionIdentity().withType(EventSubscriptionIdentityType.USER_ASSIGNED) - .withUserAssignedIdentity("gwq")) - .withDeadLetterDestination(new DeadLetterDestination()); - model = BinaryData.fromObject(model).toObject(DeadLetterWithResourceIdentity.class); - Assertions.assertEquals(EventSubscriptionIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("gwq", model.identity().userAssignedIdentity()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DeliveryAttributeListResultInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DeliveryAttributeListResultInnerTests.java deleted file mode 100644 index 52063bb5d549..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DeliveryAttributeListResultInnerTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.DeliveryAttributeListResultInner; -import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeMapping; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DeliveryAttributeListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeliveryAttributeListResultInner model = BinaryData.fromString( - "{\"value\":[{\"type\":\"DeliveryAttributeMapping\",\"name\":\"dfznudaodv\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"bncblylpstdbhhx\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"zdzucerscdntnevf\"}]}") - .toObject(DeliveryAttributeListResultInner.class); - Assertions.assertEquals("dfznudaodv", model.value().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeliveryAttributeListResultInner model = new DeliveryAttributeListResultInner() - .withValue(Arrays.asList(new DeliveryAttributeMapping().withName("dfznudaodv"), - new DeliveryAttributeMapping().withName("bncblylpstdbhhx"), - new DeliveryAttributeMapping().withName("zdzucerscdntnevf"))); - model = BinaryData.fromObject(model).toObject(DeliveryAttributeListResultInner.class); - Assertions.assertEquals("dfznudaodv", model.value().get(0).name()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DeliveryAttributeMappingTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DeliveryAttributeMappingTests.java deleted file mode 100644 index 56d4870ee305..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DeliveryAttributeMappingTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeMapping; -import org.junit.jupiter.api.Assertions; - -public final class DeliveryAttributeMappingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeliveryAttributeMapping model - = BinaryData.fromString("{\"type\":\"DeliveryAttributeMapping\",\"name\":\"jmygtdsslswtmwer\"}") - .toObject(DeliveryAttributeMapping.class); - Assertions.assertEquals("jmygtdsslswtmwer", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeliveryAttributeMapping model = new DeliveryAttributeMapping().withName("jmygtdsslswtmwer"); - model = BinaryData.fromObject(model).toObject(DeliveryAttributeMapping.class); - Assertions.assertEquals("jmygtdsslswtmwer", model.name()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DeliveryConfigurationTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DeliveryConfigurationTests.java deleted file mode 100644 index 0ac71218afdd..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DeliveryConfigurationTests.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.DeadLetterDestination; -import com.azure.resourcemanager.eventgrid.models.DeadLetterWithResourceIdentity; -import com.azure.resourcemanager.eventgrid.models.DeliveryConfiguration; -import com.azure.resourcemanager.eventgrid.models.DeliveryMode; -import com.azure.resourcemanager.eventgrid.models.DeliveryWithResourceIdentity; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionDestination; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionIdentity; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionIdentityType; -import com.azure.resourcemanager.eventgrid.models.PushInfo; -import com.azure.resourcemanager.eventgrid.models.QueueInfo; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class DeliveryConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeliveryConfiguration model = BinaryData.fromString( - "{\"deliveryMode\":\"Queue\",\"queue\":{\"receiveLockDurationInSeconds\":1447033048,\"maxDeliveryCount\":2116821034,\"deadLetterDestinationWithResourceIdentity\":{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"o\"},\"deadLetterDestination\":{\"endpointType\":\"DeadLetterDestination\"}},\"eventTimeToLive\":\"PT227H49M50S\"},\"push\":{\"maxDeliveryCount\":745673634,\"eventTimeToLive\":\"ohfwds\",\"deadLetterDestinationWithResourceIdentity\":{\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentity\":\"utiiswacf\"},\"deadLetterDestination\":{\"endpointType\":\"DeadLetterDestination\"}},\"deliveryWithResourceIdentity\":{\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentity\":\"wkfvhqcrailvp\"},\"destination\":{\"endpointType\":\"EventSubscriptionDestination\"}},\"destination\":{\"endpointType\":\"EventSubscriptionDestination\"}}}") - .toObject(DeliveryConfiguration.class); - Assertions.assertEquals(DeliveryMode.QUEUE, model.deliveryMode()); - Assertions.assertEquals(1447033048, model.queue().receiveLockDurationInSeconds()); - Assertions.assertEquals(2116821034, model.queue().maxDeliveryCount()); - Assertions.assertEquals(EventSubscriptionIdentityType.USER_ASSIGNED, - model.queue().deadLetterDestinationWithResourceIdentity().identity().type()); - Assertions.assertEquals("o", - model.queue().deadLetterDestinationWithResourceIdentity().identity().userAssignedIdentity()); - Assertions.assertEquals(Duration.parse("PT227H49M50S"), model.queue().eventTimeToLive()); - Assertions.assertEquals(745673634, model.push().maxDeliveryCount()); - Assertions.assertEquals("ohfwds", model.push().eventTimeToLive()); - Assertions.assertEquals(EventSubscriptionIdentityType.SYSTEM_ASSIGNED, - model.push().deadLetterDestinationWithResourceIdentity().identity().type()); - Assertions.assertEquals("utiiswacf", - model.push().deadLetterDestinationWithResourceIdentity().identity().userAssignedIdentity()); - Assertions.assertEquals(EventSubscriptionIdentityType.SYSTEM_ASSIGNED, - model.push().deliveryWithResourceIdentity().identity().type()); - Assertions.assertEquals("wkfvhqcrailvp", - model.push().deliveryWithResourceIdentity().identity().userAssignedIdentity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeliveryConfiguration model - = new DeliveryConfiguration().withDeliveryMode(DeliveryMode.QUEUE) - .withQueue(new QueueInfo().withReceiveLockDurationInSeconds(1447033048) - .withMaxDeliveryCount(2116821034) - .withDeadLetterDestinationWithResourceIdentity(new DeadLetterWithResourceIdentity() - .withIdentity( - new EventSubscriptionIdentity().withType(EventSubscriptionIdentityType.USER_ASSIGNED) - .withUserAssignedIdentity("o")) - .withDeadLetterDestination(new DeadLetterDestination())) - .withEventTimeToLive(Duration.parse("PT227H49M50S"))) - .withPush(new PushInfo().withMaxDeliveryCount(745673634) - .withEventTimeToLive("ohfwds") - .withDeadLetterDestinationWithResourceIdentity(new DeadLetterWithResourceIdentity() - .withIdentity( - new EventSubscriptionIdentity().withType(EventSubscriptionIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentity("utiiswacf")) - .withDeadLetterDestination(new DeadLetterDestination())) - .withDeliveryWithResourceIdentity(new DeliveryWithResourceIdentity() - .withIdentity( - new EventSubscriptionIdentity().withType(EventSubscriptionIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentity("wkfvhqcrailvp")) - .withDestination(new EventSubscriptionDestination())) - .withDestination(new EventSubscriptionDestination())); - model = BinaryData.fromObject(model).toObject(DeliveryConfiguration.class); - Assertions.assertEquals(DeliveryMode.QUEUE, model.deliveryMode()); - Assertions.assertEquals(1447033048, model.queue().receiveLockDurationInSeconds()); - Assertions.assertEquals(2116821034, model.queue().maxDeliveryCount()); - Assertions.assertEquals(EventSubscriptionIdentityType.USER_ASSIGNED, - model.queue().deadLetterDestinationWithResourceIdentity().identity().type()); - Assertions.assertEquals("o", - model.queue().deadLetterDestinationWithResourceIdentity().identity().userAssignedIdentity()); - Assertions.assertEquals(Duration.parse("PT227H49M50S"), model.queue().eventTimeToLive()); - Assertions.assertEquals(745673634, model.push().maxDeliveryCount()); - Assertions.assertEquals("ohfwds", model.push().eventTimeToLive()); - Assertions.assertEquals(EventSubscriptionIdentityType.SYSTEM_ASSIGNED, - model.push().deadLetterDestinationWithResourceIdentity().identity().type()); - Assertions.assertEquals("utiiswacf", - model.push().deadLetterDestinationWithResourceIdentity().identity().userAssignedIdentity()); - Assertions.assertEquals(EventSubscriptionIdentityType.SYSTEM_ASSIGNED, - model.push().deliveryWithResourceIdentity().identity().type()); - Assertions.assertEquals("wkfvhqcrailvp", - model.push().deliveryWithResourceIdentity().identity().userAssignedIdentity()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DeliveryWithResourceIdentityTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DeliveryWithResourceIdentityTests.java deleted file mode 100644 index ded50b7c4b6e..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DeliveryWithResourceIdentityTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.DeliveryWithResourceIdentity; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionDestination; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionIdentity; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionIdentityType; -import org.junit.jupiter.api.Assertions; - -public final class DeliveryWithResourceIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeliveryWithResourceIdentity model = BinaryData.fromString( - "{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"egrpkhj\"},\"destination\":{\"endpointType\":\"EventSubscriptionDestination\"}}") - .toObject(DeliveryWithResourceIdentity.class); - Assertions.assertEquals(EventSubscriptionIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("egrpkhj", model.identity().userAssignedIdentity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeliveryWithResourceIdentity model = new DeliveryWithResourceIdentity() - .withIdentity(new EventSubscriptionIdentity().withType(EventSubscriptionIdentityType.USER_ASSIGNED) - .withUserAssignedIdentity("egrpkhj")) - .withDestination(new EventSubscriptionDestination()); - model = BinaryData.fromObject(model).toObject(DeliveryWithResourceIdentity.class); - Assertions.assertEquals(EventSubscriptionIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("egrpkhj", model.identity().userAssignedIdentity()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainEventSubscriptionsDeleteMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainEventSubscriptionsDeleteMockTests.java deleted file mode 100644 index d96fec5a78e3..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainEventSubscriptionsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DomainEventSubscriptionsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.domainEventSubscriptions().delete("fiv", "okpysthhzagj", "wyy", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainEventSubscriptionsGetDeliveryAttributesWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainEventSubscriptionsGetDeliveryAttributesWithResponseMockTests.java deleted file mode 100644 index 71541d26bb07..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainEventSubscriptionsGetDeliveryAttributesWithResponseMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeListResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DomainEventSubscriptionsGetDeliveryAttributesWithResponseMockTests { - @Test - public void testGetDeliveryAttributesWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"type\":\"DeliveryAttributeMapping\",\"name\":\"wvif\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"kecifhocjxwklo\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - DeliveryAttributeListResult response = manager.domainEventSubscriptions() - .getDeliveryAttributesWithResponse("gd", "tbfcm", "rftsjcwjjxs", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("wvif", response.value().get(0).name()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainEventSubscriptionsGetFullUrlWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainEventSubscriptionsGetFullUrlWithResponseMockTests.java deleted file mode 100644 index ef059d3387cb..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainEventSubscriptionsGetFullUrlWithResponseMockTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFullUrl; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DomainEventSubscriptionsGetFullUrlWithResponseMockTests { - @Test - public void testGetFullUrlWithResponse() throws Exception { - String responseStr = "{\"endpointUrl\":\"xtminklogxsvtzar\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - EventSubscriptionFullUrl response = manager.domainEventSubscriptions() - .getFullUrlWithResponse("lhgenuzejgvkv", "baqszllrzlsmmd", "gmihzpimcqr", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("xtminklogxsvtzar", response.endpointUrl()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainInnerTests.java deleted file mode 100644 index dfffec6a62bc..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainInnerTests.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.DomainInner; -import com.azure.resourcemanager.eventgrid.models.DataResidencyBoundary; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.InboundIpRule; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import com.azure.resourcemanager.eventgrid.models.InputSchema; -import com.azure.resourcemanager.eventgrid.models.InputSchemaMapping; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import com.azure.resourcemanager.eventgrid.models.UserIdentityProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DomainInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DomainInner model = BinaryData.fromString( - "{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"vo\"},\"groupIds\":[\"jjugwdkcglhslaz\",\"dyggdtjixhbku\",\"fqweykhmene\"],\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"fwhybcibvy\",\"actionsRequired\":\"c\"},\"provisioningState\":\"Canceled\"},\"id\":\"ynnaam\",\"name\":\"ectehf\",\"type\":\"qsc\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"vhezrkgqhcj\"},\"groupIds\":[\"o\",\"gm\",\"qsl\",\"yyvxyqjpkcattpn\"],\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"czsqpjhvm\",\"actionsRequired\":\"jvnysounqe\"},\"provisioningState\":\"Deleting\"},\"id\":\"oaeupfhyhltrpmo\",\"name\":\"jmcmatuokthfu\",\"type\":\"uaodsfcpk\"}],\"provisioningState\":\"Updating\",\"minimumTlsVersionAllowed\":\"1.1\",\"endpoint\":\"ozmyzydagfu\",\"inputSchema\":\"CustomEventSchema\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"kiiuxhqyudxor\":{\"description\":\"kktwhrdxw\",\"displayName\":\"wqsmbsur\",\"documentationUrl\":\"imoryocfsfksym\",\"dataSchemaUrl\":\"ys\"},\"iqzbq\":{\"description\":\"nbpoczvyifqrvkdv\",\"displayName\":\"llr\",\"documentationUrl\":\"vdfwatkpn\",\"dataSchemaUrl\":\"lexxbczwtru\"},\"iwkuofos\":{\"description\":\"sovmyokacspkwl\",\"displayName\":\"dobpxjmflbvvn\",\"documentationUrl\":\"rkcciwwzjuqk\",\"dataSchemaUrl\":\"sa\"}}},\"inputSchemaMapping\":{\"inputSchemaMappingType\":\"InputSchemaMapping\"},\"metricResourceId\":\"sauuimj\",\"publicNetworkAccess\":\"Disabled\",\"inboundIpRules\":[{\"ipMask\":\"uugidyjrrfby\",\"action\":\"Allow\"},{\"ipMask\":\"e\",\"action\":\"Allow\"}],\"disableLocalAuth\":false,\"autoCreateTopicWithFirstSubscription\":true,\"autoDeleteTopicWithLastSubscription\":true,\"dataResidencyBoundary\":\"WithinGeopair\"},\"identity\":{\"type\":\"SystemAssigned\",\"principalId\":\"kevle\",\"tenantId\":\"zfbuhf\",\"userAssignedIdentities\":{\"v\":{\"principalId\":\"x\",\"clientId\":\"feiithlvmez\"},\"xxjnspydptk\":{\"principalId\":\"xmzsbbzogg\",\"clientId\":\"rxwburv\"},\"cipazyxoegukgjnp\":{\"principalId\":\"nkoukn\",\"clientId\":\"dwtiukbldngkp\"}}},\"location\":\"cgygev\",\"tags\":{\"ydnfyhxdeoejz\":\"typmrbpizcdrqjsd\",\"jttgzf\":\"cwif\",\"khaj\":\"ishc\",\"p\":\"eyeam\"},\"id\":\"agalpbuxwgipwhon\",\"name\":\"wkgshwa\",\"type\":\"kix\"}") - .toObject(DomainInner.class); - Assertions.assertEquals("cgygev", model.location()); - Assertions.assertEquals("typmrbpizcdrqjsd", model.tags().get("ydnfyhxdeoejz")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("kevle", model.identity().principalId()); - Assertions.assertEquals("zfbuhf", model.identity().tenantId()); - Assertions.assertEquals("x", model.identity().userAssignedIdentities().get("v").principalId()); - Assertions.assertEquals("feiithlvmez", model.identity().userAssignedIdentities().get("v").clientId()); - Assertions.assertEquals(TlsVersion.ONE_ONE, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(InputSchema.CUSTOM_EVENT_SCHEMA, model.inputSchema()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("kktwhrdxw", - model.eventTypeInfo().inlineEventTypes().get("kiiuxhqyudxor").description()); - Assertions.assertEquals("wqsmbsur", - model.eventTypeInfo().inlineEventTypes().get("kiiuxhqyudxor").displayName()); - Assertions.assertEquals("imoryocfsfksym", - model.eventTypeInfo().inlineEventTypes().get("kiiuxhqyudxor").documentationUrl()); - Assertions.assertEquals("ys", model.eventTypeInfo().inlineEventTypes().get("kiiuxhqyudxor").dataSchemaUrl()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("uugidyjrrfby", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(false, model.disableLocalAuth()); - Assertions.assertEquals(true, model.autoCreateTopicWithFirstSubscription()); - Assertions.assertEquals(true, model.autoDeleteTopicWithLastSubscription()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_GEOPAIR, model.dataResidencyBoundary()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DomainInner model = new DomainInner().withLocation("cgygev") - .withTags(mapOf("ydnfyhxdeoejz", "typmrbpizcdrqjsd", "jttgzf", "cwif", "khaj", "ishc", "p", "eyeam")) - .withIdentity(new IdentityInfo().withType(IdentityType.SYSTEM_ASSIGNED) - .withPrincipalId("kevle") - .withTenantId("zfbuhf") - .withUserAssignedIdentities(mapOf("v", - new UserIdentityProperties().withPrincipalId("x").withClientId("feiithlvmez"), "xxjnspydptk", - new UserIdentityProperties().withPrincipalId("xmzsbbzogg").withClientId("rxwburv"), - "cipazyxoegukgjnp", - new UserIdentityProperties().withPrincipalId("nkoukn").withClientId("dwtiukbldngkp")))) - .withMinimumTlsVersionAllowed(TlsVersion.ONE_ONE) - .withInputSchema(InputSchema.CUSTOM_EVENT_SCHEMA) - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("kiiuxhqyudxor", - new InlineEventProperties().withDescription("kktwhrdxw") - .withDisplayName("wqsmbsur") - .withDocumentationUrl("imoryocfsfksym") - .withDataSchemaUrl("ys"), - "iqzbq", - new InlineEventProperties().withDescription("nbpoczvyifqrvkdv") - .withDisplayName("llr") - .withDocumentationUrl("vdfwatkpn") - .withDataSchemaUrl("lexxbczwtru"), - "iwkuofos", - new InlineEventProperties().withDescription("sovmyokacspkwl") - .withDisplayName("dobpxjmflbvvn") - .withDocumentationUrl("rkcciwwzjuqk") - .withDataSchemaUrl("sa")))) - .withInputSchemaMapping(new InputSchemaMapping()) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) - .withInboundIpRules( - Arrays.asList(new InboundIpRule().withIpMask("uugidyjrrfby").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("e").withAction(IpActionType.ALLOW))) - .withDisableLocalAuth(false) - .withAutoCreateTopicWithFirstSubscription(true) - .withAutoDeleteTopicWithLastSubscription(true) - .withDataResidencyBoundary(DataResidencyBoundary.WITHIN_GEOPAIR); - model = BinaryData.fromObject(model).toObject(DomainInner.class); - Assertions.assertEquals("cgygev", model.location()); - Assertions.assertEquals("typmrbpizcdrqjsd", model.tags().get("ydnfyhxdeoejz")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("kevle", model.identity().principalId()); - Assertions.assertEquals("zfbuhf", model.identity().tenantId()); - Assertions.assertEquals("x", model.identity().userAssignedIdentities().get("v").principalId()); - Assertions.assertEquals("feiithlvmez", model.identity().userAssignedIdentities().get("v").clientId()); - Assertions.assertEquals(TlsVersion.ONE_ONE, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(InputSchema.CUSTOM_EVENT_SCHEMA, model.inputSchema()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("kktwhrdxw", - model.eventTypeInfo().inlineEventTypes().get("kiiuxhqyudxor").description()); - Assertions.assertEquals("wqsmbsur", - model.eventTypeInfo().inlineEventTypes().get("kiiuxhqyudxor").displayName()); - Assertions.assertEquals("imoryocfsfksym", - model.eventTypeInfo().inlineEventTypes().get("kiiuxhqyudxor").documentationUrl()); - Assertions.assertEquals("ys", model.eventTypeInfo().inlineEventTypes().get("kiiuxhqyudxor").dataSchemaUrl()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("uugidyjrrfby", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(false, model.disableLocalAuth()); - Assertions.assertEquals(true, model.autoCreateTopicWithFirstSubscription()); - Assertions.assertEquals(true, model.autoDeleteTopicWithLastSubscription()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_GEOPAIR, model.dataResidencyBoundary()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainPropertiesTests.java deleted file mode 100644 index 16bc54c470a0..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainPropertiesTests.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.DomainProperties; -import com.azure.resourcemanager.eventgrid.models.DataResidencyBoundary; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.InboundIpRule; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import com.azure.resourcemanager.eventgrid.models.InputSchema; -import com.azure.resourcemanager.eventgrid.models.InputSchemaMapping; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DomainPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DomainProperties model = BinaryData.fromString( - "{\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"pu\"},\"groupIds\":[\"rywn\"],\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"tiyqzrnkcqv\",\"actionsRequired\":\"lwh\"},\"provisioningState\":\"Updating\"},\"id\":\"icohoqqnwvl\",\"name\":\"yav\",\"type\":\"hheunmmqhgyx\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"ocukoklyax\"},\"groupIds\":[\"nuqszfkbey\"],\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"jmwvvj\",\"actionsRequired\":\"tcxsenhwlrs\"},\"provisioningState\":\"Succeeded\"},\"id\":\"zpwv\",\"name\":\"qdqgbi\",\"type\":\"ylihkaetckt\"}],\"provisioningState\":\"Failed\",\"minimumTlsVersionAllowed\":\"1.0\",\"endpoint\":\"snkymuctq\",\"inputSchema\":\"CustomEventSchema\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"uujqgidokgjljyo\":{\"description\":\"xerf\",\"displayName\":\"utttxfvjrbirp\",\"documentationUrl\":\"epcyvahfnlj\",\"dataSchemaUrl\":\"qxj\"},\"godebfqkkrbmpu\":{\"description\":\"vcltbgsncgh\",\"displayName\":\"esz\",\"documentationUrl\":\"bijhtxfvgxbf\",\"dataSchemaUrl\":\"xnehmpvec\"},\"kpikadrgvt\":{\"description\":\"riwflzlfb\",\"displayName\":\"puz\",\"documentationUrl\":\"ispnqzahmgkbrp\",\"dataSchemaUrl\":\"dhibnuq\"}}},\"inputSchemaMapping\":{\"inputSchemaMappingType\":\"InputSchemaMapping\"},\"metricResourceId\":\"n\",\"publicNetworkAccess\":\"Disabled\",\"inboundIpRules\":[{\"ipMask\":\"jggmebfsiarbu\",\"action\":\"Allow\"},{\"ipMask\":\"pnazzm\",\"action\":\"Allow\"}],\"disableLocalAuth\":false,\"autoCreateTopicWithFirstSubscription\":false,\"autoDeleteTopicWithLastSubscription\":true,\"dataResidencyBoundary\":\"WithinRegion\"}") - .toObject(DomainProperties.class); - Assertions.assertEquals(TlsVersion.ONE_ZERO, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(InputSchema.CUSTOM_EVENT_SCHEMA, model.inputSchema()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("xerf", model.eventTypeInfo().inlineEventTypes().get("uujqgidokgjljyo").description()); - Assertions.assertEquals("utttxfvjrbirp", - model.eventTypeInfo().inlineEventTypes().get("uujqgidokgjljyo").displayName()); - Assertions.assertEquals("epcyvahfnlj", - model.eventTypeInfo().inlineEventTypes().get("uujqgidokgjljyo").documentationUrl()); - Assertions.assertEquals("qxj", model.eventTypeInfo().inlineEventTypes().get("uujqgidokgjljyo").dataSchemaUrl()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("jggmebfsiarbu", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(false, model.disableLocalAuth()); - Assertions.assertEquals(false, model.autoCreateTopicWithFirstSubscription()); - Assertions.assertEquals(true, model.autoDeleteTopicWithLastSubscription()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_REGION, model.dataResidencyBoundary()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DomainProperties model = new DomainProperties().withMinimumTlsVersionAllowed(TlsVersion.ONE_ZERO) - .withInputSchema(InputSchema.CUSTOM_EVENT_SCHEMA) - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("uujqgidokgjljyo", - new InlineEventProperties().withDescription("xerf") - .withDisplayName("utttxfvjrbirp") - .withDocumentationUrl("epcyvahfnlj") - .withDataSchemaUrl("qxj"), - "godebfqkkrbmpu", - new InlineEventProperties().withDescription("vcltbgsncgh") - .withDisplayName("esz") - .withDocumentationUrl("bijhtxfvgxbf") - .withDataSchemaUrl("xnehmpvec"), - "kpikadrgvt", - new InlineEventProperties().withDescription("riwflzlfb") - .withDisplayName("puz") - .withDocumentationUrl("ispnqzahmgkbrp") - .withDataSchemaUrl("dhibnuq")))) - .withInputSchemaMapping(new InputSchemaMapping()) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) - .withInboundIpRules( - Arrays.asList(new InboundIpRule().withIpMask("jggmebfsiarbu").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("pnazzm").withAction(IpActionType.ALLOW))) - .withDisableLocalAuth(false) - .withAutoCreateTopicWithFirstSubscription(false) - .withAutoDeleteTopicWithLastSubscription(true) - .withDataResidencyBoundary(DataResidencyBoundary.WITHIN_REGION); - model = BinaryData.fromObject(model).toObject(DomainProperties.class); - Assertions.assertEquals(TlsVersion.ONE_ZERO, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(InputSchema.CUSTOM_EVENT_SCHEMA, model.inputSchema()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("xerf", model.eventTypeInfo().inlineEventTypes().get("uujqgidokgjljyo").description()); - Assertions.assertEquals("utttxfvjrbirp", - model.eventTypeInfo().inlineEventTypes().get("uujqgidokgjljyo").displayName()); - Assertions.assertEquals("epcyvahfnlj", - model.eventTypeInfo().inlineEventTypes().get("uujqgidokgjljyo").documentationUrl()); - Assertions.assertEquals("qxj", model.eventTypeInfo().inlineEventTypes().get("uujqgidokgjljyo").dataSchemaUrl()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("jggmebfsiarbu", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(false, model.disableLocalAuth()); - Assertions.assertEquals(false, model.autoCreateTopicWithFirstSubscription()); - Assertions.assertEquals(true, model.autoDeleteTopicWithLastSubscription()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_REGION, model.dataResidencyBoundary()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicEventSubscriptionsDeleteMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicEventSubscriptionsDeleteMockTests.java deleted file mode 100644 index 1359e1c00848..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicEventSubscriptionsDeleteMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DomainTopicEventSubscriptionsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.domainTopicEventSubscriptions() - .delete("ogfg", "iijrykwlefksxq", "eazfpxgnmqvzvlu", "q", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicEventSubscriptionsGetDeliveryAttributesWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicEventSubscriptionsGetDeliveryAttributesWithResponseMockTests.java deleted file mode 100644 index fbc30a29fdee..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicEventSubscriptionsGetDeliveryAttributesWithResponseMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeListResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DomainTopicEventSubscriptionsGetDeliveryAttributesWithResponseMockTests { - @Test - public void testGetDeliveryAttributesWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"type\":\"DeliveryAttributeMapping\",\"name\":\"dwzqauxzanhmkvfr\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"kudrbcpftx\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"qyemebu\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"ucmci\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - DeliveryAttributeListResult response = manager.domainTopicEventSubscriptions() - .getDeliveryAttributesWithResponse("utmdpvozg", "qjbknl", "clctzey", "wmn", - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("dwzqauxzanhmkvfr", response.value().get(0).name()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicEventSubscriptionsGetFullUrlWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicEventSubscriptionsGetFullUrlWithResponseMockTests.java deleted file mode 100644 index f8e8071005ed..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicEventSubscriptionsGetFullUrlWithResponseMockTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFullUrl; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DomainTopicEventSubscriptionsGetFullUrlWithResponseMockTests { - @Test - public void testGetFullUrlWithResponse() throws Exception { - String responseStr = "{\"endpointUrl\":\"qfttehdpboujs\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - EventSubscriptionFullUrl response = manager.domainTopicEventSubscriptions() - .getFullUrlWithResponse("aiossscyvaifp", "uacvfy", "owpsfxt", "dhsoymhpv", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("qfttehdpboujs", response.endpointUrl()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicInnerTests.java deleted file mode 100644 index 33b6a1c62831..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.DomainTopicInner; - -public final class DomainTopicInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DomainTopicInner model = BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Canceled\"},\"id\":\"lbg\",\"name\":\"cdui\",\"type\":\"r\"}") - .toObject(DomainTopicInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DomainTopicInner model = new DomainTopicInner(); - model = BinaryData.fromObject(model).toObject(DomainTopicInner.class); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicPropertiesTests.java deleted file mode 100644 index a3529907501b..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicPropertiesTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.DomainTopicProperties; - -public final class DomainTopicPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DomainTopicProperties model - = BinaryData.fromString("{\"provisioningState\":\"Creating\"}").toObject(DomainTopicProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DomainTopicProperties model = new DomainTopicProperties(); - model = BinaryData.fromObject(model).toObject(DomainTopicProperties.class); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicsDeleteMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicsDeleteMockTests.java deleted file mode 100644 index e6d71974f240..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DomainTopicsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.domainTopics().delete("kdschlzvfictnkjj", "gcwn", "hbkgfyrt", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicsGetWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicsGetWithResponseMockTests.java deleted file mode 100644 index 5bec23117f28..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicsGetWithResponseMockTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.DomainTopic; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DomainTopicsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Failed\"},\"id\":\"gybpmfb\",\"name\":\"ununm\",\"type\":\"zkrvfyi\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - DomainTopic response = manager.domainTopics() - .getWithResponse("yvoaqajuvehzp", "dmkrrb", "mpfu", com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicsListByDomainMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicsListByDomainMockTests.java deleted file mode 100644 index 4ccfe75647a5..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicsListByDomainMockTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.DomainTopic; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DomainTopicsListByDomainMockTests { - @Test - public void testListByDomain() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\"},\"id\":\"arxifvqnrxt\",\"name\":\"bpjptnvwjhrsi\",\"type\":\"qpxlb\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.domainTopics() - .listByDomain("gm", "mjpjscdfpdqwty", "ev", 1189635916, com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicsListResultTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicsListResultTests.java deleted file mode 100644 index 058faf1e0806..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainTopicsListResultTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.DomainTopicInner; -import com.azure.resourcemanager.eventgrid.models.DomainTopicsListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DomainTopicsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DomainTopicsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\"},\"id\":\"l\",\"name\":\"ssl\",\"type\":\"lfmmdnbbglzpswi\"}],\"nextLink\":\"mcwyhzdxssadb\"}") - .toObject(DomainTopicsListResult.class); - Assertions.assertEquals("mcwyhzdxssadb", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DomainTopicsListResult model = new DomainTopicsListResult().withValue(Arrays.asList(new DomainTopicInner())) - .withNextLink("mcwyhzdxssadb"); - model = BinaryData.fromObject(model).toObject(DomainTopicsListResult.class); - Assertions.assertEquals("mcwyhzdxssadb", model.nextLink()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainUpdateParameterPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainUpdateParameterPropertiesTests.java deleted file mode 100644 index cc1e18ff8af2..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainUpdateParameterPropertiesTests.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.DomainUpdateParameterProperties; -import com.azure.resourcemanager.eventgrid.models.DataResidencyBoundary; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.InboundIpRule; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DomainUpdateParameterPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DomainUpdateParameterProperties model = BinaryData.fromString( - "{\"publicNetworkAccess\":\"Enabled\",\"inboundIpRules\":[{\"ipMask\":\"gqwgxhniskxfbkp\",\"action\":\"Allow\"},{\"ipMask\":\"lwn\",\"action\":\"Allow\"},{\"ipMask\":\"dauwhvylwzbtd\",\"action\":\"Allow\"}],\"minimumTlsVersionAllowed\":\"1.1\",\"disableLocalAuth\":false,\"autoCreateTopicWithFirstSubscription\":false,\"autoDeleteTopicWithLastSubscription\":true,\"dataResidencyBoundary\":\"WithinGeopair\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"nmxiebwwaloayqc\":{\"description\":\"eualupjmkhf\",\"displayName\":\"bbcswsrtjri\",\"documentationUrl\":\"rbpbewtghfgblcg\",\"dataSchemaUrl\":\"zvlvqhjkbegib\"}}}}") - .toObject(DomainUpdateParameterProperties.class); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - Assertions.assertEquals("gqwgxhniskxfbkp", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(TlsVersion.ONE_ONE, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(false, model.disableLocalAuth()); - Assertions.assertEquals(false, model.autoCreateTopicWithFirstSubscription()); - Assertions.assertEquals(true, model.autoDeleteTopicWithLastSubscription()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_GEOPAIR, model.dataResidencyBoundary()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("eualupjmkhf", - model.eventTypeInfo().inlineEventTypes().get("nmxiebwwaloayqc").description()); - Assertions.assertEquals("bbcswsrtjri", - model.eventTypeInfo().inlineEventTypes().get("nmxiebwwaloayqc").displayName()); - Assertions.assertEquals("rbpbewtghfgblcg", - model.eventTypeInfo().inlineEventTypes().get("nmxiebwwaloayqc").documentationUrl()); - Assertions.assertEquals("zvlvqhjkbegib", - model.eventTypeInfo().inlineEventTypes().get("nmxiebwwaloayqc").dataSchemaUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DomainUpdateParameterProperties model - = new DomainUpdateParameterProperties().withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withInboundIpRules( - Arrays.asList(new InboundIpRule().withIpMask("gqwgxhniskxfbkp").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("lwn").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("dauwhvylwzbtd").withAction(IpActionType.ALLOW))) - .withMinimumTlsVersionAllowed(TlsVersion.ONE_ONE) - .withDisableLocalAuth(false) - .withAutoCreateTopicWithFirstSubscription(false) - .withAutoDeleteTopicWithLastSubscription(true) - .withDataResidencyBoundary(DataResidencyBoundary.WITHIN_GEOPAIR) - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("nmxiebwwaloayqc", - new InlineEventProperties().withDescription("eualupjmkhf") - .withDisplayName("bbcswsrtjri") - .withDocumentationUrl("rbpbewtghfgblcg") - .withDataSchemaUrl("zvlvqhjkbegib")))); - model = BinaryData.fromObject(model).toObject(DomainUpdateParameterProperties.class); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - Assertions.assertEquals("gqwgxhniskxfbkp", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(TlsVersion.ONE_ONE, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(false, model.disableLocalAuth()); - Assertions.assertEquals(false, model.autoCreateTopicWithFirstSubscription()); - Assertions.assertEquals(true, model.autoDeleteTopicWithLastSubscription()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_GEOPAIR, model.dataResidencyBoundary()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("eualupjmkhf", - model.eventTypeInfo().inlineEventTypes().get("nmxiebwwaloayqc").description()); - Assertions.assertEquals("bbcswsrtjri", - model.eventTypeInfo().inlineEventTypes().get("nmxiebwwaloayqc").displayName()); - Assertions.assertEquals("rbpbewtghfgblcg", - model.eventTypeInfo().inlineEventTypes().get("nmxiebwwaloayqc").documentationUrl()); - Assertions.assertEquals("zvlvqhjkbegib", - model.eventTypeInfo().inlineEventTypes().get("nmxiebwwaloayqc").dataSchemaUrl()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainUpdateParametersTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainUpdateParametersTests.java deleted file mode 100644 index 34ab31814913..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainUpdateParametersTests.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.DataResidencyBoundary; -import com.azure.resourcemanager.eventgrid.models.DomainUpdateParameters; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.InboundIpRule; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import com.azure.resourcemanager.eventgrid.models.UserIdentityProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DomainUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DomainUpdateParameters model = BinaryData.fromString( - "{\"tags\":{\"a\":\"baumnyqupedeoj\",\"fhvpesaps\":\"ckhsmtxpsieb\",\"uutkncw\":\"rdqmhjjdhtldwkyz\"},\"properties\":{\"publicNetworkAccess\":\"Disabled\",\"inboundIpRules\":[{\"ipMask\":\"otogtwrupqs\",\"action\":\"Allow\"},{\"ipMask\":\"i\",\"action\":\"Allow\"},{\"ipMask\":\"ceoveilovno\",\"action\":\"Allow\"}],\"minimumTlsVersionAllowed\":\"1.1\",\"disableLocalAuth\":true,\"autoCreateTopicWithFirstSubscription\":false,\"autoDeleteTopicWithLastSubscription\":false,\"dataResidencyBoundary\":\"WithinGeopair\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"qugxywpmueefjzwf\":{\"description\":\"phywpnvj\",\"displayName\":\"qnermclfplphoxu\",\"documentationUrl\":\"rpabg\",\"dataSchemaUrl\":\"psbjta\"},\"ytlmoyrxvwfud\":{\"description\":\"q\",\"displayName\":\"ids\",\"documentationUrl\":\"onobglaocqx\",\"dataSchemaUrl\":\"cmgyud\"},\"p\":{\"description\":\"zntxhdz\",\"displayName\":\"rqjbhckfrl\",\"documentationUrl\":\"xsbkyvpyca\",\"dataSchemaUrl\":\"z\"},\"mqkrhahvljuahaqu\":{\"description\":\"afkuwb\",\"displayName\":\"nwbmeh\",\"documentationUrl\":\"eyvjusrtslhspkde\",\"dataSchemaUrl\":\"aofmxagkvtme\"}}}},\"identity\":{\"type\":\"SystemAssigned\",\"principalId\":\"duala\",\"tenantId\":\"qpv\",\"userAssignedIdentities\":{\"vxpvgomz\":{\"principalId\":\"ws\",\"clientId\":\"r\"},\"auhashsfwx\":{\"principalId\":\"misgwbnb\",\"clientId\":\"ldawkzbaliourqha\"},\"ovbvmeueciv\":{\"principalId\":\"owzxcu\",\"clientId\":\"cjooxdjebwpucwwf\"},\"it\":{\"principalId\":\"zceuojgjrw\",\"clientId\":\"eiotwmcdytdx\"}}}}") - .toObject(DomainUpdateParameters.class); - Assertions.assertEquals("baumnyqupedeoj", model.tags().get("a")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("duala", model.identity().principalId()); - Assertions.assertEquals("qpv", model.identity().tenantId()); - Assertions.assertEquals("ws", model.identity().userAssignedIdentities().get("vxpvgomz").principalId()); - Assertions.assertEquals("r", model.identity().userAssignedIdentities().get("vxpvgomz").clientId()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("otogtwrupqs", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(TlsVersion.ONE_ONE, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(true, model.disableLocalAuth()); - Assertions.assertEquals(false, model.autoCreateTopicWithFirstSubscription()); - Assertions.assertEquals(false, model.autoDeleteTopicWithLastSubscription()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_GEOPAIR, model.dataResidencyBoundary()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("phywpnvj", - model.eventTypeInfo().inlineEventTypes().get("qugxywpmueefjzwf").description()); - Assertions.assertEquals("qnermclfplphoxu", - model.eventTypeInfo().inlineEventTypes().get("qugxywpmueefjzwf").displayName()); - Assertions.assertEquals("rpabg", - model.eventTypeInfo().inlineEventTypes().get("qugxywpmueefjzwf").documentationUrl()); - Assertions.assertEquals("psbjta", - model.eventTypeInfo().inlineEventTypes().get("qugxywpmueefjzwf").dataSchemaUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DomainUpdateParameters model = new DomainUpdateParameters() - .withTags(mapOf("a", "baumnyqupedeoj", "fhvpesaps", "ckhsmtxpsieb", "uutkncw", "rdqmhjjdhtldwkyz")) - .withIdentity(new IdentityInfo().withType(IdentityType.SYSTEM_ASSIGNED) - .withPrincipalId("duala") - .withTenantId("qpv") - .withUserAssignedIdentities(mapOf("vxpvgomz", - new UserIdentityProperties().withPrincipalId("ws").withClientId("r"), "auhashsfwx", - new UserIdentityProperties().withPrincipalId("misgwbnb").withClientId("ldawkzbaliourqha"), - "ovbvmeueciv", - new UserIdentityProperties().withPrincipalId("owzxcu").withClientId("cjooxdjebwpucwwf"), "it", - new UserIdentityProperties().withPrincipalId("zceuojgjrw").withClientId("eiotwmcdytdx")))) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) - .withInboundIpRules( - Arrays.asList(new InboundIpRule().withIpMask("otogtwrupqs").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("i").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("ceoveilovno").withAction(IpActionType.ALLOW))) - .withMinimumTlsVersionAllowed(TlsVersion.ONE_ONE) - .withDisableLocalAuth(true) - .withAutoCreateTopicWithFirstSubscription(false) - .withAutoDeleteTopicWithLastSubscription(false) - .withDataResidencyBoundary(DataResidencyBoundary.WITHIN_GEOPAIR) - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("qugxywpmueefjzwf", - new InlineEventProperties().withDescription("phywpnvj") - .withDisplayName("qnermclfplphoxu") - .withDocumentationUrl("rpabg") - .withDataSchemaUrl("psbjta"), - "ytlmoyrxvwfud", - new InlineEventProperties().withDescription("q") - .withDisplayName("ids") - .withDocumentationUrl("onobglaocqx") - .withDataSchemaUrl("cmgyud"), - "p", - new InlineEventProperties().withDescription("zntxhdz") - .withDisplayName("rqjbhckfrl") - .withDocumentationUrl("xsbkyvpyca") - .withDataSchemaUrl("z"), - "mqkrhahvljuahaqu", - new InlineEventProperties().withDescription("afkuwb") - .withDisplayName("nwbmeh") - .withDocumentationUrl("eyvjusrtslhspkde") - .withDataSchemaUrl("aofmxagkvtme")))); - model = BinaryData.fromObject(model).toObject(DomainUpdateParameters.class); - Assertions.assertEquals("baumnyqupedeoj", model.tags().get("a")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("duala", model.identity().principalId()); - Assertions.assertEquals("qpv", model.identity().tenantId()); - Assertions.assertEquals("ws", model.identity().userAssignedIdentities().get("vxpvgomz").principalId()); - Assertions.assertEquals("r", model.identity().userAssignedIdentities().get("vxpvgomz").clientId()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("otogtwrupqs", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(TlsVersion.ONE_ONE, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(true, model.disableLocalAuth()); - Assertions.assertEquals(false, model.autoCreateTopicWithFirstSubscription()); - Assertions.assertEquals(false, model.autoDeleteTopicWithLastSubscription()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_GEOPAIR, model.dataResidencyBoundary()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("phywpnvj", - model.eventTypeInfo().inlineEventTypes().get("qugxywpmueefjzwf").description()); - Assertions.assertEquals("qnermclfplphoxu", - model.eventTypeInfo().inlineEventTypes().get("qugxywpmueefjzwf").displayName()); - Assertions.assertEquals("rpabg", - model.eventTypeInfo().inlineEventTypes().get("qugxywpmueefjzwf").documentationUrl()); - Assertions.assertEquals("psbjta", - model.eventTypeInfo().inlineEventTypes().get("qugxywpmueefjzwf").dataSchemaUrl()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainsDeleteMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainsDeleteMockTests.java deleted file mode 100644 index 64dace8d84fe..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DomainsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.domains().delete("oqeykglt", "gxhqfgqkayejs", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainsGetByResourceGroupWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 03b6e84041e2..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.DataResidencyBoundary; -import com.azure.resourcemanager.eventgrid.models.Domain; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.InputSchema; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DomainsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"ck\",\"oikxkxhnegk\",\"jzrbhtmeplv\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Canceled\"},\"id\":\"brlbpgs\",\"name\":\"bagn\",\"type\":\"hjhgem\"},{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"ywalhjymxcg\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"drclssoljome\",\"name\":\"tfy\",\"type\":\"nlbvgjcodkk\"}],\"provisioningState\":\"Updating\",\"minimumTlsVersionAllowed\":\"1.1\",\"endpoint\":\"s\",\"inputSchema\":\"CloudEventSchemaV1_0\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"qba\":{\"description\":\"q\",\"displayName\":\"ntnrgmqsorh\",\"documentationUrl\":\"kxgnlykmxcpwzvmd\",\"dataSchemaUrl\":\"sqdtiwlwxlbon\"},\"wnosbzlehgcvkbck\":{\"description\":\"icqchygtv\",\"displayName\":\"yjanepubdp\",\"documentationUrl\":\"yqvgxia\",\"dataSchemaUrl\":\"etvohkxdxuwsaifm\"},\"jglzoblqwaafrq\":{\"description\":\"olg\",\"displayName\":\"yxpvelszerqze\",\"documentationUrl\":\"o\",\"dataSchemaUrl\":\"intxwa\"}}},\"inputSchemaMapping\":{\"inputSchemaMappingType\":\"InputSchemaMapping\"},\"metricResourceId\":\"mz\",\"publicNetworkAccess\":\"Disabled\",\"inboundIpRules\":[{\"ipMask\":\"afjrqpjiyrqjcrg\",\"action\":\"Allow\"}],\"disableLocalAuth\":false,\"autoCreateTopicWithFirstSubscription\":true,\"autoDeleteTopicWithLastSubscription\":true,\"dataResidencyBoundary\":\"WithinGeopair\"},\"identity\":{\"type\":\"UserAssigned\",\"principalId\":\"pdltbq\",\"tenantId\":\"qjf\",\"userAssignedIdentities\":{\"uwjoedxnguca\":{\"principalId\":\"aetgzdgvpyigd\",\"clientId\":\"qilzdc\"},\"xwxdcvjwc\":{\"principalId\":\"pa\",\"clientId\":\"wwgilfjqqacdm\"}}},\"location\":\"iakeciqc\",\"tags\":{\"wdfmmpzhzzwvywr\":\"tuicds\"},\"id\":\"yngydgrpxncaki\",\"name\":\"aondjrkclamgg\",\"type\":\"vlmfej\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - Domain response = manager.domains() - .getByResourceGroupWithResponse("evhdlmydid", "hepfwwtjfdoes", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("iakeciqc", response.location()); - Assertions.assertEquals("tuicds", response.tags().get("wdfmmpzhzzwvywr")); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("pdltbq", response.identity().principalId()); - Assertions.assertEquals("qjf", response.identity().tenantId()); - Assertions.assertEquals("aetgzdgvpyigd", - response.identity().userAssignedIdentities().get("uwjoedxnguca").principalId()); - Assertions.assertEquals("qilzdc", response.identity().userAssignedIdentities().get("uwjoedxnguca").clientId()); - Assertions.assertEquals(TlsVersion.ONE_ONE, response.minimumTlsVersionAllowed()); - Assertions.assertEquals(InputSchema.CLOUD_EVENT_SCHEMA_V1_0, response.inputSchema()); - Assertions.assertEquals(EventDefinitionKind.INLINE, response.eventTypeInfo().kind()); - Assertions.assertEquals("q", response.eventTypeInfo().inlineEventTypes().get("qba").description()); - Assertions.assertEquals("ntnrgmqsorh", response.eventTypeInfo().inlineEventTypes().get("qba").displayName()); - Assertions.assertEquals("kxgnlykmxcpwzvmd", - response.eventTypeInfo().inlineEventTypes().get("qba").documentationUrl()); - Assertions.assertEquals("sqdtiwlwxlbon", - response.eventTypeInfo().inlineEventTypes().get("qba").dataSchemaUrl()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, response.publicNetworkAccess()); - Assertions.assertEquals("afjrqpjiyrqjcrg", response.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, response.inboundIpRules().get(0).action()); - Assertions.assertEquals(false, response.disableLocalAuth()); - Assertions.assertEquals(true, response.autoCreateTopicWithFirstSubscription()); - Assertions.assertEquals(true, response.autoDeleteTopicWithLastSubscription()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_GEOPAIR, response.dataResidencyBoundary()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainsListByResourceGroupMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainsListByResourceGroupMockTests.java deleted file mode 100644 index 46c35bca64e1..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainsListByResourceGroupMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.DataResidencyBoundary; -import com.azure.resourcemanager.eventgrid.models.Domain; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.InputSchema; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DomainsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"uiyqvldaswvppi\",\"qqzlgcndhz\",\"rr\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Updating\"},\"id\":\"r\",\"name\":\"khgsnxuwwkpphefs\",\"type\":\"zxlb\"}],\"provisioningState\":\"Succeeded\",\"minimumTlsVersionAllowed\":\"1.2\",\"endpoint\":\"k\",\"inputSchema\":\"CloudEventSchemaV1_0\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"zjiihjr\":{\"description\":\"wpfsuqtaaz\",\"displayName\":\"bxyxoy\",\"documentationUrl\":\"uqqiqezxlhd\",\"dataSchemaUrl\":\"qdcadwvps\"},\"uyvpirf\":{\"description\":\"bmrzoepnx\",\"displayName\":\"v\",\"documentationUrl\":\"jkgv\",\"dataSchemaUrl\":\"mxaursqftibtyi\"}}},\"inputSchemaMapping\":{\"inputSchemaMappingType\":\"InputSchemaMapping\"},\"metricResourceId\":\"n\",\"publicNetworkAccess\":\"Enabled\",\"inboundIpRules\":[{\"ipMask\":\"bedenrexkx\",\"action\":\"Allow\"}],\"disableLocalAuth\":true,\"autoCreateTopicWithFirstSubscription\":false,\"autoDeleteTopicWithLastSubscription\":true,\"dataResidencyBoundary\":\"WithinRegion\"},\"identity\":{\"type\":\"SystemAssigned\",\"principalId\":\"vdyznf\",\"tenantId\":\"svkskmqoz\",\"userAssignedIdentities\":{\"onqqlmgn\":{\"principalId\":\"yhjrliizji\",\"clientId\":\"qfhefkwabsol\"},\"zlbcnndtsn\":{\"principalId\":\"xsjxtelexhvuqboz\",\"clientId\":\"lzqocark\"},\"xak\":{\"principalId\":\"wqy\",\"clientId\":\"lhdyzmyckzex\"},\"ogzvk\":{\"principalId\":\"ywymxgaabj\",\"clientId\":\"tfohf\"}}},\"location\":\"rsiwdyjqur\",\"tags\":{\"eek\":\"rra\",\"eh\":\"s\",\"bcbgydlqidywmhm\":\"gdda\"},\"id\":\"tyrilkfbnrqqxvz\",\"name\":\"pbnfnqtx\",\"type\":\"to\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response - = manager.domains().listByResourceGroup("g", "syparybjufp", 2046726722, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("rsiwdyjqur", response.iterator().next().location()); - Assertions.assertEquals("rra", response.iterator().next().tags().get("eek")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("vdyznf", response.iterator().next().identity().principalId()); - Assertions.assertEquals("svkskmqoz", response.iterator().next().identity().tenantId()); - Assertions.assertEquals("yhjrliizji", - response.iterator().next().identity().userAssignedIdentities().get("onqqlmgn").principalId()); - Assertions.assertEquals("qfhefkwabsol", - response.iterator().next().identity().userAssignedIdentities().get("onqqlmgn").clientId()); - Assertions.assertEquals(TlsVersion.ONE_TWO, response.iterator().next().minimumTlsVersionAllowed()); - Assertions.assertEquals(InputSchema.CLOUD_EVENT_SCHEMA_V1_0, response.iterator().next().inputSchema()); - Assertions.assertEquals(EventDefinitionKind.INLINE, response.iterator().next().eventTypeInfo().kind()); - Assertions.assertEquals("wpfsuqtaaz", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("zjiihjr").description()); - Assertions.assertEquals("bxyxoy", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("zjiihjr").displayName()); - Assertions.assertEquals("uqqiqezxlhd", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("zjiihjr").documentationUrl()); - Assertions.assertEquals("qdcadwvps", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("zjiihjr").dataSchemaUrl()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, response.iterator().next().publicNetworkAccess()); - Assertions.assertEquals("bedenrexkx", response.iterator().next().inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, response.iterator().next().inboundIpRules().get(0).action()); - Assertions.assertEquals(true, response.iterator().next().disableLocalAuth()); - Assertions.assertEquals(false, response.iterator().next().autoCreateTopicWithFirstSubscription()); - Assertions.assertEquals(true, response.iterator().next().autoDeleteTopicWithLastSubscription()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_REGION, - response.iterator().next().dataResidencyBoundary()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainsListMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainsListMockTests.java deleted file mode 100644 index 732447e9c8fc..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainsListMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.DataResidencyBoundary; -import com.azure.resourcemanager.eventgrid.models.Domain; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.InputSchema; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DomainsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"atlijjjr\",\"va\",\"caszk\",\"xk\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Canceled\"},\"id\":\"etyvkunmignohi\",\"name\":\"kgqogjw\",\"type\":\"indedvabbx\"},{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"eilbjywfcf\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"zzihvwy\",\"name\":\"usuv\",\"type\":\"slczwciidjsllf\"}],\"provisioningState\":\"Creating\",\"minimumTlsVersionAllowed\":\"1.2\",\"endpoint\":\"x\",\"inputSchema\":\"CloudEventSchemaV1_0\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"yqgxhlus\":{\"description\":\"awba\",\"displayName\":\"fbktyjmfczlf\",\"documentationUrl\":\"qkfrbzgowoxqmj\",\"dataSchemaUrl\":\"jcx\"}}},\"inputSchemaMapping\":{\"inputSchemaMappingType\":\"InputSchemaMapping\"},\"metricResourceId\":\"i\",\"publicNetworkAccess\":\"Disabled\",\"inboundIpRules\":[{\"ipMask\":\"agb\",\"action\":\"Allow\"},{\"ipMask\":\"sumywzashxgonoyj\",\"action\":\"Allow\"},{\"ipMask\":\"ubyzn\",\"action\":\"Allow\"},{\"ipMask\":\"ke\",\"action\":\"Allow\"}],\"disableLocalAuth\":false,\"autoCreateTopicWithFirstSubscription\":false,\"autoDeleteTopicWithLastSubscription\":true,\"dataResidencyBoundary\":\"WithinRegion\"},\"identity\":{\"type\":\"None\",\"principalId\":\"yegq\",\"tenantId\":\"nigflqqbtnyj\",\"userAssignedIdentities\":{\"lwuhvajmailfe\":{\"principalId\":\"dbfvabmv\",\"clientId\":\"xbaevwjcnkot\"},\"yeofltfnnxrkad\":{\"principalId\":\"jzakzwjiqull\",\"clientId\":\"bdmvrscmqerndbr\"},\"kfkxbbcbrwjiut\":{\"principalId\":\"ynnfmuiii\",\"clientId\":\"pfoh\"}}},\"location\":\"jizbeew\",\"tags\":{\"juyrsrziuctixg\":\"mrvz\",\"uifr\":\"d\"},\"id\":\"vka\",\"name\":\"pezkis\",\"type\":\"qjm\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response - = manager.domains().list("tlgflwfgz", 86909569, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("jizbeew", response.iterator().next().location()); - Assertions.assertEquals("mrvz", response.iterator().next().tags().get("juyrsrziuctixg")); - Assertions.assertEquals(IdentityType.NONE, response.iterator().next().identity().type()); - Assertions.assertEquals("yegq", response.iterator().next().identity().principalId()); - Assertions.assertEquals("nigflqqbtnyj", response.iterator().next().identity().tenantId()); - Assertions.assertEquals("dbfvabmv", - response.iterator().next().identity().userAssignedIdentities().get("lwuhvajmailfe").principalId()); - Assertions.assertEquals("xbaevwjcnkot", - response.iterator().next().identity().userAssignedIdentities().get("lwuhvajmailfe").clientId()); - Assertions.assertEquals(TlsVersion.ONE_TWO, response.iterator().next().minimumTlsVersionAllowed()); - Assertions.assertEquals(InputSchema.CLOUD_EVENT_SCHEMA_V1_0, response.iterator().next().inputSchema()); - Assertions.assertEquals(EventDefinitionKind.INLINE, response.iterator().next().eventTypeInfo().kind()); - Assertions.assertEquals("awba", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("yqgxhlus").description()); - Assertions.assertEquals("fbktyjmfczlf", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("yqgxhlus").displayName()); - Assertions.assertEquals("qkfrbzgowoxqmj", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("yqgxhlus").documentationUrl()); - Assertions.assertEquals("jcx", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("yqgxhlus").dataSchemaUrl()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, response.iterator().next().publicNetworkAccess()); - Assertions.assertEquals("agb", response.iterator().next().inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, response.iterator().next().inboundIpRules().get(0).action()); - Assertions.assertEquals(false, response.iterator().next().disableLocalAuth()); - Assertions.assertEquals(false, response.iterator().next().autoCreateTopicWithFirstSubscription()); - Assertions.assertEquals(true, response.iterator().next().autoDeleteTopicWithLastSubscription()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_REGION, - response.iterator().next().dataResidencyBoundary()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainsListResultTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainsListResultTests.java deleted file mode 100644 index 3d7b17504844..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DomainsListResultTests.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.DomainInner; -import com.azure.resourcemanager.eventgrid.models.DataResidencyBoundary; -import com.azure.resourcemanager.eventgrid.models.DomainsListResult; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.InboundIpRule; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import com.azure.resourcemanager.eventgrid.models.InputSchema; -import com.azure.resourcemanager.eventgrid.models.InputSchemaMapping; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import com.azure.resourcemanager.eventgrid.models.UserIdentityProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DomainsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DomainsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{},\"id\":\"zg\",\"name\":\"yzm\",\"type\":\"txon\"}],\"provisioningState\":\"Creating\",\"minimumTlsVersionAllowed\":\"1.0\",\"endpoint\":\"jcbpwxqpsrknft\",\"inputSchema\":\"EventGridSchema\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"rwmdyvxqtay\":{},\"iwwroyqbexrmc\":{},\"ibycno\":{}}},\"inputSchemaMapping\":{\"inputSchemaMappingType\":\"InputSchemaMapping\"},\"metricResourceId\":\"nmefqsgzvahapj\",\"publicNetworkAccess\":\"Enabled\",\"inboundIpRules\":[{\"ipMask\":\"qzcjrvxdj\",\"action\":\"Allow\"},{\"ipMask\":\"lxkvu\",\"action\":\"Allow\"},{\"ipMask\":\"ovawjvzunlu\",\"action\":\"Allow\"}],\"disableLocalAuth\":true,\"autoCreateTopicWithFirstSubscription\":false,\"autoDeleteTopicWithLastSubscription\":false,\"dataResidencyBoundary\":\"WithinRegion\"},\"identity\":{\"type\":\"None\",\"principalId\":\"zuaejxd\",\"tenantId\":\"tskzbbtdzumveek\",\"userAssignedIdentities\":{\"dttouwaboekqvkel\":{\"principalId\":\"zuhkfpbsjyof\",\"clientId\":\"luu\"},\"isxyawjoyaqcslyj\":{\"principalId\":\"mvb\",\"clientId\":\"yjsflhhcaalnji\"}}},\"location\":\"iidzyexzne\",\"tags\":{\"bnxknalaulppg\":\"hnrztfol\",\"gvpgy\":\"dtpnapnyiropuhp\",\"n\":\"gqgitxmedjvcsl\"},\"id\":\"wwncwzzhxgk\",\"name\":\"rmgucnap\",\"type\":\"t\"},{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{},\"id\":\"wptfdy\",\"name\":\"pfqbuaceopzf\",\"type\":\"rhhuaopppcqeqx\"},{\"properties\":{},\"id\":\"z\",\"name\":\"ahzxctobgbk\",\"type\":\"moizpos\"}],\"provisioningState\":\"Deleting\",\"minimumTlsVersionAllowed\":\"1.0\",\"endpoint\":\"bunrmfqjhhk\",\"inputSchema\":\"EventGridSchema\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"hx\":{},\"j\":{}}},\"inputSchemaMapping\":{\"inputSchemaMappingType\":\"InputSchemaMapping\"},\"metricResourceId\":\"u\",\"publicNetworkAccess\":\"Enabled\",\"inboundIpRules\":[{\"ipMask\":\"swbxqz\",\"action\":\"Allow\"}],\"disableLocalAuth\":true,\"autoCreateTopicWithFirstSubscription\":true,\"autoDeleteTopicWithLastSubscription\":false,\"dataResidencyBoundary\":\"WithinGeopair\"},\"identity\":{\"type\":\"SystemAssigned\",\"principalId\":\"e\",\"tenantId\":\"t\",\"userAssignedIdentities\":{\"fxoblytkb\":{\"principalId\":\"tdo\",\"clientId\":\"cbxvwvxyslqbh\"},\"shqjohxcrsbf\":{\"principalId\":\"pe\",\"clientId\":\"wfbkrvrns\"},\"ybsrfbjfdtwss\":{\"principalId\":\"asrru\",\"clientId\":\"bhsqfsubcgjbirxb\"}}},\"location\":\"ftpvjzbexil\",\"tags\":{\"jmkcjhwqytj\":\"fqqnvwpmqtaruo\",\"jewgdrjerv\":\"ybn\"},\"id\":\"aen\",\"name\":\"pehindoygm\",\"type\":\"fthnzdn\"}],\"nextLink\":\"l\"}") - .toObject(DomainsListResult.class); - Assertions.assertEquals("iidzyexzne", model.value().get(0).location()); - Assertions.assertEquals("hnrztfol", model.value().get(0).tags().get("bnxknalaulppg")); - Assertions.assertEquals(IdentityType.NONE, model.value().get(0).identity().type()); - Assertions.assertEquals("zuaejxd", model.value().get(0).identity().principalId()); - Assertions.assertEquals("tskzbbtdzumveek", model.value().get(0).identity().tenantId()); - Assertions.assertEquals("zuhkfpbsjyof", - model.value().get(0).identity().userAssignedIdentities().get("dttouwaboekqvkel").principalId()); - Assertions.assertEquals("luu", - model.value().get(0).identity().userAssignedIdentities().get("dttouwaboekqvkel").clientId()); - Assertions.assertEquals(TlsVersion.ONE_ZERO, model.value().get(0).minimumTlsVersionAllowed()); - Assertions.assertEquals(InputSchema.EVENT_GRID_SCHEMA, model.value().get(0).inputSchema()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.value().get(0).eventTypeInfo().kind()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.value().get(0).publicNetworkAccess()); - Assertions.assertEquals("qzcjrvxdj", model.value().get(0).inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.value().get(0).inboundIpRules().get(0).action()); - Assertions.assertEquals(true, model.value().get(0).disableLocalAuth()); - Assertions.assertEquals(false, model.value().get(0).autoCreateTopicWithFirstSubscription()); - Assertions.assertEquals(false, model.value().get(0).autoDeleteTopicWithLastSubscription()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_REGION, model.value().get(0).dataResidencyBoundary()); - Assertions.assertEquals("l", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DomainsListResult model - = new DomainsListResult() - .withValue( - Arrays.asList( - new DomainInner().withLocation("iidzyexzne") - .withTags( - mapOf("bnxknalaulppg", "hnrztfol", "gvpgy", "dtpnapnyiropuhp", "n", "gqgitxmedjvcsl")) - .withIdentity(new IdentityInfo().withType(IdentityType.NONE) - .withPrincipalId("zuaejxd") - .withTenantId("tskzbbtdzumveek") - .withUserAssignedIdentities(mapOf("dttouwaboekqvkel", - new UserIdentityProperties().withPrincipalId("zuhkfpbsjyof").withClientId("luu"), - "isxyawjoyaqcslyj", - new UserIdentityProperties().withPrincipalId("mvb") - .withClientId("yjsflhhcaalnji")))) - .withMinimumTlsVersionAllowed(TlsVersion.ONE_ZERO) - .withInputSchema(InputSchema.EVENT_GRID_SCHEMA) - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("rwmdyvxqtay", new InlineEventProperties(), "iwwroyqbexrmc", - new InlineEventProperties(), "ibycno", new InlineEventProperties()))) - .withInputSchemaMapping(new InputSchemaMapping()) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withInboundIpRules(Arrays.asList( - new InboundIpRule().withIpMask("qzcjrvxdj").withAction(IpActionType.ALLOW), - new InboundIpRule() - .withIpMask("lxkvu") - .withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("ovawjvzunlu").withAction(IpActionType.ALLOW))) - .withDisableLocalAuth(true) - .withAutoCreateTopicWithFirstSubscription(false) - .withAutoDeleteTopicWithLastSubscription(false) - .withDataResidencyBoundary(DataResidencyBoundary.WITHIN_REGION), - new DomainInner().withLocation("ftpvjzbexil") - .withTags(mapOf("jmkcjhwqytj", "fqqnvwpmqtaruo", "jewgdrjerv", "ybn")) - .withIdentity( - new IdentityInfo().withType(IdentityType.SYSTEM_ASSIGNED) - .withPrincipalId("e") - .withTenantId("t") - .withUserAssignedIdentities(mapOf("fxoblytkb", - new UserIdentityProperties().withPrincipalId("tdo") - .withClientId("cbxvwvxyslqbh"), - "shqjohxcrsbf", - new UserIdentityProperties().withPrincipalId("pe").withClientId("wfbkrvrns"), - "ybsrfbjfdtwss", - new UserIdentityProperties().withPrincipalId("asrru") - .withClientId("bhsqfsubcgjbirxb")))) - .withMinimumTlsVersionAllowed(TlsVersion.ONE_ZERO) - .withInputSchema(InputSchema.EVENT_GRID_SCHEMA) - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes( - mapOf("hx", new InlineEventProperties(), "j", new InlineEventProperties()))) - .withInputSchemaMapping(new InputSchemaMapping()) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withInboundIpRules( - Arrays.asList(new InboundIpRule().withIpMask("swbxqz").withAction(IpActionType.ALLOW))) - .withDisableLocalAuth(true) - .withAutoCreateTopicWithFirstSubscription(true) - .withAutoDeleteTopicWithLastSubscription(false) - .withDataResidencyBoundary(DataResidencyBoundary.WITHIN_GEOPAIR))) - .withNextLink("l"); - model = BinaryData.fromObject(model).toObject(DomainsListResult.class); - Assertions.assertEquals("iidzyexzne", model.value().get(0).location()); - Assertions.assertEquals("hnrztfol", model.value().get(0).tags().get("bnxknalaulppg")); - Assertions.assertEquals(IdentityType.NONE, model.value().get(0).identity().type()); - Assertions.assertEquals("zuaejxd", model.value().get(0).identity().principalId()); - Assertions.assertEquals("tskzbbtdzumveek", model.value().get(0).identity().tenantId()); - Assertions.assertEquals("zuhkfpbsjyof", - model.value().get(0).identity().userAssignedIdentities().get("dttouwaboekqvkel").principalId()); - Assertions.assertEquals("luu", - model.value().get(0).identity().userAssignedIdentities().get("dttouwaboekqvkel").clientId()); - Assertions.assertEquals(TlsVersion.ONE_ZERO, model.value().get(0).minimumTlsVersionAllowed()); - Assertions.assertEquals(InputSchema.EVENT_GRID_SCHEMA, model.value().get(0).inputSchema()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.value().get(0).eventTypeInfo().kind()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.value().get(0).publicNetworkAccess()); - Assertions.assertEquals("qzcjrvxdj", model.value().get(0).inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.value().get(0).inboundIpRules().get(0).action()); - Assertions.assertEquals(true, model.value().get(0).disableLocalAuth()); - Assertions.assertEquals(false, model.value().get(0).autoCreateTopicWithFirstSubscription()); - Assertions.assertEquals(false, model.value().get(0).autoDeleteTopicWithLastSubscription()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_REGION, model.value().get(0).dataResidencyBoundary()); - Assertions.assertEquals("l", model.nextLink()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DynamicDeliveryAttributeMappingPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DynamicDeliveryAttributeMappingPropertiesTests.java deleted file mode 100644 index da92d5c283f8..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DynamicDeliveryAttributeMappingPropertiesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.DynamicDeliveryAttributeMappingProperties; -import org.junit.jupiter.api.Assertions; - -public final class DynamicDeliveryAttributeMappingPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DynamicDeliveryAttributeMappingProperties model = BinaryData.fromString("{\"sourceField\":\"gmvflnwyvqkx\"}") - .toObject(DynamicDeliveryAttributeMappingProperties.class); - Assertions.assertEquals("gmvflnwyvqkx", model.sourceField()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DynamicDeliveryAttributeMappingProperties model - = new DynamicDeliveryAttributeMappingProperties().withSourceField("gmvflnwyvqkx"); - model = BinaryData.fromObject(model).toObject(DynamicDeliveryAttributeMappingProperties.class); - Assertions.assertEquals("gmvflnwyvqkx", model.sourceField()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DynamicDeliveryAttributeMappingTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DynamicDeliveryAttributeMappingTests.java deleted file mode 100644 index 9581b6c1706a..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/DynamicDeliveryAttributeMappingTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.DynamicDeliveryAttributeMapping; -import org.junit.jupiter.api.Assertions; - -public final class DynamicDeliveryAttributeMappingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DynamicDeliveryAttributeMapping model = BinaryData - .fromString( - "{\"type\":\"Dynamic\",\"properties\":{\"sourceField\":\"lniylylyfwxz\"},\"name\":\"gqztwhghmupgx\"}") - .toObject(DynamicDeliveryAttributeMapping.class); - Assertions.assertEquals("gqztwhghmupgx", model.name()); - Assertions.assertEquals("lniylylyfwxz", model.sourceField()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DynamicDeliveryAttributeMapping model - = new DynamicDeliveryAttributeMapping().withName("gqztwhghmupgx").withSourceField("lniylylyfwxz"); - model = BinaryData.fromObject(model).toObject(DynamicDeliveryAttributeMapping.class); - Assertions.assertEquals("gqztwhghmupgx", model.name()); - Assertions.assertEquals("lniylylyfwxz", model.sourceField()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventHubEventSubscriptionDestinationPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventHubEventSubscriptionDestinationPropertiesTests.java deleted file mode 100644 index ab6c987517bd..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventHubEventSubscriptionDestinationPropertiesTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.EventHubEventSubscriptionDestinationProperties; -import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeMapping; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EventHubEventSubscriptionDestinationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EventHubEventSubscriptionDestinationProperties model = BinaryData.fromString( - "{\"resourceId\":\"fvafh\",\"deliveryAttributeMappings\":[{\"type\":\"DeliveryAttributeMapping\",\"name\":\"ccbevxrhyzdf\"}]}") - .toObject(EventHubEventSubscriptionDestinationProperties.class); - Assertions.assertEquals("fvafh", model.resourceId()); - Assertions.assertEquals("ccbevxrhyzdf", model.deliveryAttributeMappings().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EventHubEventSubscriptionDestinationProperties model - = new EventHubEventSubscriptionDestinationProperties().withResourceId("fvafh") - .withDeliveryAttributeMappings(Arrays.asList(new DeliveryAttributeMapping().withName("ccbevxrhyzdf"))); - model = BinaryData.fromObject(model).toObject(EventHubEventSubscriptionDestinationProperties.class); - Assertions.assertEquals("fvafh", model.resourceId()); - Assertions.assertEquals("ccbevxrhyzdf", model.deliveryAttributeMappings().get(0).name()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventHubEventSubscriptionDestinationTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventHubEventSubscriptionDestinationTests.java deleted file mode 100644 index 03e9be0753e7..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventHubEventSubscriptionDestinationTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeMapping; -import com.azure.resourcemanager.eventgrid.models.EventHubEventSubscriptionDestination; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EventHubEventSubscriptionDestinationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EventHubEventSubscriptionDestination model = BinaryData.fromString( - "{\"endpointType\":\"EventHub\",\"properties\":{\"resourceId\":\"ofpltdbm\",\"deliveryAttributeMappings\":[{\"type\":\"DeliveryAttributeMapping\",\"name\":\"hvhfnracw\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"qigtuujwouhdaws\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"rb\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"xsjybvitvqk\"}]}}") - .toObject(EventHubEventSubscriptionDestination.class); - Assertions.assertEquals("ofpltdbm", model.resourceId()); - Assertions.assertEquals("hvhfnracw", model.deliveryAttributeMappings().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EventHubEventSubscriptionDestination model = new EventHubEventSubscriptionDestination() - .withResourceId("ofpltdbm") - .withDeliveryAttributeMappings(Arrays.asList(new DeliveryAttributeMapping().withName("hvhfnracw"), - new DeliveryAttributeMapping().withName("qigtuujwouhdaws"), - new DeliveryAttributeMapping().withName("rb"), new DeliveryAttributeMapping().withName("xsjybvitvqk"))); - model = BinaryData.fromObject(model).toObject(EventHubEventSubscriptionDestination.class); - Assertions.assertEquals("ofpltdbm", model.resourceId()); - Assertions.assertEquals("hvhfnracw", model.deliveryAttributeMappings().get(0).name()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventSubscriptionDestinationTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventSubscriptionDestinationTests.java deleted file mode 100644 index d6e977b88d1d..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventSubscriptionDestinationTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionDestination; - -public final class EventSubscriptionDestinationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EventSubscriptionDestination model - = BinaryData.fromString("{\"endpointType\":\"EventSubscriptionDestination\"}") - .toObject(EventSubscriptionDestination.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EventSubscriptionDestination model = new EventSubscriptionDestination(); - model = BinaryData.fromObject(model).toObject(EventSubscriptionDestination.class); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventSubscriptionFullUrlInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventSubscriptionFullUrlInnerTests.java deleted file mode 100644 index a3b4ef989dea..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventSubscriptionFullUrlInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionFullUrlInner; -import org.junit.jupiter.api.Assertions; - -public final class EventSubscriptionFullUrlInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EventSubscriptionFullUrlInner model - = BinaryData.fromString("{\"endpointUrl\":\"ymzidn\"}").toObject(EventSubscriptionFullUrlInner.class); - Assertions.assertEquals("ymzidn", model.endpointUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EventSubscriptionFullUrlInner model = new EventSubscriptionFullUrlInner().withEndpointUrl("ymzidn"); - model = BinaryData.fromObject(model).toObject(EventSubscriptionFullUrlInner.class); - Assertions.assertEquals("ymzidn", model.endpointUrl()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventSubscriptionIdentityTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventSubscriptionIdentityTests.java deleted file mode 100644 index 92ee8e99ab3d..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventSubscriptionIdentityTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionIdentity; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionIdentityType; -import org.junit.jupiter.api.Assertions; - -public final class EventSubscriptionIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EventSubscriptionIdentity model - = BinaryData.fromString("{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"gfbcvkcv\"}") - .toObject(EventSubscriptionIdentity.class); - Assertions.assertEquals(EventSubscriptionIdentityType.USER_ASSIGNED, model.type()); - Assertions.assertEquals("gfbcvkcv", model.userAssignedIdentity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EventSubscriptionIdentity model - = new EventSubscriptionIdentity().withType(EventSubscriptionIdentityType.USER_ASSIGNED) - .withUserAssignedIdentity("gfbcvkcv"); - model = BinaryData.fromObject(model).toObject(EventSubscriptionIdentity.class); - Assertions.assertEquals(EventSubscriptionIdentityType.USER_ASSIGNED, model.type()); - Assertions.assertEquals("gfbcvkcv", model.userAssignedIdentity()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventSubscriptionsDeleteMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventSubscriptionsDeleteMockTests.java deleted file mode 100644 index 6aed27a4f1f9..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventSubscriptionsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class EventSubscriptionsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.eventSubscriptions().delete("vdlhydwbdbfgr", "punytjl", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventSubscriptionsGetDeliveryAttributesWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventSubscriptionsGetDeliveryAttributesWithResponseMockTests.java deleted file mode 100644 index 397f38d033fd..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventSubscriptionsGetDeliveryAttributesWithResponseMockTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeListResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class EventSubscriptionsGetDeliveryAttributesWithResponseMockTests { - @Test - public void testGetDeliveryAttributesWithResponse() throws Exception { - String responseStr = "{\"value\":[{\"type\":\"DeliveryAttributeMapping\",\"name\":\"vpaklozkxbz\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - DeliveryAttributeListResult response = manager.eventSubscriptions() - .getDeliveryAttributesWithResponse("uwdxvqzxoebwgj", "bibanbau", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("vpaklozkxbz", response.value().get(0).name()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventSubscriptionsGetFullUrlWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventSubscriptionsGetFullUrlWithResponseMockTests.java deleted file mode 100644 index ffd5132d8269..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventSubscriptionsGetFullUrlWithResponseMockTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFullUrl; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class EventSubscriptionsGetFullUrlWithResponseMockTests { - @Test - public void testGetFullUrlWithResponse() throws Exception { - String responseStr = "{\"endpointUrl\":\"wllbv\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - EventSubscriptionFullUrl response = manager.eventSubscriptions() - .getFullUrlWithResponse("esmmpathubtahd", "an", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("wllbv", response.endpointUrl()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventSubscriptionsListResultTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventSubscriptionsListResultTests.java deleted file mode 100644 index 6de96ce664fe..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventSubscriptionsListResultTests.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.EventSubscriptionInner; -import com.azure.resourcemanager.eventgrid.models.AdvancedFilter; -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; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionIdentity; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionIdentityType; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionsListResult; -import com.azure.resourcemanager.eventgrid.models.RetryPolicy; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EventSubscriptionsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EventSubscriptionsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"topic\":\"ukghimdblxgw\",\"provisioningState\":\"AwaitingManualAction\",\"destination\":{\"endpointType\":\"EventSubscriptionDestination\"},\"deliveryWithResourceIdentity\":{\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentity\":\"wmszkk\"},\"destination\":{\"endpointType\":\"EventSubscriptionDestination\"}},\"filter\":{\"subjectBeginsWith\":\"eyfkzikfja\",\"subjectEndsWith\":\"eaivxwczel\",\"includedEventTypes\":[\"r\",\"lsfeaenwabfatkld\"],\"isSubjectCaseSensitive\":false,\"enableAdvancedFilteringOnArrays\":true,\"advancedFilters\":[{\"operatorType\":\"AdvancedFilter\"},{\"operatorType\":\"AdvancedFilter\"},{\"operatorType\":\"AdvancedFilter\"}]},\"labels\":[\"nozj\"],\"expirationTimeUtc\":\"2021-03-07T05:51:02Z\",\"eventDeliverySchema\":\"CustomInputSchema\",\"retryPolicy\":{\"maxDeliveryAttempts\":113481876,\"eventTimeToLiveInMinutes\":171728083},\"deadLetterDestination\":{\"endpointType\":\"DeadLetterDestination\"},\"deadLetterWithResourceIdentity\":{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"rvimjwosytxitcsk\"},\"deadLetterDestination\":{\"endpointType\":\"DeadLetterDestination\"}}},\"id\":\"tq\",\"name\":\"miekkezzikhlyfjh\",\"type\":\"gqggebdunygae\"},{\"properties\":{\"topic\":\"bqfatpxllrxcyjmo\",\"provisioningState\":\"Succeeded\",\"destination\":{\"endpointType\":\"EventSubscriptionDestination\"},\"deliveryWithResourceIdentity\":{\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentity\":\"wdmjsjqbjhhyx\"},\"destination\":{\"endpointType\":\"EventSubscriptionDestination\"}},\"filter\":{\"subjectBeginsWith\":\"yc\",\"subjectEndsWith\":\"uhpkxkgymar\",\"includedEventTypes\":[\"ajxq\"],\"isSubjectCaseSensitive\":false,\"enableAdvancedFilteringOnArrays\":false,\"advancedFilters\":[{\"operatorType\":\"AdvancedFilter\"},{\"operatorType\":\"AdvancedFilter\"},{\"operatorType\":\"AdvancedFilter\"}]},\"labels\":[\"eddgssofw\",\"mzqa\",\"krmnjijpxacqqud\"],\"expirationTimeUtc\":\"2021-05-28T19:19:23Z\",\"eventDeliverySchema\":\"CustomInputSchema\",\"retryPolicy\":{\"maxDeliveryAttempts\":1365725065,\"eventTimeToLiveInMinutes\":1598677133},\"deadLetterDestination\":{\"endpointType\":\"DeadLetterDestination\"},\"deadLetterWithResourceIdentity\":{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"fimrzrtuzqogse\"},\"deadLetterDestination\":{\"endpointType\":\"DeadLetterDestination\"}}},\"id\":\"vfdnwnwmewzsyyce\",\"name\":\"zsoibjudpfrxtr\",\"type\":\"hzv\"},{\"properties\":{\"topic\":\"dwkqbrq\",\"provisioningState\":\"Creating\",\"destination\":{\"endpointType\":\"EventSubscriptionDestination\"},\"deliveryWithResourceIdentity\":{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"i\"},\"destination\":{\"endpointType\":\"EventSubscriptionDestination\"}},\"filter\":{\"subjectBeginsWith\":\"dtiirqt\",\"subjectEndsWith\":\"oaxoruzfgsqu\",\"includedEventTypes\":[\"rxxle\",\"tramxjez\"],\"isSubjectCaseSensitive\":true,\"enableAdvancedFilteringOnArrays\":true,\"advancedFilters\":[{\"operatorType\":\"AdvancedFilter\"},{\"operatorType\":\"AdvancedFilter\"}]},\"labels\":[\"cvydypatdoo\",\"ojknio\"],\"expirationTimeUtc\":\"2021-03-13T14:33:18Z\",\"eventDeliverySchema\":\"CloudEventSchemaV1_0\",\"retryPolicy\":{\"maxDeliveryAttempts\":719607713,\"eventTimeToLiveInMinutes\":1480895301},\"deadLetterDestination\":{\"endpointType\":\"DeadLetterDestination\"},\"deadLetterWithResourceIdentity\":{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"vdkcrodtj\"},\"deadLetterDestination\":{\"endpointType\":\"DeadLetterDestination\"}}},\"id\":\"wj\",\"name\":\"fltkacjv\",\"type\":\"f\"},{\"properties\":{\"topic\":\"foakgg\",\"provisioningState\":\"Canceled\",\"destination\":{\"endpointType\":\"EventSubscriptionDestination\"},\"deliveryWithResourceIdentity\":{\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentity\":\"ulpqblylsyxkqjn\"},\"destination\":{\"endpointType\":\"EventSubscriptionDestination\"}},\"filter\":{\"subjectBeginsWith\":\"vti\",\"subjectEndsWith\":\"xsdszuempsb\",\"includedEventTypes\":[\"z\"],\"isSubjectCaseSensitive\":true,\"enableAdvancedFilteringOnArrays\":false,\"advancedFilters\":[{\"operatorType\":\"AdvancedFilter\"}]},\"labels\":[\"vinvkj\",\"xdxr\",\"uukzclewyhmlw\",\"aztz\"],\"expirationTimeUtc\":\"2021-01-30T03:38:42Z\",\"eventDeliverySchema\":\"CloudEventSchemaV1_0\",\"retryPolicy\":{\"maxDeliveryAttempts\":1454988388,\"eventTimeToLiveInMinutes\":335733577},\"deadLetterDestination\":{\"endpointType\":\"DeadLetterDestination\"},\"deadLetterWithResourceIdentity\":{\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentity\":\"buy\"},\"deadLetterDestination\":{\"endpointType\":\"DeadLetterDestination\"}}},\"id\":\"zfeqztppri\",\"name\":\"lxorjaltolmncws\",\"type\":\"bqwcsdbnwdcf\"}],\"nextLink\":\"cqdpfuv\"}") - .toObject(EventSubscriptionsListResult.class); - Assertions.assertEquals(EventSubscriptionIdentityType.SYSTEM_ASSIGNED, - model.value().get(0).deliveryWithResourceIdentity().identity().type()); - Assertions.assertEquals("wmszkk", - model.value().get(0).deliveryWithResourceIdentity().identity().userAssignedIdentity()); - Assertions.assertEquals("eyfkzikfja", model.value().get(0).filter().subjectBeginsWith()); - Assertions.assertEquals("eaivxwczel", model.value().get(0).filter().subjectEndsWith()); - Assertions.assertEquals("r", model.value().get(0).filter().includedEventTypes().get(0)); - Assertions.assertEquals(false, model.value().get(0).filter().isSubjectCaseSensitive()); - Assertions.assertEquals(true, model.value().get(0).filter().enableAdvancedFilteringOnArrays()); - Assertions.assertEquals("nozj", model.value().get(0).labels().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-07T05:51:02Z"), model.value().get(0).expirationTimeUtc()); - Assertions.assertEquals(EventDeliverySchema.CUSTOM_INPUT_SCHEMA, model.value().get(0).eventDeliverySchema()); - Assertions.assertEquals(113481876, model.value().get(0).retryPolicy().maxDeliveryAttempts()); - Assertions.assertEquals(171728083, model.value().get(0).retryPolicy().eventTimeToLiveInMinutes()); - Assertions.assertEquals(EventSubscriptionIdentityType.USER_ASSIGNED, - model.value().get(0).deadLetterWithResourceIdentity().identity().type()); - Assertions.assertEquals("rvimjwosytxitcsk", - model.value().get(0).deadLetterWithResourceIdentity().identity().userAssignedIdentity()); - Assertions.assertEquals("cqdpfuv", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EventSubscriptionsListResult model = new EventSubscriptionsListResult().withValue(Arrays.asList( - new EventSubscriptionInner().withDestination(new EventSubscriptionDestination()) - .withDeliveryWithResourceIdentity( - new DeliveryWithResourceIdentity() - .withIdentity( - new EventSubscriptionIdentity().withType(EventSubscriptionIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentity("wmszkk")) - .withDestination(new EventSubscriptionDestination())) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("eyfkzikfja") - .withSubjectEndsWith("eaivxwczel") - .withIncludedEventTypes(Arrays.asList("r", "lsfeaenwabfatkld")) - .withIsSubjectCaseSensitive(false) - .withEnableAdvancedFilteringOnArrays(true) - .withAdvancedFilters(Arrays.asList(new AdvancedFilter(), new AdvancedFilter(), - new AdvancedFilter()))) - .withLabels(Arrays.asList("nozj")) - .withExpirationTimeUtc(OffsetDateTime.parse("2021-03-07T05:51:02Z")) - .withEventDeliverySchema(EventDeliverySchema.CUSTOM_INPUT_SCHEMA) - .withRetryPolicy(new RetryPolicy().withMaxDeliveryAttempts(113481876) - .withEventTimeToLiveInMinutes(171728083)) - .withDeadLetterDestination(new DeadLetterDestination()) - .withDeadLetterWithResourceIdentity(new DeadLetterWithResourceIdentity().withIdentity( - new EventSubscriptionIdentity().withType(EventSubscriptionIdentityType.USER_ASSIGNED) - .withUserAssignedIdentity("rvimjwosytxitcsk")) - .withDeadLetterDestination(new DeadLetterDestination())), - new EventSubscriptionInner().withDestination(new EventSubscriptionDestination()) - .withDeliveryWithResourceIdentity(new DeliveryWithResourceIdentity() - .withIdentity( - new EventSubscriptionIdentity().withType(EventSubscriptionIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentity("wdmjsjqbjhhyx")) - .withDestination(new EventSubscriptionDestination())) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("yc") - .withSubjectEndsWith("uhpkxkgymar") - .withIncludedEventTypes(Arrays.asList("ajxq")) - .withIsSubjectCaseSensitive(false) - .withEnableAdvancedFilteringOnArrays(false) - .withAdvancedFilters( - Arrays.asList(new AdvancedFilter(), new AdvancedFilter(), new AdvancedFilter()))) - .withLabels(Arrays.asList("eddgssofw", "mzqa", "krmnjijpxacqqud")) - .withExpirationTimeUtc(OffsetDateTime.parse("2021-05-28T19:19:23Z")) - .withEventDeliverySchema(EventDeliverySchema.CUSTOM_INPUT_SCHEMA) - .withRetryPolicy( - new RetryPolicy().withMaxDeliveryAttempts(1365725065).withEventTimeToLiveInMinutes(1598677133)) - .withDeadLetterDestination(new DeadLetterDestination()) - .withDeadLetterWithResourceIdentity(new DeadLetterWithResourceIdentity() - .withIdentity(new EventSubscriptionIdentity().withType(EventSubscriptionIdentityType.USER_ASSIGNED) - .withUserAssignedIdentity("fimrzrtuzqogse")) - .withDeadLetterDestination(new DeadLetterDestination())), - new EventSubscriptionInner().withDestination(new EventSubscriptionDestination()) - .withDeliveryWithResourceIdentity( - new DeliveryWithResourceIdentity() - .withIdentity( - new EventSubscriptionIdentity().withType(EventSubscriptionIdentityType.USER_ASSIGNED) - .withUserAssignedIdentity("i")) - .withDestination(new EventSubscriptionDestination())) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("dtiirqt") - .withSubjectEndsWith("oaxoruzfgsqu") - .withIncludedEventTypes(Arrays.asList("rxxle", "tramxjez")) - .withIsSubjectCaseSensitive(true) - .withEnableAdvancedFilteringOnArrays(true) - .withAdvancedFilters(Arrays.asList(new AdvancedFilter(), new AdvancedFilter()))) - .withLabels(Arrays.asList("cvydypatdoo", "ojknio")) - .withExpirationTimeUtc(OffsetDateTime.parse("2021-03-13T14:33:18Z")) - .withEventDeliverySchema(EventDeliverySchema.CLOUD_EVENT_SCHEMA_V1_0) - .withRetryPolicy( - new RetryPolicy().withMaxDeliveryAttempts(719607713).withEventTimeToLiveInMinutes(1480895301)) - .withDeadLetterDestination(new DeadLetterDestination()) - .withDeadLetterWithResourceIdentity( - new DeadLetterWithResourceIdentity() - .withIdentity( - new EventSubscriptionIdentity().withType(EventSubscriptionIdentityType.USER_ASSIGNED) - .withUserAssignedIdentity("vdkcrodtj")) - .withDeadLetterDestination(new DeadLetterDestination())), - new EventSubscriptionInner().withDestination(new EventSubscriptionDestination()) - .withDeliveryWithResourceIdentity(new DeliveryWithResourceIdentity() - .withIdentity( - new EventSubscriptionIdentity().withType(EventSubscriptionIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentity("ulpqblylsyxkqjn")) - .withDestination(new EventSubscriptionDestination())) - .withFilter(new EventSubscriptionFilter().withSubjectBeginsWith("vti") - .withSubjectEndsWith("xsdszuempsb") - .withIncludedEventTypes(Arrays.asList("z")) - .withIsSubjectCaseSensitive(true) - .withEnableAdvancedFilteringOnArrays(false) - .withAdvancedFilters(Arrays.asList(new AdvancedFilter()))) - .withLabels(Arrays.asList("vinvkj", "xdxr", "uukzclewyhmlw", "aztz")) - .withExpirationTimeUtc(OffsetDateTime.parse("2021-01-30T03:38:42Z")) - .withEventDeliverySchema(EventDeliverySchema.CLOUD_EVENT_SCHEMA_V1_0) - .withRetryPolicy( - new RetryPolicy().withMaxDeliveryAttempts(1454988388).withEventTimeToLiveInMinutes(335733577)) - .withDeadLetterDestination(new DeadLetterDestination()) - .withDeadLetterWithResourceIdentity( - new DeadLetterWithResourceIdentity() - .withIdentity( - new EventSubscriptionIdentity().withType(EventSubscriptionIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentity("buy")) - .withDeadLetterDestination(new DeadLetterDestination())))) - .withNextLink("cqdpfuv"); - model = BinaryData.fromObject(model).toObject(EventSubscriptionsListResult.class); - Assertions.assertEquals(EventSubscriptionIdentityType.SYSTEM_ASSIGNED, - model.value().get(0).deliveryWithResourceIdentity().identity().type()); - Assertions.assertEquals("wmszkk", - model.value().get(0).deliveryWithResourceIdentity().identity().userAssignedIdentity()); - Assertions.assertEquals("eyfkzikfja", model.value().get(0).filter().subjectBeginsWith()); - Assertions.assertEquals("eaivxwczel", model.value().get(0).filter().subjectEndsWith()); - Assertions.assertEquals("r", model.value().get(0).filter().includedEventTypes().get(0)); - Assertions.assertEquals(false, model.value().get(0).filter().isSubjectCaseSensitive()); - Assertions.assertEquals(true, model.value().get(0).filter().enableAdvancedFilteringOnArrays()); - Assertions.assertEquals("nozj", model.value().get(0).labels().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-07T05:51:02Z"), model.value().get(0).expirationTimeUtc()); - Assertions.assertEquals(EventDeliverySchema.CUSTOM_INPUT_SCHEMA, model.value().get(0).eventDeliverySchema()); - Assertions.assertEquals(113481876, model.value().get(0).retryPolicy().maxDeliveryAttempts()); - Assertions.assertEquals(171728083, model.value().get(0).retryPolicy().eventTimeToLiveInMinutes()); - Assertions.assertEquals(EventSubscriptionIdentityType.USER_ASSIGNED, - model.value().get(0).deadLetterWithResourceIdentity().identity().type()); - Assertions.assertEquals("rvimjwosytxitcsk", - model.value().get(0).deadLetterWithResourceIdentity().identity().userAssignedIdentity()); - Assertions.assertEquals("cqdpfuv", model.nextLink()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventTypeInfoTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventTypeInfoTests.java deleted file mode 100644 index a0be1342cc07..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventTypeInfoTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class EventTypeInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EventTypeInfo model = BinaryData.fromString( - "{\"kind\":\"Inline\",\"inlineEventTypes\":{\"h\":{\"description\":\"napczwlokjy\",\"displayName\":\"kkvnipjox\",\"documentationUrl\":\"nchgej\",\"dataSchemaUrl\":\"odmailzyd\"},\"jozkrwfndiod\":{\"description\":\"wyahuxinpmqnja\",\"displayName\":\"ixjsprozvcputeg\",\"documentationUrl\":\"wmfdatscmdvpjhul\",\"dataSchemaUrl\":\"uvm\"},\"fdosyg\":{\"description\":\"slwejdpvw\",\"displayName\":\"oqpsoa\",\"documentationUrl\":\"tazak\",\"dataSchemaUrl\":\"lahbcryff\"},\"tfell\":{\"description\":\"paojakhmsbzjh\",\"displayName\":\"zevdphlx\",\"documentationUrl\":\"lthqtrgqjbp\",\"dataSchemaUrl\":\"fsinzgvfcjrwzoxx\"}}}") - .toObject(EventTypeInfo.class); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.kind()); - Assertions.assertEquals("napczwlokjy", model.inlineEventTypes().get("h").description()); - Assertions.assertEquals("kkvnipjox", model.inlineEventTypes().get("h").displayName()); - Assertions.assertEquals("nchgej", model.inlineEventTypes().get("h").documentationUrl()); - Assertions.assertEquals("odmailzyd", model.inlineEventTypes().get("h").dataSchemaUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EventTypeInfo model = new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("h", - new InlineEventProperties().withDescription("napczwlokjy") - .withDisplayName("kkvnipjox") - .withDocumentationUrl("nchgej") - .withDataSchemaUrl("odmailzyd"), - "jozkrwfndiod", - new InlineEventProperties().withDescription("wyahuxinpmqnja") - .withDisplayName("ixjsprozvcputeg") - .withDocumentationUrl("wmfdatscmdvpjhul") - .withDataSchemaUrl("uvm"), - "fdosyg", - new InlineEventProperties().withDescription("slwejdpvw") - .withDisplayName("oqpsoa") - .withDocumentationUrl("tazak") - .withDataSchemaUrl("lahbcryff"), - "tfell", - new InlineEventProperties().withDescription("paojakhmsbzjh") - .withDisplayName("zevdphlx") - .withDocumentationUrl("lthqtrgqjbp") - .withDataSchemaUrl("fsinzgvfcjrwzoxx"))); - model = BinaryData.fromObject(model).toObject(EventTypeInfo.class); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.kind()); - Assertions.assertEquals("napczwlokjy", model.inlineEventTypes().get("h").description()); - Assertions.assertEquals("kkvnipjox", model.inlineEventTypes().get("h").displayName()); - Assertions.assertEquals("nchgej", model.inlineEventTypes().get("h").documentationUrl()); - Assertions.assertEquals("odmailzyd", model.inlineEventTypes().get("h").dataSchemaUrl()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventTypeInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventTypeInnerTests.java deleted file mode 100644 index 963b8636216f..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventTypeInnerTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.EventTypeInner; -import org.junit.jupiter.api.Assertions; - -public final class EventTypeInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EventTypeInner model = BinaryData.fromString( - "{\"properties\":{\"displayName\":\"qejo\",\"description\":\"vyrrleaesinuq\",\"schemaUrl\":\"jqo\",\"isInDefaultSet\":false},\"id\":\"ihehcecybmr\",\"name\":\"brjbbmpxdlvy\",\"type\":\"frexcrseqw\"}") - .toObject(EventTypeInner.class); - Assertions.assertEquals("qejo", model.displayName()); - Assertions.assertEquals("vyrrleaesinuq", model.description()); - Assertions.assertEquals("jqo", model.schemaUrl()); - Assertions.assertEquals(false, model.isInDefaultSet()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EventTypeInner model = new EventTypeInner().withDisplayName("qejo") - .withDescription("vyrrleaesinuq") - .withSchemaUrl("jqo") - .withIsInDefaultSet(false); - model = BinaryData.fromObject(model).toObject(EventTypeInner.class); - Assertions.assertEquals("qejo", model.displayName()); - Assertions.assertEquals("vyrrleaesinuq", model.description()); - Assertions.assertEquals("jqo", model.schemaUrl()); - Assertions.assertEquals(false, model.isInDefaultSet()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventTypePropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventTypePropertiesTests.java deleted file mode 100644 index 54f7853bbbea..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventTypePropertiesTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.EventTypeProperties; -import org.junit.jupiter.api.Assertions; - -public final class EventTypePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EventTypeProperties model = BinaryData.fromString( - "{\"displayName\":\"s\",\"description\":\"udgzhxogjgg\",\"schemaUrl\":\"oujkxibdafh\",\"isInDefaultSet\":true}") - .toObject(EventTypeProperties.class); - Assertions.assertEquals("s", model.displayName()); - Assertions.assertEquals("udgzhxogjgg", model.description()); - Assertions.assertEquals("oujkxibdafh", model.schemaUrl()); - Assertions.assertEquals(true, model.isInDefaultSet()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EventTypeProperties model = new EventTypeProperties().withDisplayName("s") - .withDescription("udgzhxogjgg") - .withSchemaUrl("oujkxibdafh") - .withIsInDefaultSet(true); - model = BinaryData.fromObject(model).toObject(EventTypeProperties.class); - Assertions.assertEquals("s", model.displayName()); - Assertions.assertEquals("udgzhxogjgg", model.description()); - Assertions.assertEquals("oujkxibdafh", model.schemaUrl()); - Assertions.assertEquals(true, model.isInDefaultSet()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventTypesListResultTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventTypesListResultTests.java deleted file mode 100644 index 58e1348dba76..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/EventTypesListResultTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.EventTypeInner; -import com.azure.resourcemanager.eventgrid.models.EventTypesListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EventTypesListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EventTypesListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"zknmzlanrupd\",\"description\":\"nphcnzqtpjhmqrh\",\"schemaUrl\":\"hlaiwd\",\"isInDefaultSet\":true},\"id\":\"mlzzhzdtxetlgyd\",\"name\":\"hqvlnnpxybafiqg\",\"type\":\"aarbgjekg\"},{\"properties\":{\"displayName\":\"byu\",\"description\":\"dw\",\"schemaUrl\":\"vmzegj\",\"isInDefaultSet\":true},\"id\":\"hj\",\"name\":\"rwgdnqzbrfks\",\"type\":\"zhzmtksjci\"},{\"properties\":{\"displayName\":\"gsxcdgljplkeua\",\"description\":\"tomflrytswfpf\",\"schemaUrl\":\"gycxnmskwhqjjys\",\"isInDefaultSet\":false},\"id\":\"lpshhkvpedwqslsr\",\"name\":\"mpqvwwsk\",\"type\":\"ndcbrwi\"}]}") - .toObject(EventTypesListResult.class); - Assertions.assertEquals("zknmzlanrupd", model.value().get(0).displayName()); - Assertions.assertEquals("nphcnzqtpjhmqrh", model.value().get(0).description()); - Assertions.assertEquals("hlaiwd", model.value().get(0).schemaUrl()); - Assertions.assertEquals(true, model.value().get(0).isInDefaultSet()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EventTypesListResult model = new EventTypesListResult().withValue(Arrays.asList( - new EventTypeInner().withDisplayName("zknmzlanrupd") - .withDescription("nphcnzqtpjhmqrh") - .withSchemaUrl("hlaiwd") - .withIsInDefaultSet(true), - new EventTypeInner().withDisplayName("byu") - .withDescription("dw") - .withSchemaUrl("vmzegj") - .withIsInDefaultSet(true), - new EventTypeInner().withDisplayName("gsxcdgljplkeua") - .withDescription("tomflrytswfpf") - .withSchemaUrl("gycxnmskwhqjjys") - .withIsInDefaultSet(false))); - model = BinaryData.fromObject(model).toObject(EventTypesListResult.class); - Assertions.assertEquals("zknmzlanrupd", model.value().get(0).displayName()); - Assertions.assertEquals("nphcnzqtpjhmqrh", model.value().get(0).description()); - Assertions.assertEquals("hlaiwd", model.value().get(0).schemaUrl()); - Assertions.assertEquals(true, model.value().get(0).isInDefaultSet()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ExtensionTopicInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ExtensionTopicInnerTests.java deleted file mode 100644 index 501ebbef6e0f..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ExtensionTopicInnerTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.ExtensionTopicInner; -import org.junit.jupiter.api.Assertions; - -public final class ExtensionTopicInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExtensionTopicInner model = BinaryData.fromString( - "{\"properties\":{\"description\":\"omkxf\",\"systemTopic\":\"fbhdy\"},\"id\":\"hpwpgddeimawzovg\",\"name\":\"kumuikjcjca\",\"type\":\"tbw\"}") - .toObject(ExtensionTopicInner.class); - Assertions.assertEquals("omkxf", model.description()); - Assertions.assertEquals("fbhdy", model.systemTopic()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExtensionTopicInner model = new ExtensionTopicInner().withDescription("omkxf").withSystemTopic("fbhdy"); - model = BinaryData.fromObject(model).toObject(ExtensionTopicInner.class); - Assertions.assertEquals("omkxf", model.description()); - Assertions.assertEquals("fbhdy", model.systemTopic()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ExtensionTopicPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ExtensionTopicPropertiesTests.java deleted file mode 100644 index 3f1d6fa41105..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ExtensionTopicPropertiesTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.ExtensionTopicProperties; -import org.junit.jupiter.api.Assertions; - -public final class ExtensionTopicPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExtensionTopicProperties model - = BinaryData.fromString("{\"description\":\"sqowxwc\",\"systemTopic\":\"likytwvczcswka\"}") - .toObject(ExtensionTopicProperties.class); - Assertions.assertEquals("sqowxwc", model.description()); - Assertions.assertEquals("likytwvczcswka", model.systemTopic()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExtensionTopicProperties model - = new ExtensionTopicProperties().withDescription("sqowxwc").withSystemTopic("likytwvczcswka"); - model = BinaryData.fromObject(model).toObject(ExtensionTopicProperties.class); - Assertions.assertEquals("sqowxwc", model.description()); - Assertions.assertEquals("likytwvczcswka", model.systemTopic()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ExtensionTopicsGetWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ExtensionTopicsGetWithResponseMockTests.java deleted file mode 100644 index bf958b598e89..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ExtensionTopicsGetWithResponseMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.ExtensionTopic; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ExtensionTopicsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"description\":\"h\",\"systemTopic\":\"qkzjuqwqaj\"},\"id\":\"zxpixhyo\",\"name\":\"pnfdbgsosciene\",\"type\":\"fvbennmfkbpjnr\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - ExtensionTopic response - = manager.extensionTopics().getWithResponse("gfzdgjfcycrsvl", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("h", response.description()); - Assertions.assertEquals("qkzjuqwqaj", response.systemTopic()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/HybridConnectionEventSubscriptionDestinationPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/HybridConnectionEventSubscriptionDestinationPropertiesTests.java deleted file mode 100644 index 142ab33be323..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/HybridConnectionEventSubscriptionDestinationPropertiesTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.HybridConnectionEventSubscriptionDestinationProperties; -import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeMapping; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class HybridConnectionEventSubscriptionDestinationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HybridConnectionEventSubscriptionDestinationProperties model = BinaryData.fromString( - "{\"resourceId\":\"izvoaiknaqlnuwi\",\"deliveryAttributeMappings\":[{\"type\":\"DeliveryAttributeMapping\",\"name\":\"lykwphvxz\"}]}") - .toObject(HybridConnectionEventSubscriptionDestinationProperties.class); - Assertions.assertEquals("izvoaiknaqlnuwi", model.resourceId()); - Assertions.assertEquals("lykwphvxz", model.deliveryAttributeMappings().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HybridConnectionEventSubscriptionDestinationProperties model - = new HybridConnectionEventSubscriptionDestinationProperties().withResourceId("izvoaiknaqlnuwi") - .withDeliveryAttributeMappings(Arrays.asList(new DeliveryAttributeMapping().withName("lykwphvxz"))); - model = BinaryData.fromObject(model).toObject(HybridConnectionEventSubscriptionDestinationProperties.class); - Assertions.assertEquals("izvoaiknaqlnuwi", model.resourceId()); - Assertions.assertEquals("lykwphvxz", model.deliveryAttributeMappings().get(0).name()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/HybridConnectionEventSubscriptionDestinationTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/HybridConnectionEventSubscriptionDestinationTests.java deleted file mode 100644 index 280730ef7553..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/HybridConnectionEventSubscriptionDestinationTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeMapping; -import com.azure.resourcemanager.eventgrid.models.HybridConnectionEventSubscriptionDestination; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class HybridConnectionEventSubscriptionDestinationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HybridConnectionEventSubscriptionDestination model = BinaryData.fromString( - "{\"endpointType\":\"HybridConnection\",\"properties\":{\"resourceId\":\"hmpejtlkexaonw\",\"deliveryAttributeMappings\":[{\"type\":\"DeliveryAttributeMapping\",\"name\":\"qhr\"}]}}") - .toObject(HybridConnectionEventSubscriptionDestination.class); - Assertions.assertEquals("hmpejtlkexaonw", model.resourceId()); - Assertions.assertEquals("qhr", model.deliveryAttributeMappings().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HybridConnectionEventSubscriptionDestination model - = new HybridConnectionEventSubscriptionDestination().withResourceId("hmpejtlkexaonw") - .withDeliveryAttributeMappings(Arrays.asList(new DeliveryAttributeMapping().withName("qhr"))); - model = BinaryData.fromObject(model).toObject(HybridConnectionEventSubscriptionDestination.class); - Assertions.assertEquals("hmpejtlkexaonw", model.resourceId()); - Assertions.assertEquals("qhr", model.deliveryAttributeMappings().get(0).name()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/IdentityInfoTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/IdentityInfoTests.java deleted file mode 100644 index 5d4e999b7e2a..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/IdentityInfoTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.IdentityInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.UserIdentityProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IdentityInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IdentityInfo model = BinaryData.fromString( - "{\"type\":\"None\",\"principalId\":\"u\",\"tenantId\":\"osvmk\",\"userAssignedIdentities\":{\"xnkjzkdesl\":{\"principalId\":\"qukkfp\",\"clientId\":\"mg\"}}}") - .toObject(IdentityInfo.class); - Assertions.assertEquals(IdentityType.NONE, model.type()); - Assertions.assertEquals("u", model.principalId()); - Assertions.assertEquals("osvmk", model.tenantId()); - Assertions.assertEquals("qukkfp", model.userAssignedIdentities().get("xnkjzkdesl").principalId()); - Assertions.assertEquals("mg", model.userAssignedIdentities().get("xnkjzkdesl").clientId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IdentityInfo model = new IdentityInfo().withType(IdentityType.NONE) - .withPrincipalId("u") - .withTenantId("osvmk") - .withUserAssignedIdentities( - mapOf("xnkjzkdesl", new UserIdentityProperties().withPrincipalId("qukkfp").withClientId("mg"))); - model = BinaryData.fromObject(model).toObject(IdentityInfo.class); - Assertions.assertEquals(IdentityType.NONE, model.type()); - Assertions.assertEquals("u", model.principalId()); - Assertions.assertEquals("osvmk", model.tenantId()); - Assertions.assertEquals("qukkfp", model.userAssignedIdentities().get("xnkjzkdesl").principalId()); - Assertions.assertEquals("mg", model.userAssignedIdentities().get("xnkjzkdesl").clientId()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/InboundIpRuleTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/InboundIpRuleTests.java deleted file mode 100644 index 5e1f866b5b88..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/InboundIpRuleTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.InboundIpRule; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import org.junit.jupiter.api.Assertions; - -public final class InboundIpRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InboundIpRule model - = BinaryData.fromString("{\"ipMask\":\"lbbovplw\",\"action\":\"Allow\"}").toObject(InboundIpRule.class); - Assertions.assertEquals("lbbovplw", model.ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.action()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InboundIpRule model = new InboundIpRule().withIpMask("lbbovplw").withAction(IpActionType.ALLOW); - model = BinaryData.fromObject(model).toObject(InboundIpRule.class); - Assertions.assertEquals("lbbovplw", model.ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.action()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/InlineEventPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/InlineEventPropertiesTests.java deleted file mode 100644 index bec355a515c7..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/InlineEventPropertiesTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import org.junit.jupiter.api.Assertions; - -public final class InlineEventPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InlineEventProperties model = BinaryData.fromString( - "{\"description\":\"fziton\",\"displayName\":\"qfpjk\",\"documentationUrl\":\"xofpdvhpfxxypi\",\"dataSchemaUrl\":\"nmayhuybb\"}") - .toObject(InlineEventProperties.class); - Assertions.assertEquals("fziton", model.description()); - Assertions.assertEquals("qfpjk", model.displayName()); - Assertions.assertEquals("xofpdvhpfxxypi", model.documentationUrl()); - Assertions.assertEquals("nmayhuybb", model.dataSchemaUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InlineEventProperties model = new InlineEventProperties().withDescription("fziton") - .withDisplayName("qfpjk") - .withDocumentationUrl("xofpdvhpfxxypi") - .withDataSchemaUrl("nmayhuybb"); - model = BinaryData.fromObject(model).toObject(InlineEventProperties.class); - Assertions.assertEquals("fziton", model.description()); - Assertions.assertEquals("qfpjk", model.displayName()); - Assertions.assertEquals("xofpdvhpfxxypi", model.documentationUrl()); - Assertions.assertEquals("nmayhuybb", model.dataSchemaUrl()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/InputSchemaMappingTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/InputSchemaMappingTests.java deleted file mode 100644 index 7623b07fc65d..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/InputSchemaMappingTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.InputSchemaMapping; - -public final class InputSchemaMappingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InputSchemaMapping model = BinaryData.fromString("{\"inputSchemaMappingType\":\"InputSchemaMapping\"}") - .toObject(InputSchemaMapping.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InputSchemaMapping model = new InputSchemaMapping(); - model = BinaryData.fromObject(model).toObject(InputSchemaMapping.class); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/JsonFieldTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/JsonFieldTests.java deleted file mode 100644 index 8658946a3d2d..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/JsonFieldTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.JsonField; -import org.junit.jupiter.api.Assertions; - -public final class JsonFieldTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JsonField model = BinaryData.fromString("{\"sourceField\":\"birkfpksokdg\"}").toObject(JsonField.class); - Assertions.assertEquals("birkfpksokdg", model.sourceField()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JsonField model = new JsonField().withSourceField("birkfpksokdg"); - model = BinaryData.fromObject(model).toObject(JsonField.class); - Assertions.assertEquals("birkfpksokdg", model.sourceField()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/JsonFieldWithDefaultTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/JsonFieldWithDefaultTests.java deleted file mode 100644 index 7bfd51466e06..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/JsonFieldWithDefaultTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.JsonFieldWithDefault; -import org.junit.jupiter.api.Assertions; - -public final class JsonFieldWithDefaultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JsonFieldWithDefault model - = BinaryData.fromString("{\"sourceField\":\"ewijymrhbguz\",\"defaultValue\":\"kyewnfnzhhhqo\"}") - .toObject(JsonFieldWithDefault.class); - Assertions.assertEquals("ewijymrhbguz", model.sourceField()); - Assertions.assertEquals("kyewnfnzhhhqo", model.defaultValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JsonFieldWithDefault model - = new JsonFieldWithDefault().withSourceField("ewijymrhbguz").withDefaultValue("kyewnfnzhhhqo"); - model = BinaryData.fromObject(model).toObject(JsonFieldWithDefault.class); - Assertions.assertEquals("ewijymrhbguz", model.sourceField()); - Assertions.assertEquals("kyewnfnzhhhqo", model.defaultValue()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/JsonInputSchemaMappingPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/JsonInputSchemaMappingPropertiesTests.java deleted file mode 100644 index 960576367bb0..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/JsonInputSchemaMappingPropertiesTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.JsonInputSchemaMappingProperties; -import com.azure.resourcemanager.eventgrid.models.JsonField; -import com.azure.resourcemanager.eventgrid.models.JsonFieldWithDefault; -import org.junit.jupiter.api.Assertions; - -public final class JsonInputSchemaMappingPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JsonInputSchemaMappingProperties model = BinaryData.fromString( - "{\"id\":{\"sourceField\":\"fqlwxldykalsy\"},\"topic\":{\"sourceField\":\"lnjpnnbmjksibjgs\"},\"eventTime\":{\"sourceField\":\"xahmrnadzyqegxy\"},\"eventType\":{\"sourceField\":\"inbmh\",\"defaultValue\":\"jijkgqxnhmbke\"},\"subject\":{\"sourceField\":\"aujvaa\",\"defaultValue\":\"ggiycwkdtaawxwf\"},\"dataVersion\":{\"sourceField\":\"umrrqmbzm\",\"defaultValue\":\"ratbnxwbjs\"}}") - .toObject(JsonInputSchemaMappingProperties.class); - Assertions.assertEquals("fqlwxldykalsy", model.id().sourceField()); - Assertions.assertEquals("lnjpnnbmjksibjgs", model.topic().sourceField()); - Assertions.assertEquals("xahmrnadzyqegxy", model.eventTime().sourceField()); - Assertions.assertEquals("inbmh", model.eventType().sourceField()); - Assertions.assertEquals("jijkgqxnhmbke", model.eventType().defaultValue()); - Assertions.assertEquals("aujvaa", model.subject().sourceField()); - Assertions.assertEquals("ggiycwkdtaawxwf", model.subject().defaultValue()); - Assertions.assertEquals("umrrqmbzm", model.dataVersion().sourceField()); - Assertions.assertEquals("ratbnxwbjs", model.dataVersion().defaultValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JsonInputSchemaMappingProperties model = new JsonInputSchemaMappingProperties() - .withId(new JsonField().withSourceField("fqlwxldykalsy")) - .withTopic(new JsonField().withSourceField("lnjpnnbmjksibjgs")) - .withEventTime(new JsonField().withSourceField("xahmrnadzyqegxy")) - .withEventType(new JsonFieldWithDefault().withSourceField("inbmh").withDefaultValue("jijkgqxnhmbke")) - .withSubject(new JsonFieldWithDefault().withSourceField("aujvaa").withDefaultValue("ggiycwkdtaawxwf")) - .withDataVersion(new JsonFieldWithDefault().withSourceField("umrrqmbzm").withDefaultValue("ratbnxwbjs")); - model = BinaryData.fromObject(model).toObject(JsonInputSchemaMappingProperties.class); - Assertions.assertEquals("fqlwxldykalsy", model.id().sourceField()); - Assertions.assertEquals("lnjpnnbmjksibjgs", model.topic().sourceField()); - Assertions.assertEquals("xahmrnadzyqegxy", model.eventTime().sourceField()); - Assertions.assertEquals("inbmh", model.eventType().sourceField()); - Assertions.assertEquals("jijkgqxnhmbke", model.eventType().defaultValue()); - Assertions.assertEquals("aujvaa", model.subject().sourceField()); - Assertions.assertEquals("ggiycwkdtaawxwf", model.subject().defaultValue()); - Assertions.assertEquals("umrrqmbzm", model.dataVersion().sourceField()); - Assertions.assertEquals("ratbnxwbjs", model.dataVersion().defaultValue()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/JsonInputSchemaMappingTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/JsonInputSchemaMappingTests.java deleted file mode 100644 index 6429e58cab96..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/JsonInputSchemaMappingTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.JsonField; -import com.azure.resourcemanager.eventgrid.models.JsonFieldWithDefault; -import com.azure.resourcemanager.eventgrid.models.JsonInputSchemaMapping; -import org.junit.jupiter.api.Assertions; - -public final class JsonInputSchemaMappingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JsonInputSchemaMapping model = BinaryData.fromString( - "{\"inputSchemaMappingType\":\"Json\",\"properties\":{\"id\":{\"sourceField\":\"jkutycyarnr\"},\"topic\":{\"sourceField\":\"g\"},\"eventTime\":{\"sourceField\":\"zoghktdpyczhc\"},\"eventType\":{\"sourceField\":\"cnhz\",\"defaultValue\":\"ot\"},\"subject\":{\"sourceField\":\"cfyjzp\",\"defaultValue\":\"rl\"},\"dataVersion\":{\"sourceField\":\"pqinf\",\"defaultValue\":\"pyglqdhmrjzral\"}}}") - .toObject(JsonInputSchemaMapping.class); - Assertions.assertEquals("jkutycyarnr", model.id().sourceField()); - Assertions.assertEquals("g", model.topic().sourceField()); - Assertions.assertEquals("zoghktdpyczhc", model.eventTime().sourceField()); - Assertions.assertEquals("cnhz", model.eventType().sourceField()); - Assertions.assertEquals("ot", model.eventType().defaultValue()); - Assertions.assertEquals("cfyjzp", model.subject().sourceField()); - Assertions.assertEquals("rl", model.subject().defaultValue()); - Assertions.assertEquals("pqinf", model.dataVersion().sourceField()); - Assertions.assertEquals("pyglqdhmrjzral", model.dataVersion().defaultValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JsonInputSchemaMapping model = new JsonInputSchemaMapping() - .withId(new JsonField().withSourceField("jkutycyarnr")) - .withTopic(new JsonField().withSourceField("g")) - .withEventTime(new JsonField().withSourceField("zoghktdpyczhc")) - .withEventType(new JsonFieldWithDefault().withSourceField("cnhz").withDefaultValue("ot")) - .withSubject(new JsonFieldWithDefault().withSourceField("cfyjzp").withDefaultValue("rl")) - .withDataVersion(new JsonFieldWithDefault().withSourceField("pqinf").withDefaultValue("pyglqdhmrjzral")); - model = BinaryData.fromObject(model).toObject(JsonInputSchemaMapping.class); - Assertions.assertEquals("jkutycyarnr", model.id().sourceField()); - Assertions.assertEquals("g", model.topic().sourceField()); - Assertions.assertEquals("zoghktdpyczhc", model.eventTime().sourceField()); - Assertions.assertEquals("cnhz", model.eventType().sourceField()); - Assertions.assertEquals("ot", model.eventType().defaultValue()); - Assertions.assertEquals("cfyjzp", model.subject().sourceField()); - Assertions.assertEquals("rl", model.subject().defaultValue()); - Assertions.assertEquals("pqinf", model.dataVersion().sourceField()); - Assertions.assertEquals("pyglqdhmrjzral", model.dataVersion().defaultValue()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/MonitorAlertEventSubscriptionDestinationPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/MonitorAlertEventSubscriptionDestinationPropertiesTests.java deleted file mode 100644 index 6dec89659930..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/MonitorAlertEventSubscriptionDestinationPropertiesTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.MonitorAlertEventSubscriptionDestinationProperties; -import com.azure.resourcemanager.eventgrid.models.MonitorAlertSeverity; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MonitorAlertEventSubscriptionDestinationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MonitorAlertEventSubscriptionDestinationProperties model = BinaryData - .fromString("{\"severity\":\"Sev0\",\"description\":\"l\",\"actionGroups\":[\"kbuhzaca\",\"ty\",\"tco\"]}") - .toObject(MonitorAlertEventSubscriptionDestinationProperties.class); - Assertions.assertEquals(MonitorAlertSeverity.SEV0, model.severity()); - Assertions.assertEquals("l", model.description()); - Assertions.assertEquals("kbuhzaca", model.actionGroups().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MonitorAlertEventSubscriptionDestinationProperties model - = new MonitorAlertEventSubscriptionDestinationProperties().withSeverity(MonitorAlertSeverity.SEV0) - .withDescription("l") - .withActionGroups(Arrays.asList("kbuhzaca", "ty", "tco")); - model = BinaryData.fromObject(model).toObject(MonitorAlertEventSubscriptionDestinationProperties.class); - Assertions.assertEquals(MonitorAlertSeverity.SEV0, model.severity()); - Assertions.assertEquals("l", model.description()); - Assertions.assertEquals("kbuhzaca", model.actionGroups().get(0)); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/MonitorAlertEventSubscriptionDestinationTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/MonitorAlertEventSubscriptionDestinationTests.java deleted file mode 100644 index d2a89cd25982..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/MonitorAlertEventSubscriptionDestinationTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.MonitorAlertEventSubscriptionDestination; -import com.azure.resourcemanager.eventgrid.models.MonitorAlertSeverity; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class MonitorAlertEventSubscriptionDestinationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MonitorAlertEventSubscriptionDestination model = BinaryData.fromString( - "{\"endpointType\":\"MonitorAlert\",\"properties\":{\"severity\":\"Sev3\",\"description\":\"dsxzakuejkmvb\",\"actionGroups\":[\"jofqcvovjufycs\"]}}") - .toObject(MonitorAlertEventSubscriptionDestination.class); - Assertions.assertEquals(MonitorAlertSeverity.SEV3, model.severity()); - Assertions.assertEquals("dsxzakuejkmvb", model.description()); - Assertions.assertEquals("jofqcvovjufycs", model.actionGroups().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MonitorAlertEventSubscriptionDestination model - = new MonitorAlertEventSubscriptionDestination().withSeverity(MonitorAlertSeverity.SEV3) - .withDescription("dsxzakuejkmvb") - .withActionGroups(Arrays.asList("jofqcvovjufycs")); - model = BinaryData.fromObject(model).toObject(MonitorAlertEventSubscriptionDestination.class); - Assertions.assertEquals(MonitorAlertSeverity.SEV3, model.severity()); - Assertions.assertEquals("dsxzakuejkmvb", model.description()); - Assertions.assertEquals("jofqcvovjufycs", model.actionGroups().get(0)); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceSkuTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceSkuTests.java deleted file mode 100644 index c2e8b9ca6047..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceSkuTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.NamespaceSku; -import com.azure.resourcemanager.eventgrid.models.SkuName; -import org.junit.jupiter.api.Assertions; - -public final class NamespaceSkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NamespaceSku model - = BinaryData.fromString("{\"name\":\"Standard\",\"capacity\":941939967}").toObject(NamespaceSku.class); - Assertions.assertEquals(SkuName.STANDARD, model.name()); - Assertions.assertEquals(941939967, model.capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NamespaceSku model = new NamespaceSku().withName(SkuName.STANDARD).withCapacity(941939967); - model = BinaryData.fromObject(model).toObject(NamespaceSku.class); - Assertions.assertEquals(SkuName.STANDARD, model.name()); - Assertions.assertEquals(941939967, model.capacity()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicEventSubscriptionDestinationPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicEventSubscriptionDestinationPropertiesTests.java deleted file mode 100644 index f25efef4118f..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicEventSubscriptionDestinationPropertiesTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.NamespaceTopicEventSubscriptionDestinationProperties; -import org.junit.jupiter.api.Assertions; - -public final class NamespaceTopicEventSubscriptionDestinationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NamespaceTopicEventSubscriptionDestinationProperties model - = BinaryData.fromString("{\"resourceId\":\"lbemyej\"}") - .toObject(NamespaceTopicEventSubscriptionDestinationProperties.class); - Assertions.assertEquals("lbemyej", model.resourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NamespaceTopicEventSubscriptionDestinationProperties model - = new NamespaceTopicEventSubscriptionDestinationProperties().withResourceId("lbemyej"); - model = BinaryData.fromObject(model).toObject(NamespaceTopicEventSubscriptionDestinationProperties.class); - Assertions.assertEquals("lbemyej", model.resourceId()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicEventSubscriptionDestinationTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicEventSubscriptionDestinationTests.java deleted file mode 100644 index 3b220de5452e..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicEventSubscriptionDestinationTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.NamespaceTopicEventSubscriptionDestination; -import org.junit.jupiter.api.Assertions; - -public final class NamespaceTopicEventSubscriptionDestinationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NamespaceTopicEventSubscriptionDestination model = BinaryData - .fromString("{\"endpointType\":\"NamespaceTopic\",\"properties\":{\"resourceId\":\"uxegthortudawlpj\"}}") - .toObject(NamespaceTopicEventSubscriptionDestination.class); - Assertions.assertEquals("uxegthortudawlpj", model.resourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NamespaceTopicEventSubscriptionDestination model - = new NamespaceTopicEventSubscriptionDestination().withResourceId("uxegthortudawlpj"); - model = BinaryData.fromObject(model).toObject(NamespaceTopicEventSubscriptionDestination.class); - Assertions.assertEquals("uxegthortudawlpj", model.resourceId()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicEventSubscriptionsDeleteMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicEventSubscriptionsDeleteMockTests.java deleted file mode 100644 index e2aa94c480b9..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicEventSubscriptionsDeleteMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NamespaceTopicEventSubscriptionsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.namespaceTopicEventSubscriptions() - .delete("ikcdrdaasax", "obsmf", "wiyjvzuko", "r", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicEventSubscriptionsGetDeliveryAttributesWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicEventSubscriptionsGetDeliveryAttributesWithResponseMockTests.java deleted file mode 100644 index b786d6e7a344..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicEventSubscriptionsGetDeliveryAttributesWithResponseMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeListResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NamespaceTopicEventSubscriptionsGetDeliveryAttributesWithResponseMockTests { - @Test - public void testGetDeliveryAttributesWithResponse() throws Exception { - String responseStr = "{\"value\":[{\"type\":\"DeliveryAttributeMapping\",\"name\":\"fupetasvv\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - DeliveryAttributeListResult response = manager.namespaceTopicEventSubscriptions() - .getDeliveryAttributesWithResponse("pqagynoiprn", "calincryqxz", "aqzi", "mqimiymqru", - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("fupetasvv", response.value().get(0).name()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicEventSubscriptionsGetFullUrlWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicEventSubscriptionsGetFullUrlWithResponseMockTests.java deleted file mode 100644 index 2ef25c17fb62..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicEventSubscriptionsGetFullUrlWithResponseMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.SubscriptionFullUrl; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NamespaceTopicEventSubscriptionsGetFullUrlWithResponseMockTests { - @Test - public void testGetFullUrlWithResponse() throws Exception { - String responseStr = "{\"endpointUrl\":\"hlutixmqrudjizc\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - SubscriptionFullUrl response = manager.namespaceTopicEventSubscriptions() - .getFullUrlWithResponse("qsbp", "flanfkgxsyao", "uzowpuohdkcpr", "ukxrzti", - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("hlutixmqrudjizc", response.endpointUrl()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicInnerTests.java deleted file mode 100644 index 603ba398bd07..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicInnerTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.NamespaceTopicInner; -import com.azure.resourcemanager.eventgrid.models.EventInputSchema; -import com.azure.resourcemanager.eventgrid.models.PublisherType; -import org.junit.jupiter.api.Assertions; - -public final class NamespaceTopicInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NamespaceTopicInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Deleted\",\"publisherType\":\"Custom\",\"inputSchema\":\"CloudEventSchemaV1_0\",\"eventRetentionInDays\":1318524891},\"id\":\"hernntiewdjc\",\"name\":\"bquwrbehw\",\"type\":\"gohbuffkmrq\"}") - .toObject(NamespaceTopicInner.class); - Assertions.assertEquals(PublisherType.CUSTOM, model.publisherType()); - Assertions.assertEquals(EventInputSchema.CLOUD_EVENT_SCHEMA_V1_0, model.inputSchema()); - Assertions.assertEquals(1318524891, model.eventRetentionInDays()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NamespaceTopicInner model = new NamespaceTopicInner().withPublisherType(PublisherType.CUSTOM) - .withInputSchema(EventInputSchema.CLOUD_EVENT_SCHEMA_V1_0) - .withEventRetentionInDays(1318524891); - model = BinaryData.fromObject(model).toObject(NamespaceTopicInner.class); - Assertions.assertEquals(PublisherType.CUSTOM, model.publisherType()); - Assertions.assertEquals(EventInputSchema.CLOUD_EVENT_SCHEMA_V1_0, model.inputSchema()); - Assertions.assertEquals(1318524891, model.eventRetentionInDays()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicPropertiesTests.java deleted file mode 100644 index 0aefab3d7d92..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicPropertiesTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.NamespaceTopicProperties; -import com.azure.resourcemanager.eventgrid.models.EventInputSchema; -import com.azure.resourcemanager.eventgrid.models.PublisherType; -import org.junit.jupiter.api.Assertions; - -public final class NamespaceTopicPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NamespaceTopicProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Deleted\",\"publisherType\":\"Custom\",\"inputSchema\":\"CloudEventSchemaV1_0\",\"eventRetentionInDays\":851546423}") - .toObject(NamespaceTopicProperties.class); - Assertions.assertEquals(PublisherType.CUSTOM, model.publisherType()); - Assertions.assertEquals(EventInputSchema.CLOUD_EVENT_SCHEMA_V1_0, model.inputSchema()); - Assertions.assertEquals(851546423, model.eventRetentionInDays()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NamespaceTopicProperties model = new NamespaceTopicProperties().withPublisherType(PublisherType.CUSTOM) - .withInputSchema(EventInputSchema.CLOUD_EVENT_SCHEMA_V1_0) - .withEventRetentionInDays(851546423); - model = BinaryData.fromObject(model).toObject(NamespaceTopicProperties.class); - Assertions.assertEquals(PublisherType.CUSTOM, model.publisherType()); - Assertions.assertEquals(EventInputSchema.CLOUD_EVENT_SCHEMA_V1_0, model.inputSchema()); - Assertions.assertEquals(851546423, model.eventRetentionInDays()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicUpdateParameterPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicUpdateParameterPropertiesTests.java deleted file mode 100644 index 3de8b9f3fd3c..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicUpdateParameterPropertiesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.NamespaceTopicUpdateParameterProperties; -import org.junit.jupiter.api.Assertions; - -public final class NamespaceTopicUpdateParameterPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NamespaceTopicUpdateParameterProperties model = BinaryData.fromString("{\"eventRetentionInDays\":647279453}") - .toObject(NamespaceTopicUpdateParameterProperties.class); - Assertions.assertEquals(647279453, model.eventRetentionInDays()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NamespaceTopicUpdateParameterProperties model - = new NamespaceTopicUpdateParameterProperties().withEventRetentionInDays(647279453); - model = BinaryData.fromObject(model).toObject(NamespaceTopicUpdateParameterProperties.class); - Assertions.assertEquals(647279453, model.eventRetentionInDays()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicUpdateParametersTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicUpdateParametersTests.java deleted file mode 100644 index f33fa6c223ea..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicUpdateParametersTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.NamespaceTopicUpdateParameters; -import org.junit.jupiter.api.Assertions; - -public final class NamespaceTopicUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NamespaceTopicUpdateParameters model - = BinaryData.fromString("{\"properties\":{\"eventRetentionInDays\":1425672710}}") - .toObject(NamespaceTopicUpdateParameters.class); - Assertions.assertEquals(1425672710, model.eventRetentionInDays()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NamespaceTopicUpdateParameters model - = new NamespaceTopicUpdateParameters().withEventRetentionInDays(1425672710); - model = BinaryData.fromObject(model).toObject(NamespaceTopicUpdateParameters.class); - Assertions.assertEquals(1425672710, model.eventRetentionInDays()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicsCreateOrUpdateMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicsCreateOrUpdateMockTests.java deleted file mode 100644 index 167ba80422c7..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.EventInputSchema; -import com.azure.resourcemanager.eventgrid.models.NamespaceTopic; -import com.azure.resourcemanager.eventgrid.models.PublisherType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NamespaceTopicsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"publisherType\":\"Custom\",\"inputSchema\":\"CloudEventSchemaV1_0\",\"eventRetentionInDays\":829869098},\"id\":\"yybzoxlvoc\",\"name\":\"tvdxxhe\",\"type\":\"gmlilwzghjhjvmab\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - NamespaceTopic response = manager.namespaceTopics() - .define("h") - .withExistingNamespace("iflikyypzkgxfx", "myrqsdbpokszan") - .withPublisherType(PublisherType.CUSTOM) - .withInputSchema(EventInputSchema.CLOUD_EVENT_SCHEMA_V1_0) - .withEventRetentionInDays(566598489) - .create(); - - Assertions.assertEquals(PublisherType.CUSTOM, response.publisherType()); - Assertions.assertEquals(EventInputSchema.CLOUD_EVENT_SCHEMA_V1_0, response.inputSchema()); - Assertions.assertEquals(829869098, response.eventRetentionInDays()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicsDeleteMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicsDeleteMockTests.java deleted file mode 100644 index 6d7de9c02468..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NamespaceTopicsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.namespaceTopics().delete("hgjsysmvxo", "gwxfkzsi", "cuvbdujgcwxvec", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicsGetWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicsGetWithResponseMockTests.java deleted file mode 100644 index 9411e8ddba4c..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicsGetWithResponseMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.EventInputSchema; -import com.azure.resourcemanager.eventgrid.models.NamespaceTopic; -import com.azure.resourcemanager.eventgrid.models.PublisherType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NamespaceTopicsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Failed\",\"publisherType\":\"Custom\",\"inputSchema\":\"CloudEventSchemaV1_0\",\"eventRetentionInDays\":1566722268},\"id\":\"iwdhdmncgbfzu\",\"name\":\"cstu\",\"type\":\"mlhxdfbklcii\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - NamespaceTopic response = manager.namespaceTopics() - .getWithResponse("kgd", "hjkrukizyhgs", "tnqsktx", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PublisherType.CUSTOM, response.publisherType()); - Assertions.assertEquals(EventInputSchema.CLOUD_EVENT_SCHEMA_V1_0, response.inputSchema()); - Assertions.assertEquals(1566722268, response.eventRetentionInDays()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicsListByNamespaceMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicsListByNamespaceMockTests.java deleted file mode 100644 index aab9fd4064f1..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicsListByNamespaceMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.EventInputSchema; -import com.azure.resourcemanager.eventgrid.models.NamespaceTopic; -import com.azure.resourcemanager.eventgrid.models.PublisherType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NamespaceTopicsListByNamespaceMockTests { - @Test - public void testListByNamespace() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"publisherType\":\"Custom\",\"inputSchema\":\"CloudEventSchemaV1_0\",\"eventRetentionInDays\":527339411},\"id\":\"iqrxhaclcdosq\",\"name\":\"ptjq\",\"type\":\"kifmmainw\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.namespaceTopics() - .listByNamespace("bwjtrdx", "izagbbgiar", "sy", 646191153, com.azure.core.util.Context.NONE); - - Assertions.assertEquals(PublisherType.CUSTOM, response.iterator().next().publisherType()); - Assertions.assertEquals(EventInputSchema.CLOUD_EVENT_SCHEMA_V1_0, response.iterator().next().inputSchema()); - Assertions.assertEquals(527339411, response.iterator().next().eventRetentionInDays()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicsListResultTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicsListResultTests.java deleted file mode 100644 index 617dc381c6c2..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespaceTopicsListResultTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.NamespaceTopicInner; -import com.azure.resourcemanager.eventgrid.models.EventInputSchema; -import com.azure.resourcemanager.eventgrid.models.NamespaceTopicsListResult; -import com.azure.resourcemanager.eventgrid.models.PublisherType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NamespaceTopicsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NamespaceTopicsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"publisherType\":\"Custom\",\"inputSchema\":\"CloudEventSchemaV1_0\",\"eventRetentionInDays\":445879070},\"id\":\"znmwcp\",\"name\":\"guaadraufactkahz\",\"type\":\"v\"},{\"properties\":{\"provisioningState\":\"Failed\",\"publisherType\":\"Custom\",\"inputSchema\":\"CloudEventSchemaV1_0\",\"eventRetentionInDays\":113664127},\"id\":\"neekulfg\",\"name\":\"lqubkwdlen\",\"type\":\"d\"},{\"properties\":{\"provisioningState\":\"Failed\",\"publisherType\":\"Custom\",\"inputSchema\":\"CloudEventSchemaV1_0\",\"eventRetentionInDays\":1391652347},\"id\":\"o\",\"name\":\"minyflnorwm\",\"type\":\"uvwpklvxwmyg\"}],\"nextLink\":\"pgpqchiszepnnb\"}") - .toObject(NamespaceTopicsListResult.class); - Assertions.assertEquals(PublisherType.CUSTOM, model.value().get(0).publisherType()); - Assertions.assertEquals(EventInputSchema.CLOUD_EVENT_SCHEMA_V1_0, model.value().get(0).inputSchema()); - Assertions.assertEquals(445879070, model.value().get(0).eventRetentionInDays()); - Assertions.assertEquals("pgpqchiszepnnb", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NamespaceTopicsListResult model = new NamespaceTopicsListResult().withValue(Arrays.asList( - new NamespaceTopicInner().withPublisherType(PublisherType.CUSTOM) - .withInputSchema(EventInputSchema.CLOUD_EVENT_SCHEMA_V1_0) - .withEventRetentionInDays(445879070), - new NamespaceTopicInner().withPublisherType(PublisherType.CUSTOM) - .withInputSchema(EventInputSchema.CLOUD_EVENT_SCHEMA_V1_0) - .withEventRetentionInDays(113664127), - new NamespaceTopicInner().withPublisherType(PublisherType.CUSTOM) - .withInputSchema(EventInputSchema.CLOUD_EVENT_SCHEMA_V1_0) - .withEventRetentionInDays(1391652347))) - .withNextLink("pgpqchiszepnnb"); - model = BinaryData.fromObject(model).toObject(NamespaceTopicsListResult.class); - Assertions.assertEquals(PublisherType.CUSTOM, model.value().get(0).publisherType()); - Assertions.assertEquals(EventInputSchema.CLOUD_EVENT_SCHEMA_V1_0, model.value().get(0).inputSchema()); - Assertions.assertEquals(445879070, model.value().get(0).eventRetentionInDays()); - Assertions.assertEquals("pgpqchiszepnnb", model.nextLink()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespacesCreateOrUpdateMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespacesCreateOrUpdateMockTests.java deleted file mode 100644 index e63046b52beb..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespacesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.eventgrid.models.ConnectionState; -import com.azure.resourcemanager.eventgrid.models.CustomDomainConfiguration; -import com.azure.resourcemanager.eventgrid.models.CustomDomainIdentity; -import com.azure.resourcemanager.eventgrid.models.CustomDomainValidationState; -import com.azure.resourcemanager.eventgrid.models.DynamicRoutingEnrichment; -import com.azure.resourcemanager.eventgrid.models.IdentityInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.InboundIpRule; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.Namespace; -import com.azure.resourcemanager.eventgrid.models.NamespaceSku; -import com.azure.resourcemanager.eventgrid.models.PrivateEndpoint; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.ResourceProvisioningState; -import com.azure.resourcemanager.eventgrid.models.RoutingEnrichments; -import com.azure.resourcemanager.eventgrid.models.RoutingIdentityInfo; -import com.azure.resourcemanager.eventgrid.models.RoutingIdentityType; -import com.azure.resourcemanager.eventgrid.models.SkuName; -import com.azure.resourcemanager.eventgrid.models.StaticRoutingEnrichment; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import com.azure.resourcemanager.eventgrid.models.TopicSpacesConfiguration; -import com.azure.resourcemanager.eventgrid.models.TopicSpacesConfigurationState; -import com.azure.resourcemanager.eventgrid.models.TopicsConfiguration; -import com.azure.resourcemanager.eventgrid.models.UserIdentityProperties; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NamespacesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"jjsbcmlzaahzbhur\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Succeeded\"},\"id\":\"olirhhmojusuz\",\"name\":\"fjzc\",\"type\":\"aaxoialahfxwcc\"},{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"ukmkczynu\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"eqshavljqkxyrqol\",\"name\":\"thbb\",\"type\":\"kgzukwdrnzkjth\"},{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"ncjmlfuyf\",\"bpfiddhlrufz\",\"qyjmqrfuioc\",\"selqkrsazrhxud\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Canceled\"},\"id\":\"tffisjmr\",\"name\":\"khmwdmd\",\"type\":\"gyqi\"}],\"provisioningState\":\"Succeeded\",\"topicsConfiguration\":{\"hostname\":\"jawh\",\"customDomains\":[{\"fullyQualifiedDomainName\":\"nqf\",\"validationState\":\"ErrorRetrievingDnsRecord\",\"identity\":{},\"certificateUrl\":\"vmyolcaym\",\"expectedTxtRecordName\":\"htvsnvl\",\"expectedTxtRecordValue\":\"dnzyzawatuwqko\"},{\"fullyQualifiedDomainName\":\"bczothymgobllms\",\"validationState\":\"Approved\",\"identity\":{},\"certificateUrl\":\"maanea\",\"expectedTxtRecordName\":\"t\",\"expectedTxtRecordValue\":\"obcyanrfvqtvk\"},{\"fullyQualifiedDomainName\":\"gvoogxkfna\",\"validationState\":\"Pending\",\"identity\":{},\"certificateUrl\":\"hccto\",\"expectedTxtRecordName\":\"o\",\"expectedTxtRecordValue\":\"rnskby\"},{\"fullyQualifiedDomainName\":\"quhczygxvh\",\"validationState\":\"Approved\",\"identity\":{},\"certificateUrl\":\"cxq\",\"expectedTxtRecordName\":\"hscozawmvgxsmpk\",\"expectedTxtRecordValue\":\"wirfljf\"}]},\"topicSpacesConfiguration\":{\"state\":\"Disabled\",\"routeTopicResourceId\":\"uoxudnmckaprh\",\"hostname\":\"qiijgenc\",\"routingEnrichments\":{\"static\":[{\"valueType\":\"StaticRoutingEnrichment\"},{\"valueType\":\"StaticRoutingEnrichment\"},{\"valueType\":\"StaticRoutingEnrichment\"},{\"valueType\":\"StaticRoutingEnrichment\"}],\"dynamic\":[{},{},{}]},\"maximumSessionExpiryInHours\":579117405,\"maximumClientSessionsPerAuthenticationName\":1020255281,\"routingIdentityInfo\":{\"type\":\"None\",\"userAssignedIdentity\":\"wlt\"},\"customDomains\":[{\"fullyQualifiedDomainName\":\"whldxwhie\",\"validationState\":\"ErrorRetrievingDnsRecord\",\"identity\":{},\"certificateUrl\":\"smfx\",\"expectedTxtRecordName\":\"vprstv\",\"expectedTxtRecordValue\":\"tbfjtdyotnplf\"},{\"fullyQualifiedDomainName\":\"cqoccq\",\"validationState\":\"Pending\",\"identity\":{},\"certificateUrl\":\"tjtdrhutfd\",\"expectedTxtRecordName\":\"dtxopgehpadkmdzg\",\"expectedTxtRecordValue\":\"zxvctkbbxuharls\"},{\"fullyQualifiedDomainName\":\"rncclabv\",\"validationState\":\"Approved\",\"identity\":{},\"certificateUrl\":\"uxx\",\"expectedTxtRecordName\":\"bmyqjog\",\"expectedTxtRecordValue\":\"saidjan\"},{\"fullyQualifiedDomainName\":\"rmov\",\"validationState\":\"ErrorRetrievingDnsRecord\",\"identity\":{},\"certificateUrl\":\"ntujmoilunwemhd\",\"expectedTxtRecordName\":\"ljslkyozd\",\"expectedTxtRecordValue\":\"zjuegrh\"}]},\"isZoneRedundant\":false,\"publicNetworkAccess\":\"Enabled\",\"inboundIpRules\":[{\"ipMask\":\"vxjnxv\",\"action\":\"Allow\"}],\"minimumTlsVersionAllowed\":\"1.1\"},\"sku\":{\"name\":\"Standard\",\"capacity\":782366599},\"identity\":{\"type\":\"None\",\"principalId\":\"bj\",\"tenantId\":\"wmtqsmoxsaz\",\"userAssignedIdentities\":{\"nqbdnddbboz\":{\"principalId\":\"gwecywnfysz\",\"clientId\":\"czs\"},\"jhqlfmsib\":{\"principalId\":\"vrmkjmyitrchwu\",\"clientId\":\"xeeihtpmno\"}}},\"location\":\"yrfgxkyd\",\"tags\":{\"lakxpejpewp\":\"pgfqvmtyw\"},\"id\":\"jlfxampqcrzgeuq\",\"name\":\"b\",\"type\":\"iatwfaujegqdtadr\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - Namespace response - = manager.namespaces() - .define("bouguxtndopgjt") - .withRegion("tzxnmxsdobygoog") - .withExistingResourceGroup("ciqgjjrlhiqlwixv") - .withTags(mapOf("csa", "pjxvazyjf", "sgm", "djnosdkvibf", "ktz", "trnzpducdaaktu", "wkppnwyytfvp", - "oimyfpqd")) - .withSku(new NamespaceSku().withName(SkuName.STANDARD).withCapacity(1193531622)) - .withIdentity(new IdentityInfo().withType(IdentityType.NONE) - .withPrincipalId("ukiymjzpwdlvwt") - .withTenantId("smosaonhqnam") - .withUserAssignedIdentities(mapOf("jlcyizy", - new UserIdentityProperties().withPrincipalId("tassaekewna").withClientId("ajbk"), "ecpwgo", - new UserIdentityProperties().withPrincipalId("cvxodkrvfsxxby").withClientId("sqlv")))) - .withPrivateEndpointConnections(Arrays.asList( - new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) - .withGroupIds(Arrays.asList("pdlndbeaqbkixvv")) - .withPrivateLinkServiceConnectionState(new ConnectionState()) - .withProvisioningState(ResourceProvisioningState.CANCELED), - new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) - .withGroupIds(Arrays.asList("yezolgjzmicu")) - .withPrivateLinkServiceConnectionState(new ConnectionState()) - .withProvisioningState(ResourceProvisioningState.CANCELED), - new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) - .withGroupIds(Arrays.asList("aatsdohzniucb", "aombwiinjdl", "wktlepowa", "vqxuajgcqw")) - .withPrivateLinkServiceConnectionState(new ConnectionState()) - .withProvisioningState(ResourceProvisioningState.CREATING), - new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint()) - .withGroupIds(Arrays.asList("x", "br", "lttfyhc", "jwsuoardnag")) - .withPrivateLinkServiceConnectionState(new ConnectionState()) - .withProvisioningState(ResourceProvisioningState.UPDATING))) - .withTopicsConfiguration(new TopicsConfiguration().withCustomDomains(Arrays.asList( - new CustomDomainConfiguration().withFullyQualifiedDomainName("qzgihotjecohmx") - .withValidationState(CustomDomainValidationState.ERROR_RETRIEVING_DNS_RECORD) - .withIdentity(new CustomDomainIdentity()) - .withCertificateUrl("skapbxwie") - .withExpectedTxtRecordName("uyader") - .withExpectedTxtRecordValue("fokyks"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("imyc") - .withValidationState(CustomDomainValidationState.PENDING) - .withIdentity(new CustomDomainIdentity()) - .withCertificateUrl("cxzznnuife") - .withExpectedTxtRecordName("ejeg") - .withExpectedTxtRecordValue("kjguwrjmwvvbtuq"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("xximwgxq") - .withValidationState(CustomDomainValidationState.ERROR_RETRIEVING_DNS_RECORD) - .withIdentity(new CustomDomainIdentity()) - .withCertificateUrl("tjgxieqfky") - .withExpectedTxtRecordName("iwvjaqupbyyn") - .withExpectedTxtRecordValue("kpajbmgeume"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("mj") - .withValidationState(CustomDomainValidationState.ERROR_RETRIEVING_DNS_RECORD) - .withIdentity(new CustomDomainIdentity()) - .withCertificateUrl("cwkqmtxape") - .withExpectedTxtRecordName("scrpilgftrqrej") - .withExpectedTxtRecordValue("ahuqi")))) - .withTopicSpacesConfiguration(new TopicSpacesConfiguration() - .withState(TopicSpacesConfigurationState.ENABLED) - .withRouteTopicResourceId("lfxlmuifmuadj") - .withRoutingEnrichments(new RoutingEnrichments() - .withStaticProperty(Arrays.asList(new StaticRoutingEnrichment(), new StaticRoutingEnrichment(), - new StaticRoutingEnrichment(), new StaticRoutingEnrichment())) - .withDynamic(Arrays.asList(new DynamicRoutingEnrichment(), new DynamicRoutingEnrichment(), - new DynamicRoutingEnrichment(), new DynamicRoutingEnrichment()))) - .withMaximumSessionExpiryInHours(1495134514) - .withMaximumClientSessionsPerAuthenticationName(493687960) - .withRoutingIdentityInfo(new RoutingIdentityInfo().withType(RoutingIdentityType.USER_ASSIGNED) - .withUserAssignedIdentity("bnxgzt")) - .withCustomDomains(Arrays.asList( - new CustomDomainConfiguration().withFullyQualifiedDomainName("ctjchfjv") - .withValidationState(CustomDomainValidationState.APPROVED) - .withIdentity(new CustomDomainIdentity()) - .withCertificateUrl("ebecuvlbefv") - .withExpectedTxtRecordName("ljkxpylrwoxz") - .withExpectedTxtRecordValue("psyxjije"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("pdvrbkerdkdkga") - .withValidationState(CustomDomainValidationState.ERROR_RETRIEVING_DNS_RECORD) - .withIdentity(new CustomDomainIdentity()) - .withCertificateUrl("ildfk") - .withExpectedTxtRecordName("feygzqp") - .withExpectedTxtRecordValue("isf")))) - .withIsZoneRedundant(true) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withInboundIpRules( - Arrays.asList(new InboundIpRule().withIpMask("xumentqontwhy").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("ulwivqtowlhlsy").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("ajasqubfajcywhjq").withAction(IpActionType.ALLOW))) - .withMinimumTlsVersionAllowed(TlsVersion.ONE_ZERO) - .create(); - - Assertions.assertEquals("yrfgxkyd", response.location()); - Assertions.assertEquals("pgfqvmtyw", response.tags().get("lakxpejpewp")); - Assertions.assertEquals(SkuName.STANDARD, response.sku().name()); - Assertions.assertEquals(782366599, response.sku().capacity()); - Assertions.assertEquals(IdentityType.NONE, response.identity().type()); - Assertions.assertEquals("bj", response.identity().principalId()); - Assertions.assertEquals("wmtqsmoxsaz", response.identity().tenantId()); - Assertions.assertEquals("gwecywnfysz", - response.identity().userAssignedIdentities().get("nqbdnddbboz").principalId()); - Assertions.assertEquals("czs", response.identity().userAssignedIdentities().get("nqbdnddbboz").clientId()); - Assertions.assertEquals("jjsbcmlzaahzbhur", response.privateEndpointConnections().get(0).groupIds().get(0)); - Assertions.assertEquals(ResourceProvisioningState.SUCCEEDED, - response.privateEndpointConnections().get(0).provisioningState()); - Assertions.assertEquals("nqf", - response.topicsConfiguration().customDomains().get(0).fullyQualifiedDomainName()); - Assertions.assertEquals(CustomDomainValidationState.ERROR_RETRIEVING_DNS_RECORD, - response.topicsConfiguration().customDomains().get(0).validationState()); - Assertions.assertEquals("vmyolcaym", response.topicsConfiguration().customDomains().get(0).certificateUrl()); - Assertions.assertEquals("htvsnvl", - response.topicsConfiguration().customDomains().get(0).expectedTxtRecordName()); - Assertions.assertEquals("dnzyzawatuwqko", - response.topicsConfiguration().customDomains().get(0).expectedTxtRecordValue()); - Assertions.assertEquals(TopicSpacesConfigurationState.DISABLED, response.topicSpacesConfiguration().state()); - Assertions.assertEquals("uoxudnmckaprh", response.topicSpacesConfiguration().routeTopicResourceId()); - Assertions.assertEquals(579117405, response.topicSpacesConfiguration().maximumSessionExpiryInHours()); - Assertions.assertEquals(1020255281, - response.topicSpacesConfiguration().maximumClientSessionsPerAuthenticationName()); - Assertions.assertEquals(RoutingIdentityType.NONE, - response.topicSpacesConfiguration().routingIdentityInfo().type()); - Assertions.assertEquals("wlt", - response.topicSpacesConfiguration().routingIdentityInfo().userAssignedIdentity()); - Assertions.assertEquals("whldxwhie", - response.topicSpacesConfiguration().customDomains().get(0).fullyQualifiedDomainName()); - Assertions.assertEquals(CustomDomainValidationState.ERROR_RETRIEVING_DNS_RECORD, - response.topicSpacesConfiguration().customDomains().get(0).validationState()); - Assertions.assertEquals("smfx", response.topicSpacesConfiguration().customDomains().get(0).certificateUrl()); - Assertions.assertEquals("vprstv", - response.topicSpacesConfiguration().customDomains().get(0).expectedTxtRecordName()); - Assertions.assertEquals("tbfjtdyotnplf", - response.topicSpacesConfiguration().customDomains().get(0).expectedTxtRecordValue()); - Assertions.assertEquals(false, response.isZoneRedundant()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, response.publicNetworkAccess()); - Assertions.assertEquals("vxjnxv", response.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, response.inboundIpRules().get(0).action()); - Assertions.assertEquals(TlsVersion.ONE_ONE, response.minimumTlsVersionAllowed()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespacesDeleteMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespacesDeleteMockTests.java deleted file mode 100644 index 850f85bc8463..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespacesDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NamespacesDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.namespaces().delete("ogatmoljiy", "mpinmzvfkneerzzt", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespacesGetByResourceGroupWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespacesGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index effbcbe1d735..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespacesGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.CustomDomainValidationState; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.Namespace; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.ResourceProvisioningState; -import com.azure.resourcemanager.eventgrid.models.RoutingIdentityType; -import com.azure.resourcemanager.eventgrid.models.SkuName; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import com.azure.resourcemanager.eventgrid.models.TopicSpacesConfigurationState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NamespacesGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"orbjg\",\"nzjotvmr\",\"khlobvvjbhvhdi\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Creating\"},\"id\":\"luiyuosnuudte\",\"name\":\"vhyibdrqrsw\",\"type\":\"buubpyrowt\"},{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"fwfqchvcze\",\"j\",\"nctagfyvrtpqpem\",\"z\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"epdqhqyhwq\",\"name\":\"e\",\"type\":\"vx\"},{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"mzeoxinhgre\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Updating\"},\"id\":\"h\",\"name\":\"puz\",\"type\":\"pceeznzangprbf\"},{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"lbciphmsexro\",\"rndktx\",\"vonfeeqgpkr\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Failed\"},\"id\":\"gnixxowwzkyfwnw\",\"name\":\"iwxeiicrmpep\",\"type\":\"ldmaxxijvskwsdgk\"}],\"provisioningState\":\"CreateFailed\",\"topicsConfiguration\":{\"hostname\":\"wrasekw\",\"customDomains\":[{\"fullyQualifiedDomainName\":\"voinwo\",\"validationState\":\"ErrorRetrievingDnsRecord\",\"identity\":{},\"certificateUrl\":\"yxqicladv\",\"expectedTxtRecordName\":\"davuqmcbyms\",\"expectedTxtRecordValue\":\"bjlquv\"}]},\"topicSpacesConfiguration\":{\"state\":\"Disabled\",\"routeTopicResourceId\":\"umvpsimioyoigl\",\"hostname\":\"iqwnnraclibbfq\",\"routingEnrichments\":{\"static\":[{\"valueType\":\"StaticRoutingEnrichment\"},{\"valueType\":\"StaticRoutingEnrichment\"}],\"dynamic\":[{},{}]},\"maximumSessionExpiryInHours\":1536942635,\"maximumClientSessionsPerAuthenticationName\":1948229122,\"routingIdentityInfo\":{\"type\":\"None\",\"userAssignedIdentity\":\"twukex\"},\"customDomains\":[{\"fullyQualifiedDomainName\":\"mnmabeddqil\",\"validationState\":\"ErrorRetrievingDnsRecord\",\"identity\":{},\"certificateUrl\":\"fqfp\",\"expectedTxtRecordName\":\"stcl\",\"expectedTxtRecordValue\":\"rvwerfwxbsmtb\"}]},\"isZoneRedundant\":false,\"publicNetworkAccess\":\"Enabled\",\"inboundIpRules\":[{\"ipMask\":\"fkwdvbtbrekqh\",\"action\":\"Allow\"}],\"minimumTlsVersionAllowed\":\"1.1\"},\"sku\":{\"name\":\"Standard\",\"capacity\":1543301093},\"identity\":{\"type\":\"None\",\"principalId\":\"wy\",\"tenantId\":\"dqigmg\",\"userAssignedIdentities\":{\"cmrnkfmkhcq\":{\"principalId\":\"z\",\"clientId\":\"lujkhn\"},\"j\":{\"principalId\":\"mlm\",\"clientId\":\"nqtqea\"}}},\"location\":\"vragpokddx\",\"tags\":{\"vgua\":\"h\",\"k\":\"tpt\",\"gbvoffbkk\":\"wkqyns\",\"zbnobr\":\"vdxaexqokmyrljia\"},\"id\":\"lpbcjtrpz\",\"name\":\"yudivbxnhsqeaeo\",\"type\":\"qelwgdhuruzytza\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - Namespace response = manager.namespaces() - .getByResourceGroupWithResponse("uvczldbgl", "outbaaqgzeka", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("vragpokddx", response.location()); - Assertions.assertEquals("h", response.tags().get("vgua")); - Assertions.assertEquals(SkuName.STANDARD, response.sku().name()); - Assertions.assertEquals(1543301093, response.sku().capacity()); - Assertions.assertEquals(IdentityType.NONE, response.identity().type()); - Assertions.assertEquals("wy", response.identity().principalId()); - Assertions.assertEquals("dqigmg", response.identity().tenantId()); - Assertions.assertEquals("z", response.identity().userAssignedIdentities().get("cmrnkfmkhcq").principalId()); - Assertions.assertEquals("lujkhn", response.identity().userAssignedIdentities().get("cmrnkfmkhcq").clientId()); - Assertions.assertEquals("orbjg", response.privateEndpointConnections().get(0).groupIds().get(0)); - Assertions.assertEquals(ResourceProvisioningState.CREATING, - response.privateEndpointConnections().get(0).provisioningState()); - Assertions.assertEquals("voinwo", - response.topicsConfiguration().customDomains().get(0).fullyQualifiedDomainName()); - Assertions.assertEquals(CustomDomainValidationState.ERROR_RETRIEVING_DNS_RECORD, - response.topicsConfiguration().customDomains().get(0).validationState()); - Assertions.assertEquals("yxqicladv", response.topicsConfiguration().customDomains().get(0).certificateUrl()); - Assertions.assertEquals("davuqmcbyms", - response.topicsConfiguration().customDomains().get(0).expectedTxtRecordName()); - Assertions.assertEquals("bjlquv", - response.topicsConfiguration().customDomains().get(0).expectedTxtRecordValue()); - Assertions.assertEquals(TopicSpacesConfigurationState.DISABLED, response.topicSpacesConfiguration().state()); - Assertions.assertEquals("umvpsimioyoigl", response.topicSpacesConfiguration().routeTopicResourceId()); - Assertions.assertEquals(1536942635, response.topicSpacesConfiguration().maximumSessionExpiryInHours()); - Assertions.assertEquals(1948229122, - response.topicSpacesConfiguration().maximumClientSessionsPerAuthenticationName()); - Assertions.assertEquals(RoutingIdentityType.NONE, - response.topicSpacesConfiguration().routingIdentityInfo().type()); - Assertions.assertEquals("twukex", - response.topicSpacesConfiguration().routingIdentityInfo().userAssignedIdentity()); - Assertions.assertEquals("mnmabeddqil", - response.topicSpacesConfiguration().customDomains().get(0).fullyQualifiedDomainName()); - Assertions.assertEquals(CustomDomainValidationState.ERROR_RETRIEVING_DNS_RECORD, - response.topicSpacesConfiguration().customDomains().get(0).validationState()); - Assertions.assertEquals("fqfp", response.topicSpacesConfiguration().customDomains().get(0).certificateUrl()); - Assertions.assertEquals("stcl", - response.topicSpacesConfiguration().customDomains().get(0).expectedTxtRecordName()); - Assertions.assertEquals("rvwerfwxbsmtb", - response.topicSpacesConfiguration().customDomains().get(0).expectedTxtRecordValue()); - Assertions.assertEquals(false, response.isZoneRedundant()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, response.publicNetworkAccess()); - Assertions.assertEquals("fkwdvbtbrekqh", response.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, response.inboundIpRules().get(0).action()); - Assertions.assertEquals(TlsVersion.ONE_ONE, response.minimumTlsVersionAllowed()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespacesListByResourceGroupMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespacesListByResourceGroupMockTests.java deleted file mode 100644 index 4c569b5bb95c..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespacesListByResourceGroupMockTests.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.CustomDomainValidationState; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.Namespace; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.ResourceProvisioningState; -import com.azure.resourcemanager.eventgrid.models.RoutingIdentityType; -import com.azure.resourcemanager.eventgrid.models.SkuName; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import com.azure.resourcemanager.eventgrid.models.TopicSpacesConfigurationState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NamespacesListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"tireimse\",\"bfsx\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"ilbvzmmxcjzl\",\"name\":\"uzexokjxebjvbzin\",\"type\":\"abwmvogljsv\"},{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"nwcehaqidoyzl\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"mqoqpepiaeapfse\",\"name\":\"gdtpe\",\"type\":\"nacyheqwb\"}],\"provisioningState\":\"Deleted\",\"topicsConfiguration\":{\"hostname\":\"jubkhjozfymcwmb\",\"customDomains\":[{\"fullyQualifiedDomainName\":\"vqyvl\",\"validationState\":\"Pending\",\"identity\":{},\"certificateUrl\":\"sejb\",\"expectedTxtRecordName\":\"si\",\"expectedTxtRecordValue\":\"eswhd\"},{\"fullyQualifiedDomainName\":\"zydisnuep\",\"validationState\":\"Pending\",\"identity\":{},\"certificateUrl\":\"nldpxottd\",\"expectedTxtRecordName\":\"aocqibzjih\",\"expectedTxtRecordValue\":\"ebiphryvcjwqwoq\"},{\"fullyQualifiedDomainName\":\"ratjhdhzybspij\",\"validationState\":\"Approved\",\"identity\":{},\"certificateUrl\":\"dkkagvwukhsusmm\",\"expectedTxtRecordName\":\"fmz\",\"expectedTxtRecordValue\":\"ilz\"}]},\"topicSpacesConfiguration\":{\"state\":\"Disabled\",\"routeTopicResourceId\":\"mriprlk\",\"hostname\":\"eyttlrcxiv\",\"routingEnrichments\":{\"static\":[{\"valueType\":\"StaticRoutingEnrichment\"},{\"valueType\":\"StaticRoutingEnrichment\"}],\"dynamic\":[{},{},{},{}]},\"maximumSessionExpiryInHours\":1972373952,\"maximumClientSessionsPerAuthenticationName\":789169678,\"routingIdentityInfo\":{\"type\":\"SystemAssigned\",\"userAssignedIdentity\":\"uxynb\"},\"customDomains\":[{\"fullyQualifiedDomainName\":\"l\",\"validationState\":\"Pending\",\"identity\":{},\"certificateUrl\":\"y\",\"expectedTxtRecordName\":\"jckhmocgj\",\"expectedTxtRecordValue\":\"gouarhwvixqq\"},{\"fullyQualifiedDomainName\":\"gljkybsj\",\"validationState\":\"Approved\",\"identity\":{},\"certificateUrl\":\"tzqnrbctbhpjh\",\"expectedTxtRecordName\":\"cvrdnyeitaneqady\",\"expectedTxtRecordValue\":\"jahwriuomzczf\"},{\"fullyQualifiedDomainName\":\"iceevsaaxwspca\",\"validationState\":\"Approved\",\"identity\":{},\"certificateUrl\":\"jqeb\",\"expectedTxtRecordName\":\"cx\",\"expectedTxtRecordValue\":\"gzzromv\"}]},\"isZoneRedundant\":true,\"publicNetworkAccess\":\"Enabled\",\"inboundIpRules\":[{\"ipMask\":\"esrfsvpinkzpatq\",\"action\":\"Allow\"}],\"minimumTlsVersionAllowed\":\"1.2\"},\"sku\":{\"name\":\"Standard\",\"capacity\":689179131},\"identity\":{\"type\":\"SystemAssigned, UserAssigned\",\"principalId\":\"zbbgspftesubzpvp\",\"tenantId\":\"ylytcovqseusr\",\"userAssignedIdentities\":{\"kjmdihdcyy\":{\"principalId\":\"xzfxn\",\"clientId\":\"lbmuos\"},\"zuubjtvgjsxm\":{\"principalId\":\"lwhbwzjnu\",\"clientId\":\"rfgmdqgnnbzrtfte\"},\"titsf\":{\"principalId\":\"jjvavdpww\",\"clientId\":\"tdp\"},\"wgybj\":{\"principalId\":\"fwanm\",\"clientId\":\"scauwazcgwdfr\"}}},\"location\":\"zokscvg\",\"tags\":{\"gbyfgwe\":\"x\",\"xlcskltez\":\"qkjvxprwpxsoohu\",\"srtmdylperpiltt\":\"ugggzlfbgrdcgu\",\"resrgvtshuvft\":\"zgczfcmfpfbode\"},\"id\":\"ai\",\"name\":\"muqkevzgjypanhx\",\"type\":\"pdxxzetwwz\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.namespaces() - .listByResourceGroup("dcdjhunh", "hcgawn", 1900085182, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("zokscvg", response.iterator().next().location()); - Assertions.assertEquals("x", response.iterator().next().tags().get("gbyfgwe")); - Assertions.assertEquals(SkuName.STANDARD, response.iterator().next().sku().name()); - Assertions.assertEquals(689179131, response.iterator().next().sku().capacity()); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, - response.iterator().next().identity().type()); - Assertions.assertEquals("zbbgspftesubzpvp", response.iterator().next().identity().principalId()); - Assertions.assertEquals("ylytcovqseusr", response.iterator().next().identity().tenantId()); - Assertions.assertEquals("xzfxn", - response.iterator().next().identity().userAssignedIdentities().get("kjmdihdcyy").principalId()); - Assertions.assertEquals("lbmuos", - response.iterator().next().identity().userAssignedIdentities().get("kjmdihdcyy").clientId()); - Assertions.assertEquals("tireimse", - response.iterator().next().privateEndpointConnections().get(0).groupIds().get(0)); - Assertions.assertEquals(ResourceProvisioningState.DELETING, - response.iterator().next().privateEndpointConnections().get(0).provisioningState()); - Assertions.assertEquals("vqyvl", - response.iterator().next().topicsConfiguration().customDomains().get(0).fullyQualifiedDomainName()); - Assertions.assertEquals(CustomDomainValidationState.PENDING, - response.iterator().next().topicsConfiguration().customDomains().get(0).validationState()); - Assertions.assertEquals("sejb", - response.iterator().next().topicsConfiguration().customDomains().get(0).certificateUrl()); - Assertions.assertEquals("si", - response.iterator().next().topicsConfiguration().customDomains().get(0).expectedTxtRecordName()); - Assertions.assertEquals("eswhd", - response.iterator().next().topicsConfiguration().customDomains().get(0).expectedTxtRecordValue()); - Assertions.assertEquals(TopicSpacesConfigurationState.DISABLED, - response.iterator().next().topicSpacesConfiguration().state()); - Assertions.assertEquals("mriprlk", - response.iterator().next().topicSpacesConfiguration().routeTopicResourceId()); - Assertions.assertEquals(1972373952, - response.iterator().next().topicSpacesConfiguration().maximumSessionExpiryInHours()); - Assertions.assertEquals(789169678, - response.iterator().next().topicSpacesConfiguration().maximumClientSessionsPerAuthenticationName()); - Assertions.assertEquals(RoutingIdentityType.SYSTEM_ASSIGNED, - response.iterator().next().topicSpacesConfiguration().routingIdentityInfo().type()); - Assertions.assertEquals("uxynb", - response.iterator().next().topicSpacesConfiguration().routingIdentityInfo().userAssignedIdentity()); - Assertions.assertEquals("l", - response.iterator().next().topicSpacesConfiguration().customDomains().get(0).fullyQualifiedDomainName()); - Assertions.assertEquals(CustomDomainValidationState.PENDING, - response.iterator().next().topicSpacesConfiguration().customDomains().get(0).validationState()); - Assertions.assertEquals("y", - response.iterator().next().topicSpacesConfiguration().customDomains().get(0).certificateUrl()); - Assertions.assertEquals("jckhmocgj", - response.iterator().next().topicSpacesConfiguration().customDomains().get(0).expectedTxtRecordName()); - Assertions.assertEquals("gouarhwvixqq", - response.iterator().next().topicSpacesConfiguration().customDomains().get(0).expectedTxtRecordValue()); - Assertions.assertEquals(true, response.iterator().next().isZoneRedundant()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, response.iterator().next().publicNetworkAccess()); - Assertions.assertEquals("esrfsvpinkzpatq", response.iterator().next().inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, response.iterator().next().inboundIpRules().get(0).action()); - Assertions.assertEquals(TlsVersion.ONE_TWO, response.iterator().next().minimumTlsVersionAllowed()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespacesListMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespacesListMockTests.java deleted file mode 100644 index 1f7cfd1c254e..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespacesListMockTests.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.CustomDomainValidationState; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.Namespace; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.ResourceProvisioningState; -import com.azure.resourcemanager.eventgrid.models.RoutingIdentityType; -import com.azure.resourcemanager.eventgrid.models.SkuName; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import com.azure.resourcemanager.eventgrid.models.TopicSpacesConfigurationState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NamespacesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"fjhkeizcpihtdmiw\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"tycaydbjzcqyml\",\"name\":\"fnzhmhsurlgw\",\"type\":\"kpmmz\"}],\"provisioningState\":\"CreateFailed\",\"topicsConfiguration\":{\"hostname\":\"olawiubmoms\",\"customDomains\":[{\"fullyQualifiedDomainName\":\"jhvvlrlo\",\"validationState\":\"Pending\",\"identity\":{},\"certificateUrl\":\"majnkd\",\"expectedTxtRecordName\":\"q\",\"expectedTxtRecordValue\":\"ns\"},{\"fullyQualifiedDomainName\":\"aeqkzfzqxjoshoh\",\"validationState\":\"Approved\",\"identity\":{},\"certificateUrl\":\"egpkhxrmex\",\"expectedTxtRecordName\":\"lwkbfok\",\"expectedTxtRecordValue\":\"hupzerufgjblc\"}]},\"topicSpacesConfiguration\":{\"state\":\"Disabled\",\"routeTopicResourceId\":\"cemftzgyykyalu\",\"hostname\":\"kd\",\"routingEnrichments\":{\"static\":[{\"valueType\":\"StaticRoutingEnrichment\"},{\"valueType\":\"StaticRoutingEnrichment\"}],\"dynamic\":[{}]},\"maximumSessionExpiryInHours\":500622504,\"maximumClientSessionsPerAuthenticationName\":1425473509,\"routingIdentityInfo\":{\"type\":\"SystemAssigned\",\"userAssignedIdentity\":\"jjnnu\"},\"customDomains\":[{\"fullyQualifiedDomainName\":\"kkmhm\",\"validationState\":\"ErrorRetrievingDnsRecord\",\"identity\":{},\"certificateUrl\":\"m\",\"expectedTxtRecordName\":\"cifrhjulrsulwzpf\",\"expectedTxtRecordValue\":\"snawmhhgzotfri\"},{\"fullyQualifiedDomainName\":\"rgkoekvzwxxyx\",\"validationState\":\"Approved\",\"identity\":{},\"certificateUrl\":\"t\",\"expectedTxtRecordName\":\"xmolpcqydeyk\",\"expectedTxtRecordValue\":\"kiczdfrj\"}]},\"isZoneRedundant\":true,\"publicNetworkAccess\":\"Enabled\",\"inboundIpRules\":[{\"ipMask\":\"boohxbms\",\"action\":\"Allow\"},{\"ipMask\":\"sx\",\"action\":\"Allow\"},{\"ipMask\":\"ewuyqa\",\"action\":\"Allow\"}],\"minimumTlsVersionAllowed\":\"1.1\"},\"sku\":{\"name\":\"Standard\",\"capacity\":1515998294},\"identity\":{\"type\":\"SystemAssigned\",\"principalId\":\"daurgho\",\"tenantId\":\"aexbkhxjxjo\",\"userAssignedIdentities\":{\"m\":{\"principalId\":\"xrkdknkobektm\",\"clientId\":\"z\"}}},\"location\":\"amicbigwcdgz\",\"tags\":{\"abmdlqj\":\"nuxkeuair\",\"xlhupmomihzbdnp\":\"edpf\",\"cghf\":\"pkcdpreyxely\",\"sfxrkbhammgm\":\"rufssjyg\"},\"id\":\"fm\",\"name\":\"fgvqcpdw\",\"type\":\"gquxweysland\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response - = manager.namespaces().list("knsjulugd", 1822277572, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("amicbigwcdgz", response.iterator().next().location()); - Assertions.assertEquals("nuxkeuair", response.iterator().next().tags().get("abmdlqj")); - Assertions.assertEquals(SkuName.STANDARD, response.iterator().next().sku().name()); - Assertions.assertEquals(1515998294, response.iterator().next().sku().capacity()); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("daurgho", response.iterator().next().identity().principalId()); - Assertions.assertEquals("aexbkhxjxjo", response.iterator().next().identity().tenantId()); - Assertions.assertEquals("xrkdknkobektm", - response.iterator().next().identity().userAssignedIdentities().get("m").principalId()); - Assertions.assertEquals("z", - response.iterator().next().identity().userAssignedIdentities().get("m").clientId()); - Assertions.assertEquals("fjhkeizcpihtdmiw", - response.iterator().next().privateEndpointConnections().get(0).groupIds().get(0)); - Assertions.assertEquals(ResourceProvisioningState.DELETING, - response.iterator().next().privateEndpointConnections().get(0).provisioningState()); - Assertions.assertEquals("jhvvlrlo", - response.iterator().next().topicsConfiguration().customDomains().get(0).fullyQualifiedDomainName()); - Assertions.assertEquals(CustomDomainValidationState.PENDING, - response.iterator().next().topicsConfiguration().customDomains().get(0).validationState()); - Assertions.assertEquals("majnkd", - response.iterator().next().topicsConfiguration().customDomains().get(0).certificateUrl()); - Assertions.assertEquals("q", - response.iterator().next().topicsConfiguration().customDomains().get(0).expectedTxtRecordName()); - Assertions.assertEquals("ns", - response.iterator().next().topicsConfiguration().customDomains().get(0).expectedTxtRecordValue()); - Assertions.assertEquals(TopicSpacesConfigurationState.DISABLED, - response.iterator().next().topicSpacesConfiguration().state()); - Assertions.assertEquals("cemftzgyykyalu", - response.iterator().next().topicSpacesConfiguration().routeTopicResourceId()); - Assertions.assertEquals(500622504, - response.iterator().next().topicSpacesConfiguration().maximumSessionExpiryInHours()); - Assertions.assertEquals(1425473509, - response.iterator().next().topicSpacesConfiguration().maximumClientSessionsPerAuthenticationName()); - Assertions.assertEquals(RoutingIdentityType.SYSTEM_ASSIGNED, - response.iterator().next().topicSpacesConfiguration().routingIdentityInfo().type()); - Assertions.assertEquals("jjnnu", - response.iterator().next().topicSpacesConfiguration().routingIdentityInfo().userAssignedIdentity()); - Assertions.assertEquals("kkmhm", - response.iterator().next().topicSpacesConfiguration().customDomains().get(0).fullyQualifiedDomainName()); - Assertions.assertEquals(CustomDomainValidationState.ERROR_RETRIEVING_DNS_RECORD, - response.iterator().next().topicSpacesConfiguration().customDomains().get(0).validationState()); - Assertions.assertEquals("m", - response.iterator().next().topicSpacesConfiguration().customDomains().get(0).certificateUrl()); - Assertions.assertEquals("cifrhjulrsulwzpf", - response.iterator().next().topicSpacesConfiguration().customDomains().get(0).expectedTxtRecordName()); - Assertions.assertEquals("snawmhhgzotfri", - response.iterator().next().topicSpacesConfiguration().customDomains().get(0).expectedTxtRecordValue()); - Assertions.assertEquals(true, response.iterator().next().isZoneRedundant()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, response.iterator().next().publicNetworkAccess()); - Assertions.assertEquals("boohxbms", response.iterator().next().inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, response.iterator().next().inboundIpRules().get(0).action()); - Assertions.assertEquals(TlsVersion.ONE_ONE, response.iterator().next().minimumTlsVersionAllowed()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespacesListResultTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespacesListResultTests.java deleted file mode 100644 index 2724fafa82c4..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespacesListResultTests.java +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.NamespaceInner; -import com.azure.resourcemanager.eventgrid.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.eventgrid.models.CustomDomainConfiguration; -import com.azure.resourcemanager.eventgrid.models.DynamicRoutingEnrichment; -import com.azure.resourcemanager.eventgrid.models.IdentityInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.InboundIpRule; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.NamespaceSku; -import com.azure.resourcemanager.eventgrid.models.NamespacesListResult; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.RoutingEnrichments; -import com.azure.resourcemanager.eventgrid.models.RoutingIdentityInfo; -import com.azure.resourcemanager.eventgrid.models.RoutingIdentityType; -import com.azure.resourcemanager.eventgrid.models.SkuName; -import com.azure.resourcemanager.eventgrid.models.StaticRoutingEnrichment; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import com.azure.resourcemanager.eventgrid.models.TopicSpacesConfiguration; -import com.azure.resourcemanager.eventgrid.models.TopicSpacesConfigurationState; -import com.azure.resourcemanager.eventgrid.models.TopicsConfiguration; -import com.azure.resourcemanager.eventgrid.models.UserIdentityProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NamespacesListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NamespacesListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{},\"id\":\"f\",\"name\":\"cxzbfvoowvr\",\"type\":\"mtg\"},{\"properties\":{},\"id\":\"ppyostronzmyhgf\",\"name\":\"pnsxkmcwaek\",\"type\":\"rjreafxts\"},{\"properties\":{},\"id\":\"mhjglikkxwslolb\",\"name\":\"pvuzlmv\",\"type\":\"elfk\"}],\"provisioningState\":\"CreateFailed\",\"topicsConfiguration\":{\"hostname\":\"rpw\",\"customDomains\":[{\"fullyQualifiedDomainName\":\"znoigbrn\"},{\"fullyQualifiedDomainName\":\"w\"}]},\"topicSpacesConfiguration\":{\"state\":\"Disabled\",\"routeTopicResourceId\":\"bsazejjoqka\",\"hostname\":\"hsxttaugzxnf\",\"routingEnrichments\":{\"static\":[{\"valueType\":\"StaticRoutingEnrichment\"},{\"valueType\":\"StaticRoutingEnrichment\"},{\"valueType\":\"StaticRoutingEnrichment\"}],\"dynamic\":[{},{}]},\"maximumSessionExpiryInHours\":159219307,\"maximumClientSessionsPerAuthenticationName\":504912220,\"routingIdentityInfo\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"jlwuenvrkp\"},\"customDomains\":[{\"fullyQualifiedDomainName\":\"aibrebqaaysjkixq\"},{\"fullyQualifiedDomainName\":\"nqttezl\"},{\"fullyQualifiedDomainName\":\"fffiak\"},{\"fullyQualifiedDomainName\":\"jpqqmted\"}]},\"isZoneRedundant\":false,\"publicNetworkAccess\":\"Enabled\",\"inboundIpRules\":[{\"ipMask\":\"eozphv\",\"action\":\"Allow\"},{\"ipMask\":\"qncygupkvi\",\"action\":\"Allow\"},{\"ipMask\":\"cwxqu\",\"action\":\"Allow\"}],\"minimumTlsVersionAllowed\":\"1.0\"},\"sku\":{\"name\":\"Standard\",\"capacity\":2019400372},\"identity\":{\"type\":\"SystemAssigned\",\"principalId\":\"ujbypelmcuvhixb\",\"tenantId\":\"yfwnylr\",\"userAssignedIdentities\":{\"kbnujr\":{\"principalId\":\"sttp\",\"clientId\":\"w\"}}},\"location\":\"vtylbfpncu\",\"tags\":{\"htywubxcbihwq\":\"iwii\",\"wjchrdg\":\"nfdn\",\"uu\":\"ihxumwctondzj\"},\"id\":\"fdlwg\",\"name\":\"ytsbwtovv\",\"type\":\"gseinq\"},{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{},\"id\":\"qknp\",\"name\":\"rgnepttwqmsniffc\",\"type\":\"mqnrojlpijnkr\"},{\"properties\":{},\"id\":\"rddh\",\"name\":\"ratiz\",\"type\":\"ronasxift\"},{\"properties\":{},\"id\":\"qyzhf\",\"name\":\"wesgogczh\",\"type\":\"nnxk\"},{\"properties\":{},\"id\":\"gnyhmossxkkg\",\"name\":\"h\",\"type\":\"rghxjb\"}],\"provisioningState\":\"UpdatedFailed\",\"topicsConfiguration\":{\"hostname\":\"cx\",\"customDomains\":[{\"fullyQualifiedDomainName\":\"pdso\"},{\"fullyQualifiedDomainName\":\"bshrnsvbuswd\"}]},\"topicSpacesConfiguration\":{\"state\":\"Enabled\",\"routeTopicResourceId\":\"ycnunvjsrtk\",\"hostname\":\"wnopqgikyzirtx\",\"routingEnrichments\":{\"static\":[{\"valueType\":\"StaticRoutingEnrichment\"}],\"dynamic\":[{}]},\"maximumSessionExpiryInHours\":893551586,\"maximumClientSessionsPerAuthenticationName\":953757935,\"routingIdentityInfo\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"ioilqukrydxtq\"},\"customDomains\":[{\"fullyQualifiedDomainName\":\"ox\"},{\"fullyQualifiedDomainName\":\"rgguf\"},{\"fullyQualifiedDomainName\":\"yaomtb\"},{\"fullyQualifiedDomainName\":\"hhavgrvkffovjz\"}]},\"isZoneRedundant\":false,\"publicNetworkAccess\":\"Disabled\",\"inboundIpRules\":[{\"ipMask\":\"mfxumvfcluyovw\",\"action\":\"Allow\"},{\"ipMask\":\"fezzxscyhwzdg\",\"action\":\"Allow\"},{\"ipMask\":\"bzbomvzzbtdcqvpn\",\"action\":\"Allow\"}],\"minimumTlsVersionAllowed\":\"1.0\"},\"sku\":{\"name\":\"Standard\",\"capacity\":812377845},\"identity\":{\"type\":\"SystemAssigned, UserAssigned\",\"principalId\":\"snrbgyefrymsgao\",\"tenantId\":\"mwn\",\"userAssignedIdentities\":{\"piwyczuhxacpqjl\":{\"principalId\":\"rfh\",\"clientId\":\"ctymoxoftp\"}}},\"location\":\"hyus\",\"tags\":{\"fwdgzxulucvp\":\"asdvl\",\"ytxifqjzgxmrh\":\"mrsreuzvxurisjnh\"},\"id\":\"blwpcesutrgj\",\"name\":\"pauutpw\",\"type\":\"qhih\"},{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{},\"id\":\"zpnfqntcypsxj\",\"name\":\"foimwkslircizjxv\",\"type\":\"dfcea\"}],\"provisioningState\":\"DeleteFailed\",\"topicsConfiguration\":{\"hostname\":\"ygdyftumrtw\",\"customDomains\":[{\"fullyQualifiedDomainName\":\"jslb\"},{\"fullyQualifiedDomainName\":\"wkojgcyztsfmzn\"},{\"fullyQualifiedDomainName\":\"aeqphchqnr\"},{\"fullyQualifiedDomainName\":\"rpxeh\"}]},\"topicSpacesConfiguration\":{\"state\":\"Enabled\",\"routeTopicResourceId\":\"qgaifmviklbydv\",\"hostname\":\"bejdznxcv\",\"routingEnrichments\":{\"static\":[{\"valueType\":\"StaticRoutingEnrichment\"},{\"valueType\":\"StaticRoutingEnrichment\"}],\"dynamic\":[{},{},{}]},\"maximumSessionExpiryInHours\":1345680301,\"maximumClientSessionsPerAuthenticationName\":1229018312,\"routingIdentityInfo\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"v\"},\"customDomains\":[{\"fullyQualifiedDomainName\":\"gemjdftuljltdu\"},{\"fullyQualifiedDomainName\":\"eamtmcz\"},{\"fullyQualifiedDomainName\":\"o\"},{\"fullyQualifiedDomainName\":\"ejwcwwqiok\"}]},\"isZoneRedundant\":false,\"publicNetworkAccess\":\"Disabled\",\"inboundIpRules\":[{\"ipMask\":\"sv\",\"action\":\"Allow\"},{\"ipMask\":\"rvkwc\",\"action\":\"Allow\"}],\"minimumTlsVersionAllowed\":\"1.0\"},\"sku\":{\"name\":\"Standard\",\"capacity\":1494813827},\"identity\":{\"type\":\"SystemAssigned\",\"principalId\":\"dbsdshm\",\"tenantId\":\"maehvbbxurip\",\"userAssignedIdentities\":{\"wrck\":{\"principalId\":\"htba\",\"clientId\":\"gx\"},\"uudl\":{\"principalId\":\"kl\",\"clientId\":\"pluodpv\"},\"lhpl\":{\"principalId\":\"ibthostgktstvd\",\"clientId\":\"clzedqbcvh\"}}},\"location\":\"qkdlw\",\"tags\":{\"kxtrq\":\"bum\",\"rtawcoezb\":\"fsmlmbtxhwgfw\"},\"id\":\"hubskhudygooo\",\"name\":\"kqfqjbvl\",\"type\":\"orfmluiqt\"}],\"nextLink\":\"fa\"}") - .toObject(NamespacesListResult.class); - Assertions.assertEquals("vtylbfpncu", model.value().get(0).location()); - Assertions.assertEquals("iwii", model.value().get(0).tags().get("htywubxcbihwq")); - Assertions.assertEquals(SkuName.STANDARD, model.value().get(0).sku().name()); - Assertions.assertEquals(2019400372, model.value().get(0).sku().capacity()); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("ujbypelmcuvhixb", model.value().get(0).identity().principalId()); - Assertions.assertEquals("yfwnylr", model.value().get(0).identity().tenantId()); - Assertions.assertEquals("sttp", - model.value().get(0).identity().userAssignedIdentities().get("kbnujr").principalId()); - Assertions.assertEquals("w", model.value().get(0).identity().userAssignedIdentities().get("kbnujr").clientId()); - Assertions.assertEquals("znoigbrn", - model.value().get(0).topicsConfiguration().customDomains().get(0).fullyQualifiedDomainName()); - Assertions.assertEquals(TopicSpacesConfigurationState.DISABLED, - model.value().get(0).topicSpacesConfiguration().state()); - Assertions.assertEquals("bsazejjoqka", model.value().get(0).topicSpacesConfiguration().routeTopicResourceId()); - Assertions.assertEquals(159219307, - model.value().get(0).topicSpacesConfiguration().maximumSessionExpiryInHours()); - Assertions.assertEquals(504912220, - model.value().get(0).topicSpacesConfiguration().maximumClientSessionsPerAuthenticationName()); - Assertions.assertEquals(RoutingIdentityType.USER_ASSIGNED, - model.value().get(0).topicSpacesConfiguration().routingIdentityInfo().type()); - Assertions.assertEquals("jlwuenvrkp", - model.value().get(0).topicSpacesConfiguration().routingIdentityInfo().userAssignedIdentity()); - Assertions.assertEquals("aibrebqaaysjkixq", - model.value().get(0).topicSpacesConfiguration().customDomains().get(0).fullyQualifiedDomainName()); - Assertions.assertEquals(false, model.value().get(0).isZoneRedundant()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.value().get(0).publicNetworkAccess()); - Assertions.assertEquals("eozphv", model.value().get(0).inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.value().get(0).inboundIpRules().get(0).action()); - Assertions.assertEquals(TlsVersion.ONE_ZERO, model.value().get(0).minimumTlsVersionAllowed()); - Assertions.assertEquals("fa", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NamespacesListResult model - = new NamespacesListResult() - .withValue(Arrays.asList( - new NamespaceInner().withLocation("vtylbfpncu") - .withTags(mapOf("htywubxcbihwq", "iwii", "wjchrdg", "nfdn", "uu", "ihxumwctondzj")) - .withSku(new NamespaceSku().withName(SkuName.STANDARD).withCapacity(2019400372)) - .withIdentity(new IdentityInfo().withType(IdentityType.SYSTEM_ASSIGNED) - .withPrincipalId("ujbypelmcuvhixb") - .withTenantId("yfwnylr") - .withUserAssignedIdentities(mapOf("kbnujr", - new UserIdentityProperties().withPrincipalId("sttp").withClientId("w")))) - .withPrivateEndpointConnections(Arrays.asList(new PrivateEndpointConnectionInner(), - new PrivateEndpointConnectionInner(), new PrivateEndpointConnectionInner())) - .withTopicsConfiguration(new TopicsConfiguration().withCustomDomains( - Arrays.asList(new CustomDomainConfiguration().withFullyQualifiedDomainName("znoigbrn"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("w")))) - .withTopicSpacesConfiguration( - new TopicSpacesConfiguration().withState(TopicSpacesConfigurationState.DISABLED) - .withRouteTopicResourceId("bsazejjoqka") - .withRoutingEnrichments(new RoutingEnrichments() - .withStaticProperty(Arrays.asList(new StaticRoutingEnrichment(), - new StaticRoutingEnrichment(), new StaticRoutingEnrichment())) - .withDynamic( - Arrays.asList(new DynamicRoutingEnrichment(), new DynamicRoutingEnrichment()))) - .withMaximumSessionExpiryInHours(159219307) - .withMaximumClientSessionsPerAuthenticationName(504912220) - .withRoutingIdentityInfo( - new RoutingIdentityInfo().withType(RoutingIdentityType.USER_ASSIGNED) - .withUserAssignedIdentity("jlwuenvrkp")) - .withCustomDomains( - Arrays.asList( - new CustomDomainConfiguration() - .withFullyQualifiedDomainName("aibrebqaaysjkixq"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("nqttezl"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("fffiak"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("jpqqmted")))) - .withIsZoneRedundant(false) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withInboundIpRules( - Arrays.asList(new InboundIpRule().withIpMask("eozphv").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("qncygupkvi").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("cwxqu").withAction(IpActionType.ALLOW))) - .withMinimumTlsVersionAllowed(TlsVersion.ONE_ZERO), - new NamespaceInner().withLocation("hyus") - .withTags(mapOf("fwdgzxulucvp", "asdvl", "ytxifqjzgxmrh", "mrsreuzvxurisjnh")) - .withSku(new NamespaceSku().withName(SkuName.STANDARD).withCapacity(812377845)) - .withIdentity(new IdentityInfo().withType(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withPrincipalId("snrbgyefrymsgao") - .withTenantId("mwn") - .withUserAssignedIdentities(mapOf("piwyczuhxacpqjl", - new UserIdentityProperties().withPrincipalId("rfh").withClientId("ctymoxoftp")))) - .withPrivateEndpointConnections( - Arrays.asList(new PrivateEndpointConnectionInner(), new PrivateEndpointConnectionInner(), - new PrivateEndpointConnectionInner(), new PrivateEndpointConnectionInner())) - .withTopicsConfiguration( - new TopicsConfiguration() - .withCustomDomains( - Arrays.asList(new CustomDomainConfiguration().withFullyQualifiedDomainName("pdso"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("bshrnsvbuswd")))) - .withTopicSpacesConfiguration( - new TopicSpacesConfiguration().withState(TopicSpacesConfigurationState.ENABLED) - .withRouteTopicResourceId("ycnunvjsrtk") - .withRoutingEnrichments(new RoutingEnrichments() - .withStaticProperty(Arrays.asList(new StaticRoutingEnrichment())) - .withDynamic(Arrays.asList(new DynamicRoutingEnrichment()))) - .withMaximumSessionExpiryInHours(893551586) - .withMaximumClientSessionsPerAuthenticationName(953757935) - .withRoutingIdentityInfo( - new RoutingIdentityInfo().withType(RoutingIdentityType.USER_ASSIGNED) - .withUserAssignedIdentity("ioilqukrydxtq")) - .withCustomDomains( - Arrays.asList(new CustomDomainConfiguration().withFullyQualifiedDomainName("ox"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("rgguf"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("yaomtb"), - new CustomDomainConfiguration() - .withFullyQualifiedDomainName("hhavgrvkffovjz")))) - .withIsZoneRedundant(false) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) - .withInboundIpRules(Arrays - .asList(new InboundIpRule().withIpMask("mfxumvfcluyovw").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("fezzxscyhwzdg") - .withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("bzbomvzzbtdcqvpn").withAction(IpActionType.ALLOW))) - .withMinimumTlsVersionAllowed(TlsVersion.ONE_ZERO), - new NamespaceInner().withLocation("qkdlw") - .withTags(mapOf("kxtrq", "bum", "rtawcoezb", "fsmlmbtxhwgfw")) - .withSku(new NamespaceSku().withName(SkuName.STANDARD).withCapacity(1494813827)) - .withIdentity(new IdentityInfo().withType(IdentityType.SYSTEM_ASSIGNED) - .withPrincipalId("dbsdshm") - .withTenantId("maehvbbxurip") - .withUserAssignedIdentities(mapOf("wrck", - new UserIdentityProperties().withPrincipalId("htba").withClientId("gx"), "uudl", - new UserIdentityProperties().withPrincipalId("kl").withClientId("pluodpv"), "lhpl", - new UserIdentityProperties().withPrincipalId("ibthostgktstvd") - .withClientId("clzedqbcvh")))) - .withPrivateEndpointConnections(Arrays.asList(new PrivateEndpointConnectionInner())) - .withTopicsConfiguration(new TopicsConfiguration().withCustomDomains( - Arrays.asList(new CustomDomainConfiguration().withFullyQualifiedDomainName("jslb"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("wkojgcyztsfmzn"), - new CustomDomainConfiguration() - .withFullyQualifiedDomainName("aeqphchqnr"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("rpxeh")))) - .withTopicSpacesConfiguration( - new TopicSpacesConfiguration().withState(TopicSpacesConfigurationState.ENABLED) - .withRouteTopicResourceId("qgaifmviklbydv") - .withRoutingEnrichments(new RoutingEnrichments() - .withStaticProperty( - Arrays.asList(new StaticRoutingEnrichment(), new StaticRoutingEnrichment())) - .withDynamic(Arrays.asList(new DynamicRoutingEnrichment(), - new DynamicRoutingEnrichment(), new DynamicRoutingEnrichment()))) - .withMaximumSessionExpiryInHours(1345680301) - .withMaximumClientSessionsPerAuthenticationName(1229018312) - .withRoutingIdentityInfo( - new RoutingIdentityInfo().withType(RoutingIdentityType.USER_ASSIGNED) - .withUserAssignedIdentity("v")) - .withCustomDomains(Arrays.asList( - new CustomDomainConfiguration().withFullyQualifiedDomainName("gemjdftuljltdu"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("eamtmcz"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("o"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("ejwcwwqiok")))) - .withIsZoneRedundant(false) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) - .withInboundIpRules( - Arrays.asList(new InboundIpRule().withIpMask("sv").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("rvkwc").withAction(IpActionType.ALLOW))) - .withMinimumTlsVersionAllowed(TlsVersion.ONE_ZERO))) - .withNextLink("fa"); - model = BinaryData.fromObject(model).toObject(NamespacesListResult.class); - Assertions.assertEquals("vtylbfpncu", model.value().get(0).location()); - Assertions.assertEquals("iwii", model.value().get(0).tags().get("htywubxcbihwq")); - Assertions.assertEquals(SkuName.STANDARD, model.value().get(0).sku().name()); - Assertions.assertEquals(2019400372, model.value().get(0).sku().capacity()); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("ujbypelmcuvhixb", model.value().get(0).identity().principalId()); - Assertions.assertEquals("yfwnylr", model.value().get(0).identity().tenantId()); - Assertions.assertEquals("sttp", - model.value().get(0).identity().userAssignedIdentities().get("kbnujr").principalId()); - Assertions.assertEquals("w", model.value().get(0).identity().userAssignedIdentities().get("kbnujr").clientId()); - Assertions.assertEquals("znoigbrn", - model.value().get(0).topicsConfiguration().customDomains().get(0).fullyQualifiedDomainName()); - Assertions.assertEquals(TopicSpacesConfigurationState.DISABLED, - model.value().get(0).topicSpacesConfiguration().state()); - Assertions.assertEquals("bsazejjoqka", model.value().get(0).topicSpacesConfiguration().routeTopicResourceId()); - Assertions.assertEquals(159219307, - model.value().get(0).topicSpacesConfiguration().maximumSessionExpiryInHours()); - Assertions.assertEquals(504912220, - model.value().get(0).topicSpacesConfiguration().maximumClientSessionsPerAuthenticationName()); - Assertions.assertEquals(RoutingIdentityType.USER_ASSIGNED, - model.value().get(0).topicSpacesConfiguration().routingIdentityInfo().type()); - Assertions.assertEquals("jlwuenvrkp", - model.value().get(0).topicSpacesConfiguration().routingIdentityInfo().userAssignedIdentity()); - Assertions.assertEquals("aibrebqaaysjkixq", - model.value().get(0).topicSpacesConfiguration().customDomains().get(0).fullyQualifiedDomainName()); - Assertions.assertEquals(false, model.value().get(0).isZoneRedundant()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.value().get(0).publicNetworkAccess()); - Assertions.assertEquals("eozphv", model.value().get(0).inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.value().get(0).inboundIpRules().get(0).action()); - Assertions.assertEquals(TlsVersion.ONE_ZERO, model.value().get(0).minimumTlsVersionAllowed()); - Assertions.assertEquals("fa", model.nextLink()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespacesValidateCustomDomainOwnershipMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespacesValidateCustomDomainOwnershipMockTests.java deleted file mode 100644 index a7d652d8affa..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/NamespacesValidateCustomDomainOwnershipMockTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.CustomDomainIdentityType; -import com.azure.resourcemanager.eventgrid.models.CustomDomainOwnershipValidationResult; -import com.azure.resourcemanager.eventgrid.models.CustomDomainValidationState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NamespacesValidateCustomDomainOwnershipMockTests { - @Test - public void testValidateCustomDomainOwnership() throws Exception { - String responseStr - = "{\"customDomainsForTopicsConfiguration\":[{\"fullyQualifiedDomainName\":\"etjsczivfqbqna\",\"validationState\":\"ErrorRetrievingDnsRecord\",\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"sieuscpl\"},\"certificateUrl\":\"vdgxly\",\"expectedTxtRecordName\":\"xitdshezs\",\"expectedTxtRecordValue\":\"olrupjovm\"},{\"fullyQualifiedDomainName\":\"zsayebrazw\",\"validationState\":\"Approved\",\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"uykykipfsd\"},\"certificateUrl\":\"pfnocm\",\"expectedTxtRecordName\":\"zacfpztgazw\",\"expectedTxtRecordValue\":\"ejgaaokct\"}],\"customDomainsForTopicSpacesConfiguration\":[{\"fullyQualifiedDomainName\":\"pgkqzkcyzmffngdy\",\"validationState\":\"ErrorRetrievingDnsRecord\",\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentity\":\"cqvhoejgoiutgwrm\"},\"certificateUrl\":\"hpqhazyntacihn\",\"expectedTxtRecordName\":\"gmipnmliqmvlbhik\",\"expectedTxtRecordValue\":\"qgrvg\"},{\"fullyQualifiedDomainName\":\"omxp\",\"validationState\":\"Pending\",\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentity\":\"jyies\"},\"certificateUrl\":\"wiqbuoutm\",\"expectedTxtRecordName\":\"zgleofjsbg\",\"expectedTxtRecordValue\":\"wzvdajfwnncfm\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - CustomDomainOwnershipValidationResult response - = manager.namespaces().validateCustomDomainOwnership("ukklvzrlr", "l", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("etjsczivfqbqna", - response.customDomainsForTopicsConfiguration().get(0).fullyQualifiedDomainName()); - Assertions.assertEquals(CustomDomainValidationState.ERROR_RETRIEVING_DNS_RECORD, - response.customDomainsForTopicsConfiguration().get(0).validationState()); - Assertions.assertEquals(CustomDomainIdentityType.USER_ASSIGNED, - response.customDomainsForTopicsConfiguration().get(0).identity().type()); - Assertions.assertEquals("sieuscpl", - response.customDomainsForTopicsConfiguration().get(0).identity().userAssignedIdentity()); - Assertions.assertEquals("vdgxly", response.customDomainsForTopicsConfiguration().get(0).certificateUrl()); - Assertions.assertEquals("xitdshezs", - response.customDomainsForTopicsConfiguration().get(0).expectedTxtRecordName()); - Assertions.assertEquals("olrupjovm", - response.customDomainsForTopicsConfiguration().get(0).expectedTxtRecordValue()); - Assertions.assertEquals("pgkqzkcyzmffngdy", - response.customDomainsForTopicSpacesConfiguration().get(0).fullyQualifiedDomainName()); - Assertions.assertEquals(CustomDomainValidationState.ERROR_RETRIEVING_DNS_RECORD, - response.customDomainsForTopicSpacesConfiguration().get(0).validationState()); - Assertions.assertEquals(CustomDomainIdentityType.SYSTEM_ASSIGNED, - response.customDomainsForTopicSpacesConfiguration().get(0).identity().type()); - Assertions.assertEquals("cqvhoejgoiutgwrm", - response.customDomainsForTopicSpacesConfiguration().get(0).identity().userAssignedIdentity()); - Assertions.assertEquals("hpqhazyntacihn", - response.customDomainsForTopicSpacesConfiguration().get(0).certificateUrl()); - Assertions.assertEquals("gmipnmliqmvlbhik", - response.customDomainsForTopicSpacesConfiguration().get(0).expectedTxtRecordName()); - Assertions.assertEquals("qgrvg", - response.customDomainsForTopicSpacesConfiguration().get(0).expectedTxtRecordValue()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/OperationInfoTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/OperationInfoTests.java deleted file mode 100644 index 1a08ac747d3b..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/OperationInfoTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.OperationInfo; -import org.junit.jupiter.api.Assertions; - -public final class OperationInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInfo model = BinaryData.fromString( - "{\"provider\":\"wzf\",\"resource\":\"sttktlahbqa\",\"operation\":\"xtgzukxitmmqtgqq\",\"description\":\"hrnxrxc\"}") - .toObject(OperationInfo.class); - Assertions.assertEquals("wzf", model.provider()); - Assertions.assertEquals("sttktlahbqa", model.resource()); - Assertions.assertEquals("xtgzukxitmmqtgqq", model.operation()); - Assertions.assertEquals("hrnxrxc", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInfo model = new OperationInfo().withProvider("wzf") - .withResource("sttktlahbqa") - .withOperation("xtgzukxitmmqtgqq") - .withDescription("hrnxrxc"); - model = BinaryData.fromObject(model).toObject(OperationInfo.class); - Assertions.assertEquals("wzf", model.provider()); - Assertions.assertEquals("sttktlahbqa", model.resource()); - Assertions.assertEquals("xtgzukxitmmqtgqq", model.operation()); - Assertions.assertEquals("hrnxrxc", model.description()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/OperationInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/OperationInnerTests.java deleted file mode 100644 index 3af8710270c4..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/OperationInnerTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.OperationInner; -import com.azure.resourcemanager.eventgrid.models.OperationInfo; -import org.junit.jupiter.api.Assertions; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = BinaryData.fromString( - "{\"name\":\"bblgyavut\",\"display\":{\"provider\":\"joxoism\",\"resource\":\"sbpimlq\",\"operation\":\"jxkcgxxlxsff\",\"description\":\"vizqzdwl\"},\"origin\":\"lyoupfgfbkju\",\"isDataAction\":false,\"properties\":\"datagkfmins\"}") - .toObject(OperationInner.class); - Assertions.assertEquals("bblgyavut", model.name()); - Assertions.assertEquals("joxoism", model.display().provider()); - Assertions.assertEquals("sbpimlq", model.display().resource()); - Assertions.assertEquals("jxkcgxxlxsff", model.display().operation()); - Assertions.assertEquals("vizqzdwl", model.display().description()); - Assertions.assertEquals("lyoupfgfbkju", model.origin()); - Assertions.assertEquals(false, model.isDataAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withName("bblgyavut") - .withDisplay(new OperationInfo().withProvider("joxoism") - .withResource("sbpimlq") - .withOperation("jxkcgxxlxsff") - .withDescription("vizqzdwl")) - .withOrigin("lyoupfgfbkju") - .withIsDataAction(false) - .withProperties("datagkfmins"); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - Assertions.assertEquals("bblgyavut", model.name()); - Assertions.assertEquals("joxoism", model.display().provider()); - Assertions.assertEquals("sbpimlq", model.display().resource()); - Assertions.assertEquals("jxkcgxxlxsff", model.display().operation()); - Assertions.assertEquals("vizqzdwl", model.display().description()); - Assertions.assertEquals("lyoupfgfbkju", model.origin()); - Assertions.assertEquals(false, model.isDataAction()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/OperationsListMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/OperationsListMockTests.java deleted file mode 100644 index c480e56e76b7..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/OperationsListMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.Operation; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"bwayb\",\"display\":{\"provider\":\"afbgymqtn\",\"resource\":\"reojxrjnbsc\",\"operation\":\"xavipneychbj\",\"description\":\"qf\"},\"origin\":\"nwdxzedpqlrfbor\",\"isDataAction\":false,\"properties\":\"datalnfyzav\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("bwayb", response.iterator().next().name()); - Assertions.assertEquals("afbgymqtn", response.iterator().next().display().provider()); - Assertions.assertEquals("reojxrjnbsc", response.iterator().next().display().resource()); - Assertions.assertEquals("xavipneychbj", response.iterator().next().display().operation()); - Assertions.assertEquals("qf", response.iterator().next().display().description()); - Assertions.assertEquals("nwdxzedpqlrfbor", response.iterator().next().origin()); - Assertions.assertEquals(false, response.iterator().next().isDataAction()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/OperationsListResultTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/OperationsListResultTests.java deleted file mode 100644 index c0e0323c2b52..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/OperationsListResultTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.OperationInner; -import com.azure.resourcemanager.eventgrid.models.OperationInfo; -import com.azure.resourcemanager.eventgrid.models.OperationsListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationsListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"wbqpl\",\"display\":{\"provider\":\"nuuepzlrp\",\"resource\":\"zsoldwey\",\"operation\":\"dunvmnnrwrbiorkt\",\"description\":\"ywjhhgdnhx\"},\"origin\":\"ivfomiloxgg\",\"isDataAction\":false,\"properties\":\"dataq\"},{\"name\":\"ieuzaofjchvcyyy\",\"display\":{\"provider\":\"dotcubiipuip\",\"resource\":\"qonmacj\",\"operation\":\"nizshqvcim\",\"description\":\"vfgmblrrilby\"},\"origin\":\"xsmiccwrwfscjf\",\"isDataAction\":false,\"properties\":\"datazqujizdvoqytiby\"}]}") - .toObject(OperationsListResult.class); - Assertions.assertEquals("wbqpl", model.value().get(0).name()); - Assertions.assertEquals("nuuepzlrp", model.value().get(0).display().provider()); - Assertions.assertEquals("zsoldwey", model.value().get(0).display().resource()); - Assertions.assertEquals("dunvmnnrwrbiorkt", model.value().get(0).display().operation()); - Assertions.assertEquals("ywjhhgdnhx", model.value().get(0).display().description()); - Assertions.assertEquals("ivfomiloxgg", model.value().get(0).origin()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationsListResult model = new OperationsListResult().withValue(Arrays.asList( - new OperationInner().withName("wbqpl") - .withDisplay(new OperationInfo().withProvider("nuuepzlrp") - .withResource("zsoldwey") - .withOperation("dunvmnnrwrbiorkt") - .withDescription("ywjhhgdnhx")) - .withOrigin("ivfomiloxgg") - .withIsDataAction(false) - .withProperties("dataq"), - new OperationInner().withName("ieuzaofjchvcyyy") - .withDisplay(new OperationInfo().withProvider("dotcubiipuip") - .withResource("qonmacj") - .withOperation("nizshqvcim") - .withDescription("vfgmblrrilby")) - .withOrigin("xsmiccwrwfscjf") - .withIsDataAction(false) - .withProperties("datazqujizdvoqytiby"))); - model = BinaryData.fromObject(model).toObject(OperationsListResult.class); - Assertions.assertEquals("wbqpl", model.value().get(0).name()); - Assertions.assertEquals("nuuepzlrp", model.value().get(0).display().provider()); - Assertions.assertEquals("zsoldwey", model.value().get(0).display().resource()); - Assertions.assertEquals("dunvmnnrwrbiorkt", model.value().get(0).display().operation()); - Assertions.assertEquals("ywjhhgdnhx", model.value().get(0).display().description()); - Assertions.assertEquals("ivfomiloxgg", model.value().get(0).origin()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerConfigurationUpdateParameterPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerConfigurationUpdateParameterPropertiesTests.java deleted file mode 100644 index a059c84c6c2d..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerConfigurationUpdateParameterPropertiesTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.PartnerConfigurationUpdateParameterProperties; -import org.junit.jupiter.api.Assertions; - -public final class PartnerConfigurationUpdateParameterPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartnerConfigurationUpdateParameterProperties model - = BinaryData.fromString("{\"defaultMaximumExpirationTimeInDays\":1236254057}") - .toObject(PartnerConfigurationUpdateParameterProperties.class); - Assertions.assertEquals(1236254057, model.defaultMaximumExpirationTimeInDays()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartnerConfigurationUpdateParameterProperties model - = new PartnerConfigurationUpdateParameterProperties().withDefaultMaximumExpirationTimeInDays(1236254057); - model = BinaryData.fromObject(model).toObject(PartnerConfigurationUpdateParameterProperties.class); - Assertions.assertEquals(1236254057, model.defaultMaximumExpirationTimeInDays()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerConfigurationUpdateParametersTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerConfigurationUpdateParametersTests.java deleted file mode 100644 index bf9ace6773bd..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerConfigurationUpdateParametersTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.PartnerConfigurationUpdateParameters; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PartnerConfigurationUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartnerConfigurationUpdateParameters model = BinaryData.fromString( - "{\"tags\":{\"y\":\"e\",\"imsidxasicddyvvj\":\"uxakjsqzhzbezk\"},\"properties\":{\"defaultMaximumExpirationTimeInDays\":171157625}}") - .toObject(PartnerConfigurationUpdateParameters.class); - Assertions.assertEquals("e", model.tags().get("y")); - Assertions.assertEquals(171157625, model.defaultMaximumExpirationTimeInDays()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartnerConfigurationUpdateParameters model - = new PartnerConfigurationUpdateParameters().withTags(mapOf("y", "e", "imsidxasicddyvvj", "uxakjsqzhzbezk")) - .withDefaultMaximumExpirationTimeInDays(171157625); - model = BinaryData.fromObject(model).toObject(PartnerConfigurationUpdateParameters.class); - Assertions.assertEquals("e", model.tags().get("y")); - Assertions.assertEquals(171157625, model.defaultMaximumExpirationTimeInDays()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerConfigurationsDeleteMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerConfigurationsDeleteMockTests.java deleted file mode 100644 index e6950f50a58d..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerConfigurationsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PartnerConfigurationsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.partnerConfigurations().delete("ivykp", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerDetailsTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerDetailsTests.java deleted file mode 100644 index da498d9fa62d..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerDetailsTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.PartnerDetails; -import org.junit.jupiter.api.Assertions; - -public final class PartnerDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartnerDetails model = BinaryData - .fromString("{\"description\":\"fhfv\",\"longDescription\":\"mknbnxwcdommpv\",\"setupUri\":\"awz\"}") - .toObject(PartnerDetails.class); - Assertions.assertEquals("fhfv", model.description()); - Assertions.assertEquals("mknbnxwcdommpv", model.longDescription()); - Assertions.assertEquals("awz", model.setupUri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartnerDetails model - = new PartnerDetails().withDescription("fhfv").withLongDescription("mknbnxwcdommpv").withSetupUri("awz"); - model = BinaryData.fromObject(model).toObject(PartnerDetails.class); - Assertions.assertEquals("fhfv", model.description()); - Assertions.assertEquals("mknbnxwcdommpv", model.longDescription()); - Assertions.assertEquals("awz", model.setupUri()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespaceInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespaceInnerTests.java deleted file mode 100644 index c450e9b73358..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespaceInnerTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.PartnerNamespaceInner; -import com.azure.resourcemanager.eventgrid.models.InboundIpRule; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PartnerTopicRoutingMode; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PartnerNamespaceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartnerNamespaceInner model = BinaryData.fromString( - "{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"hvjhhnakzyb\"},\"groupIds\":[\"idjks\"],\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"vxevblb\",\"actionsRequired\":\"dnlj\"},\"provisioningState\":\"Canceled\"},\"id\":\"euaulxu\",\"name\":\"smjbnkppxyn\",\"type\":\"nlsvxeiz\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"lnsrmffe\"},\"groupIds\":[\"ckt\",\"iymerteeammxqi\",\"kk\",\"zddrt\"],\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"bmxva\",\"actionsRequired\":\"efdeesve\"},\"provisioningState\":\"Deleting\"},\"id\":\"jpxtxsuwprtuj\",\"name\":\"sawddjibabxvi\",\"type\":\"itvtzeexavo\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"lecdmdqbw\"},\"groupIds\":[\"q\",\"gsfjac\",\"slhhxudbxv\"],\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"sirudhzmmesckdlp\",\"actionsRequired\":\"zrcxfailcfxwmdbo\"},\"provisioningState\":\"Failed\"},\"id\":\"gsftufqobrjlnacg\",\"name\":\"ckknhxkizvy\",\"type\":\"nrzvuljraaer\"}],\"provisioningState\":\"Succeeded\",\"partnerRegistrationFullyQualifiedId\":\"qgukkjqnv\",\"minimumTlsVersionAllowed\":\"1.0\",\"endpoint\":\"laxxulc\",\"publicNetworkAccess\":\"Disabled\",\"inboundIpRules\":[{\"ipMask\":\"fj\",\"action\":\"Allow\"},{\"ipMask\":\"g\",\"action\":\"Allow\"}],\"disableLocalAuth\":false,\"partnerTopicRoutingMode\":\"SourceEventAttribute\"},\"location\":\"cytdclxgccknfnwm\",\"tags\":{\"edxihchrphkmcrj\":\"vpdvjdhttzae\",\"kdghrjeuutlwx\":\"qnsdfzpbgtgky\",\"zhokvbwnhh\":\"z\",\"pipifh\":\"qlgehg\"},\"id\":\"f\",\"name\":\"oajvgcxtxjcs\",\"type\":\"eafidltugsresm\"}") - .toObject(PartnerNamespaceInner.class); - Assertions.assertEquals("cytdclxgccknfnwm", model.location()); - Assertions.assertEquals("vpdvjdhttzae", model.tags().get("edxihchrphkmcrj")); - Assertions.assertEquals("qgukkjqnv", model.partnerRegistrationFullyQualifiedId()); - Assertions.assertEquals(TlsVersion.ONE_ZERO, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("fj", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(false, model.disableLocalAuth()); - Assertions.assertEquals(PartnerTopicRoutingMode.SOURCE_EVENT_ATTRIBUTE, model.partnerTopicRoutingMode()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartnerNamespaceInner model = new PartnerNamespaceInner().withLocation("cytdclxgccknfnwm") - .withTags(mapOf("edxihchrphkmcrj", "vpdvjdhttzae", "kdghrjeuutlwx", "qnsdfzpbgtgky", "zhokvbwnhh", "z", - "pipifh", "qlgehg")) - .withPartnerRegistrationFullyQualifiedId("qgukkjqnv") - .withMinimumTlsVersionAllowed(TlsVersion.ONE_ZERO) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) - .withInboundIpRules(Arrays.asList(new InboundIpRule().withIpMask("fj").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("g").withAction(IpActionType.ALLOW))) - .withDisableLocalAuth(false) - .withPartnerTopicRoutingMode(PartnerTopicRoutingMode.SOURCE_EVENT_ATTRIBUTE); - model = BinaryData.fromObject(model).toObject(PartnerNamespaceInner.class); - Assertions.assertEquals("cytdclxgccknfnwm", model.location()); - Assertions.assertEquals("vpdvjdhttzae", model.tags().get("edxihchrphkmcrj")); - Assertions.assertEquals("qgukkjqnv", model.partnerRegistrationFullyQualifiedId()); - Assertions.assertEquals(TlsVersion.ONE_ZERO, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("fj", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(false, model.disableLocalAuth()); - Assertions.assertEquals(PartnerTopicRoutingMode.SOURCE_EVENT_ATTRIBUTE, model.partnerTopicRoutingMode()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespacePropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespacePropertiesTests.java deleted file mode 100644 index c7bea180cd9e..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespacePropertiesTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.PartnerNamespaceProperties; -import com.azure.resourcemanager.eventgrid.models.InboundIpRule; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PartnerTopicRoutingMode; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PartnerNamespacePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartnerNamespaceProperties model = BinaryData.fromString( - "{\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"iftxfkf\"},\"groupIds\":[\"prhptillu\"],\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"gdqoh\",\"actionsRequired\":\"wsldrizetpwbr\"},\"provisioningState\":\"Updating\"},\"id\":\"libph\",\"name\":\"qzmiza\",\"type\":\"a\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"jpdn\"},\"groupIds\":[\"ajoylhjl\"],\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"primr\",\"actionsRequired\":\"pteecjme\"},\"provisioningState\":\"Canceled\"},\"id\":\"stvasylwxdzaumw\",\"name\":\"oohgu\",\"type\":\"fuzboyjathwtzolb\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"m\"},\"groupIds\":[\"ebwjscjpahlxvea\",\"f\",\"xnmwmqtibxyijddt\"],\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"adijaeukmrsie\",\"actionsRequired\":\"pndzaapmudqmeq\"},\"provisioningState\":\"Creating\"},\"id\":\"pibudqwyxebeybpm\",\"name\":\"znrtffyaqit\",\"type\":\"hheioqaqhvseuf\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"xpdlcgqlsis\"},\"groupIds\":[\"frddgamquhiosrsj\",\"ivfcdisyirnx\"],\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"xrxzbujrtr\",\"actionsRequired\":\"vwrevkhgnlnzon\"},\"provisioningState\":\"Succeeded\"},\"id\":\"piqywnc\",\"name\":\"jtszcof\",\"type\":\"zehtdhgb\"}],\"provisioningState\":\"Creating\",\"partnerRegistrationFullyQualifiedId\":\"eljeamurvzmlovua\",\"minimumTlsVersionAllowed\":\"1.0\",\"endpoint\":\"cxlpmjerb\",\"publicNetworkAccess\":\"Disabled\",\"inboundIpRules\":[{\"ipMask\":\"di\",\"action\":\"Allow\"},{\"ipMask\":\"db\",\"action\":\"Allow\"},{\"ipMask\":\"monfdgnwncypuuww\",\"action\":\"Allow\"}],\"disableLocalAuth\":true,\"partnerTopicRoutingMode\":\"ChannelNameHeader\"}") - .toObject(PartnerNamespaceProperties.class); - Assertions.assertEquals("eljeamurvzmlovua", model.partnerRegistrationFullyQualifiedId()); - Assertions.assertEquals(TlsVersion.ONE_ZERO, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("di", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(true, model.disableLocalAuth()); - Assertions.assertEquals(PartnerTopicRoutingMode.CHANNEL_NAME_HEADER, model.partnerTopicRoutingMode()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartnerNamespaceProperties model - = new PartnerNamespaceProperties().withPartnerRegistrationFullyQualifiedId("eljeamurvzmlovua") - .withMinimumTlsVersionAllowed(TlsVersion.ONE_ZERO) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) - .withInboundIpRules(Arrays.asList(new InboundIpRule().withIpMask("di").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("db").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("monfdgnwncypuuww").withAction(IpActionType.ALLOW))) - .withDisableLocalAuth(true) - .withPartnerTopicRoutingMode(PartnerTopicRoutingMode.CHANNEL_NAME_HEADER); - model = BinaryData.fromObject(model).toObject(PartnerNamespaceProperties.class); - Assertions.assertEquals("eljeamurvzmlovua", model.partnerRegistrationFullyQualifiedId()); - Assertions.assertEquals(TlsVersion.ONE_ZERO, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, model.publicNetworkAccess()); - Assertions.assertEquals("di", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(true, model.disableLocalAuth()); - Assertions.assertEquals(PartnerTopicRoutingMode.CHANNEL_NAME_HEADER, model.partnerTopicRoutingMode()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespaceUpdateParameterPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespaceUpdateParameterPropertiesTests.java deleted file mode 100644 index beb695ea90c0..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespaceUpdateParameterPropertiesTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.PartnerNamespaceUpdateParameterProperties; -import com.azure.resourcemanager.eventgrid.models.InboundIpRule; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PartnerNamespaceUpdateParameterPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartnerNamespaceUpdateParameterProperties model = BinaryData.fromString( - "{\"publicNetworkAccess\":\"Enabled\",\"inboundIpRules\":[{\"ipMask\":\"kcxk\",\"action\":\"Allow\"},{\"ipMask\":\"xmysuxswqrntv\",\"action\":\"Allow\"}],\"minimumTlsVersionAllowed\":\"1.2\",\"disableLocalAuth\":true}") - .toObject(PartnerNamespaceUpdateParameterProperties.class); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - Assertions.assertEquals("kcxk", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(TlsVersion.ONE_TWO, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(true, model.disableLocalAuth()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartnerNamespaceUpdateParameterProperties model - = new PartnerNamespaceUpdateParameterProperties().withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withInboundIpRules(Arrays.asList(new InboundIpRule().withIpMask("kcxk").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("xmysuxswqrntv").withAction(IpActionType.ALLOW))) - .withMinimumTlsVersionAllowed(TlsVersion.ONE_TWO) - .withDisableLocalAuth(true); - model = BinaryData.fromObject(model).toObject(PartnerNamespaceUpdateParameterProperties.class); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - Assertions.assertEquals("kcxk", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(TlsVersion.ONE_TWO, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(true, model.disableLocalAuth()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespaceUpdateParametersTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespaceUpdateParametersTests.java deleted file mode 100644 index 81ab27899dbf..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespaceUpdateParametersTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.InboundIpRule; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PartnerNamespaceUpdateParameters; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PartnerNamespaceUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartnerNamespaceUpdateParameters model = BinaryData.fromString( - "{\"tags\":{\"keifzzhmkdasv\":\"e\",\"cu\":\"lyhb\",\"boldforobwj\":\"chxgs\",\"vacqpbtuodxesz\":\"vizbfhfo\"},\"properties\":{\"publicNetworkAccess\":\"Enabled\",\"inboundIpRules\":[{\"ipMask\":\"umuaslzkwrrwoycq\",\"action\":\"Allow\"},{\"ipMask\":\"hahnomdrkywuhps\",\"action\":\"Allow\"},{\"ipMask\":\"rutlwexxwlalniex\",\"action\":\"Allow\"},{\"ipMask\":\"pgepqtybbwwpgda\",\"action\":\"Allow\"}],\"minimumTlsVersionAllowed\":\"1.2\",\"disableLocalAuth\":true}}") - .toObject(PartnerNamespaceUpdateParameters.class); - Assertions.assertEquals("e", model.tags().get("keifzzhmkdasv")); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - Assertions.assertEquals("umuaslzkwrrwoycq", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(TlsVersion.ONE_TWO, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(true, model.disableLocalAuth()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartnerNamespaceUpdateParameters model = new PartnerNamespaceUpdateParameters() - .withTags(mapOf("keifzzhmkdasv", "e", "cu", "lyhb", "boldforobwj", "chxgs", "vacqpbtuodxesz", "vizbfhfo")) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withInboundIpRules( - Arrays.asList(new InboundIpRule().withIpMask("umuaslzkwrrwoycq").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("hahnomdrkywuhps").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("rutlwexxwlalniex").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("pgepqtybbwwpgda").withAction(IpActionType.ALLOW))) - .withMinimumTlsVersionAllowed(TlsVersion.ONE_TWO) - .withDisableLocalAuth(true); - model = BinaryData.fromObject(model).toObject(PartnerNamespaceUpdateParameters.class); - Assertions.assertEquals("e", model.tags().get("keifzzhmkdasv")); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - Assertions.assertEquals("umuaslzkwrrwoycq", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(TlsVersion.ONE_TWO, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(true, model.disableLocalAuth()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespacesDeleteMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespacesDeleteMockTests.java deleted file mode 100644 index 2121ee684c05..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespacesDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PartnerNamespacesDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.partnerNamespaces().delete("zkqxsalu", "yigfcvcew", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespacesGetByResourceGroupWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespacesGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 36b197114b61..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespacesGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PartnerNamespace; -import com.azure.resourcemanager.eventgrid.models.PartnerTopicRoutingMode; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PartnerNamespacesGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"apdyarikeejdpdfh\",\"wmmkfq\",\"r\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"wwtrjm\",\"name\":\"qkvyhzokpoyuohu\",\"type\":\"nsnaajphmp\"},{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"lpwsadaxjs\",\"mxpezco\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Creating\"},\"id\":\"rmfqzwq\",\"name\":\"nxkeed\",\"type\":\"nwmywxfqzkvemy\"}],\"provisioningState\":\"Failed\",\"partnerRegistrationFullyQualifiedId\":\"zaqpqi\",\"minimumTlsVersionAllowed\":\"1.2\",\"endpoint\":\"ptrwtxzuisamo\",\"publicNetworkAccess\":\"Enabled\",\"inboundIpRules\":[{\"ipMask\":\"exroqsqjghrmth\",\"action\":\"Allow\"},{\"ipMask\":\"sttxs\",\"action\":\"Allow\"},{\"ipMask\":\"qpaniceovxgzwhs\",\"action\":\"Allow\"}],\"disableLocalAuth\":false,\"partnerTopicRoutingMode\":\"SourceEventAttribute\"},\"location\":\"kesliky\",\"tags\":{\"qqqdseipnquwz\":\"ixyqhfnkvy\"},\"id\":\"hrptyodlhkfktltd\",\"name\":\"sobjop\",\"type\":\"ouhbq\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PartnerNamespace response = manager.partnerNamespaces() - .getByResourceGroupWithResponse("r", "w", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("kesliky", response.location()); - Assertions.assertEquals("ixyqhfnkvy", response.tags().get("qqqdseipnquwz")); - Assertions.assertEquals("zaqpqi", response.partnerRegistrationFullyQualifiedId()); - Assertions.assertEquals(TlsVersion.ONE_TWO, response.minimumTlsVersionAllowed()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, response.publicNetworkAccess()); - Assertions.assertEquals("exroqsqjghrmth", response.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, response.inboundIpRules().get(0).action()); - Assertions.assertEquals(false, response.disableLocalAuth()); - Assertions.assertEquals(PartnerTopicRoutingMode.SOURCE_EVENT_ATTRIBUTE, response.partnerTopicRoutingMode()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespacesListByResourceGroupMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespacesListByResourceGroupMockTests.java deleted file mode 100644 index 2ff115dd8fb6..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespacesListByResourceGroupMockTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PartnerNamespace; -import com.azure.resourcemanager.eventgrid.models.PartnerTopicRoutingMode; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PartnerNamespacesListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"bfijzzcaoijol\",\"uauktwieopexelx\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Deleting\"},\"id\":\"swyiljpibkgxyxy\",\"name\":\"ux\",\"type\":\"eddobmcnltm\"},{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"jsqy\",\"mmoxfablqgpwbmwh\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Canceled\"},\"id\":\"iwrycgnwplrrb\",\"name\":\"hctsbbibti\",\"type\":\"uhqvums\"}],\"provisioningState\":\"Failed\",\"partnerRegistrationFullyQualifiedId\":\"feq\",\"minimumTlsVersionAllowed\":\"1.0\",\"endpoint\":\"f\",\"publicNetworkAccess\":\"Disabled\",\"inboundIpRules\":[{\"ipMask\":\"yxmzrmtmvwituwey\",\"action\":\"Allow\"},{\"ipMask\":\"cybwfuppoxprcm\",\"action\":\"Allow\"},{\"ipMask\":\"jxdiikmoxrezsv\",\"action\":\"Allow\"},{\"ipMask\":\"xikjm\",\"action\":\"Allow\"}],\"disableLocalAuth\":false,\"partnerTopicRoutingMode\":\"SourceEventAttribute\"},\"location\":\"pcwybsz\",\"tags\":{\"wf\":\"npatpftsae\",\"exojfccy\":\"hxorpwaltzwu\"},\"id\":\"h\",\"name\":\"rh\",\"type\":\"hvazjpwexcdr\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.partnerNamespaces() - .listByResourceGroup("aoq", "sgptotxjq", 523647498, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("pcwybsz", response.iterator().next().location()); - Assertions.assertEquals("npatpftsae", response.iterator().next().tags().get("wf")); - Assertions.assertEquals("feq", response.iterator().next().partnerRegistrationFullyQualifiedId()); - Assertions.assertEquals(TlsVersion.ONE_ZERO, response.iterator().next().minimumTlsVersionAllowed()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, response.iterator().next().publicNetworkAccess()); - Assertions.assertEquals("yxmzrmtmvwituwey", response.iterator().next().inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, response.iterator().next().inboundIpRules().get(0).action()); - Assertions.assertEquals(false, response.iterator().next().disableLocalAuth()); - Assertions.assertEquals(PartnerTopicRoutingMode.SOURCE_EVENT_ATTRIBUTE, - response.iterator().next().partnerTopicRoutingMode()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespacesListMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespacesListMockTests.java deleted file mode 100644 index 753a28010aae..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespacesListMockTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PartnerNamespace; -import com.azure.resourcemanager.eventgrid.models.PartnerTopicRoutingMode; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PartnerNamespacesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"fsq\",\"hyqmrejparnpv\",\"rsz\",\"bwtdr\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Creating\"},\"id\":\"w\",\"name\":\"l\",\"type\":\"zlhhfix\"}],\"provisioningState\":\"Deleting\",\"partnerRegistrationFullyQualifiedId\":\"ulz\",\"minimumTlsVersionAllowed\":\"1.1\",\"endpoint\":\"pfywv\",\"publicNetworkAccess\":\"Enabled\",\"inboundIpRules\":[{\"ipMask\":\"fzxsoxinunjlzkd\",\"action\":\"Allow\"},{\"ipMask\":\"sxyt\",\"action\":\"Allow\"},{\"ipMask\":\"miwdwisvnme\",\"action\":\"Allow\"},{\"ipMask\":\"amcajyhftpzcrryk\",\"action\":\"Allow\"}],\"disableLocalAuth\":true,\"partnerTopicRoutingMode\":\"ChannelNameHeader\"},\"location\":\"hkigglclwalhvub\",\"tags\":{\"yctajqz\":\"phetxdqc\",\"xb\":\"vale\",\"yxsbfpz\":\"biwksde\"},\"id\":\"oikvntwcz\",\"name\":\"zwushlcxpblal\",\"type\":\"hezpfkissaidqzs\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response - = manager.partnerNamespaces().list("wqhdgsjsa", 1711960730, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("hkigglclwalhvub", response.iterator().next().location()); - Assertions.assertEquals("phetxdqc", response.iterator().next().tags().get("yctajqz")); - Assertions.assertEquals("ulz", response.iterator().next().partnerRegistrationFullyQualifiedId()); - Assertions.assertEquals(TlsVersion.ONE_ONE, response.iterator().next().minimumTlsVersionAllowed()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, response.iterator().next().publicNetworkAccess()); - Assertions.assertEquals("fzxsoxinunjlzkd", response.iterator().next().inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, response.iterator().next().inboundIpRules().get(0).action()); - Assertions.assertEquals(true, response.iterator().next().disableLocalAuth()); - Assertions.assertEquals(PartnerTopicRoutingMode.CHANNEL_NAME_HEADER, - response.iterator().next().partnerTopicRoutingMode()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespacesListResultTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespacesListResultTests.java deleted file mode 100644 index 3fee3d1d50a8..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerNamespacesListResultTests.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.PartnerNamespaceInner; -import com.azure.resourcemanager.eventgrid.models.InboundIpRule; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PartnerNamespacesListResult; -import com.azure.resourcemanager.eventgrid.models.PartnerTopicRoutingMode; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PartnerNamespacesListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartnerNamespacesListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{},\"id\":\"pwcyyufmhr\",\"name\":\"nc\",\"type\":\"wmqs\"},{\"properties\":{},\"id\":\"cdqzhlctddu\",\"name\":\"qn\",\"type\":\"yfp\"},{\"properties\":{},\"id\":\"rqbnjjrc\",\"name\":\"egy\",\"type\":\"cw\"}],\"provisioningState\":\"Deleting\",\"partnerRegistrationFullyQualifiedId\":\"umvq\",\"minimumTlsVersionAllowed\":\"1.2\",\"endpoint\":\"hrraiouaubrj\",\"publicNetworkAccess\":\"Enabled\",\"inboundIpRules\":[{\"ipMask\":\"uojrngiflr\",\"action\":\"Allow\"},{\"ipMask\":\"ccbiuimzdlyjdfq\",\"action\":\"Allow\"}],\"disableLocalAuth\":false,\"partnerTopicRoutingMode\":\"SourceEventAttribute\"},\"location\":\"dvruzslzojhpctf\",\"tags\":{\"zihgrkyu\":\"xotngfdguge\",\"mfp\":\"zabs\"},\"id\":\"hojeevy\",\"name\":\"yhsgz\",\"type\":\"czbgomfgbeg\"},{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{},\"id\":\"o\",\"name\":\"i\",\"type\":\"etnluankrrfx\"},{\"properties\":{},\"id\":\"ebtijvacvbmqzbqq\",\"name\":\"lajrnwxacevehj\",\"type\":\"uyxoaf\"},{\"properties\":{},\"id\":\"oqltfae\",\"name\":\"linmfgv\",\"type\":\"irpghriypoqeyh\"},{\"properties\":{},\"id\":\"h\",\"name\":\"kprlpyznuc\",\"type\":\"qdsmexiit\"}],\"provisioningState\":\"Failed\",\"partnerRegistrationFullyQualifiedId\":\"tyasiibmiybnnust\",\"minimumTlsVersionAllowed\":\"1.0\",\"endpoint\":\"hnmgixhcm\",\"publicNetworkAccess\":\"Disabled\",\"inboundIpRules\":[{\"ipMask\":\"udorh\",\"action\":\"Allow\"},{\"ipMask\":\"prot\",\"action\":\"Allow\"}],\"disableLocalAuth\":false,\"partnerTopicRoutingMode\":\"ChannelNameHeader\"},\"location\":\"xhugcm\",\"tags\":{\"bmftpmdt\":\"vlgo\"},\"id\":\"fjltfvnzcyjtotp\",\"name\":\"opv\",\"type\":\"bdb\"},{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{},\"id\":\"ihed\",\"name\":\"vqwt\",\"type\":\"mkyi\"},{\"properties\":{},\"id\":\"ysi\",\"name\":\"sgqcwdho\",\"type\":\"sdtmcdzs\"},{\"properties\":{},\"id\":\"cohdx\",\"name\":\"zlmcmuapcvhdb\",\"type\":\"v\"},{\"properties\":{},\"id\":\"qxeysko\",\"name\":\"qzinkfkbg\",\"type\":\"z\"}],\"provisioningState\":\"Creating\",\"partnerRegistrationFullyQualifiedId\":\"eqocljmygvk\",\"minimumTlsVersionAllowed\":\"1.2\",\"endpoint\":\"jeokbzefezrxccz\",\"publicNetworkAccess\":\"Disabled\",\"inboundIpRules\":[{\"ipMask\":\"pqxbkwvzgnzvdf\",\"action\":\"Allow\"}],\"disableLocalAuth\":true,\"partnerTopicRoutingMode\":\"SourceEventAttribute\"},\"location\":\"pnodawopqhe\",\"tags\":{\"bostzel\":\"tmcg\",\"tmzlbiojlv\":\"dlat\",\"r\":\"hrbbpneqvcwwyy\",\"nmokayzejnhlbk\":\"ochpprpr\"},\"id\":\"bzpcpiljhahzvec\",\"name\":\"ndbnwieh\",\"type\":\"lewjwiuubwef\"},{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{},\"id\":\"aqtferr\",\"name\":\"wexjkmfxapjwogq\",\"type\":\"nobpudcdabtqwpw\"}],\"provisioningState\":\"Deleting\",\"partnerRegistrationFullyQualifiedId\":\"zasqbucljgkyexao\",\"minimumTlsVersionAllowed\":\"1.1\",\"endpoint\":\"i\",\"publicNetworkAccess\":\"Disabled\",\"inboundIpRules\":[{\"ipMask\":\"ultxijjumfq\",\"action\":\"Allow\"},{\"ipMask\":\"nqnm\",\"action\":\"Allow\"},{\"ipMask\":\"zqdqxt\",\"action\":\"Allow\"},{\"ipMask\":\"nyfusfzsvtuikzh\",\"action\":\"Allow\"}],\"disableLocalAuth\":true,\"partnerTopicRoutingMode\":\"SourceEventAttribute\"},\"location\":\"mlrqryxynqnz\",\"tags\":{\"abpfhvfs\":\"sovwxznptgoeiyb\"},\"id\":\"kvntjlrigjkskyri\",\"name\":\"ovzidsx\",\"type\":\"aabzmif\"}],\"nextLink\":\"gznmmaxrizkzob\"}") - .toObject(PartnerNamespacesListResult.class); - Assertions.assertEquals("dvruzslzojhpctf", model.value().get(0).location()); - Assertions.assertEquals("xotngfdguge", model.value().get(0).tags().get("zihgrkyu")); - Assertions.assertEquals("umvq", model.value().get(0).partnerRegistrationFullyQualifiedId()); - Assertions.assertEquals(TlsVersion.ONE_TWO, model.value().get(0).minimumTlsVersionAllowed()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.value().get(0).publicNetworkAccess()); - Assertions.assertEquals("uojrngiflr", model.value().get(0).inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.value().get(0).inboundIpRules().get(0).action()); - Assertions.assertEquals(false, model.value().get(0).disableLocalAuth()); - Assertions.assertEquals(PartnerTopicRoutingMode.SOURCE_EVENT_ATTRIBUTE, - model.value().get(0).partnerTopicRoutingMode()); - Assertions.assertEquals("gznmmaxrizkzob", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartnerNamespacesListResult model - = new PartnerNamespacesListResult() - .withValue( - Arrays.asList( - new PartnerNamespaceInner().withLocation("dvruzslzojhpctf") - .withTags(mapOf("zihgrkyu", "xotngfdguge", "mfp", "zabs")) - .withPartnerRegistrationFullyQualifiedId("umvq") - .withMinimumTlsVersionAllowed(TlsVersion.ONE_TWO) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withInboundIpRules(Arrays.asList( - new InboundIpRule().withIpMask("uojrngiflr").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("ccbiuimzdlyjdfq").withAction(IpActionType.ALLOW))) - .withDisableLocalAuth(false) - .withPartnerTopicRoutingMode(PartnerTopicRoutingMode.SOURCE_EVENT_ATTRIBUTE), - new PartnerNamespaceInner().withLocation("xhugcm") - .withTags(mapOf("bmftpmdt", "vlgo")) - .withPartnerRegistrationFullyQualifiedId("tyasiibmiybnnust") - .withMinimumTlsVersionAllowed(TlsVersion.ONE_ZERO) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) - .withInboundIpRules(Arrays.asList(new InboundIpRule() - .withIpMask("udorh") - .withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("prot").withAction(IpActionType.ALLOW))) - .withDisableLocalAuth(false) - .withPartnerTopicRoutingMode(PartnerTopicRoutingMode.CHANNEL_NAME_HEADER), - new PartnerNamespaceInner().withLocation("pnodawopqhe") - .withTags(mapOf("bostzel", "tmcg", "tmzlbiojlv", "dlat", "r", "hrbbpneqvcwwyy", - "nmokayzejnhlbk", "ochpprpr")) - .withPartnerRegistrationFullyQualifiedId("eqocljmygvk") - .withMinimumTlsVersionAllowed(TlsVersion.ONE_TWO) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) - .withInboundIpRules(Arrays.asList( - new InboundIpRule().withIpMask("pqxbkwvzgnzvdf").withAction(IpActionType.ALLOW))) - .withDisableLocalAuth(true) - .withPartnerTopicRoutingMode(PartnerTopicRoutingMode.SOURCE_EVENT_ATTRIBUTE), - new PartnerNamespaceInner().withLocation("mlrqryxynqnz") - .withTags(mapOf("abpfhvfs", "sovwxznptgoeiyb")) - .withPartnerRegistrationFullyQualifiedId("zasqbucljgkyexao") - .withMinimumTlsVersionAllowed(TlsVersion.ONE_ONE) - .withPublicNetworkAccess(PublicNetworkAccess.DISABLED) - .withInboundIpRules(Arrays.asList( - new InboundIpRule().withIpMask("ultxijjumfq").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("nqnm").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("zqdqxt").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("nyfusfzsvtuikzh").withAction(IpActionType.ALLOW))) - .withDisableLocalAuth(true) - .withPartnerTopicRoutingMode(PartnerTopicRoutingMode.SOURCE_EVENT_ATTRIBUTE))) - .withNextLink("gznmmaxrizkzob"); - model = BinaryData.fromObject(model).toObject(PartnerNamespacesListResult.class); - Assertions.assertEquals("dvruzslzojhpctf", model.value().get(0).location()); - Assertions.assertEquals("xotngfdguge", model.value().get(0).tags().get("zihgrkyu")); - Assertions.assertEquals("umvq", model.value().get(0).partnerRegistrationFullyQualifiedId()); - Assertions.assertEquals(TlsVersion.ONE_TWO, model.value().get(0).minimumTlsVersionAllowed()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.value().get(0).publicNetworkAccess()); - Assertions.assertEquals("uojrngiflr", model.value().get(0).inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.value().get(0).inboundIpRules().get(0).action()); - Assertions.assertEquals(false, model.value().get(0).disableLocalAuth()); - Assertions.assertEquals(PartnerTopicRoutingMode.SOURCE_EVENT_ATTRIBUTE, - model.value().get(0).partnerTopicRoutingMode()); - Assertions.assertEquals("gznmmaxrizkzob", model.nextLink()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationInnerTests.java deleted file mode 100644 index 251132ec1264..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationInnerTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.PartnerRegistrationInner; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; - -public final class PartnerRegistrationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartnerRegistrationInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Canceled\",\"partnerRegistrationImmutableId\":\"2923c80d-15e1-491f-b064-5346099d5efa\"},\"location\":\"llxecwc\",\"tags\":{\"mvi\":\"phslhcawjutifdw\",\"bttzhraglkafhonq\":\"orq\",\"vcpopmxe\":\"ujeickp\"},\"id\":\"nwcl\",\"name\":\"yjede\",\"type\":\"xm\"}") - .toObject(PartnerRegistrationInner.class); - Assertions.assertEquals("llxecwc", model.location()); - Assertions.assertEquals("phslhcawjutifdw", model.tags().get("mvi")); - Assertions.assertEquals(UUID.fromString("2923c80d-15e1-491f-b064-5346099d5efa"), - model.partnerRegistrationImmutableId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartnerRegistrationInner model = new PartnerRegistrationInner().withLocation("llxecwc") - .withTags(mapOf("mvi", "phslhcawjutifdw", "bttzhraglkafhonq", "orq", "vcpopmxe", "ujeickp")) - .withPartnerRegistrationImmutableId(UUID.fromString("2923c80d-15e1-491f-b064-5346099d5efa")); - model = BinaryData.fromObject(model).toObject(PartnerRegistrationInner.class); - Assertions.assertEquals("llxecwc", model.location()); - Assertions.assertEquals("phslhcawjutifdw", model.tags().get("mvi")); - Assertions.assertEquals(UUID.fromString("2923c80d-15e1-491f-b064-5346099d5efa"), - model.partnerRegistrationImmutableId()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationPropertiesTests.java deleted file mode 100644 index eb14b2705b73..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationPropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.PartnerRegistrationProperties; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; - -public final class PartnerRegistrationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartnerRegistrationProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Succeeded\",\"partnerRegistrationImmutableId\":\"bb733e08-2a6a-47ab-8f2f-596d46d46fdf\"}") - .toObject(PartnerRegistrationProperties.class); - Assertions.assertEquals(UUID.fromString("bb733e08-2a6a-47ab-8f2f-596d46d46fdf"), - model.partnerRegistrationImmutableId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartnerRegistrationProperties model = new PartnerRegistrationProperties() - .withPartnerRegistrationImmutableId(UUID.fromString("bb733e08-2a6a-47ab-8f2f-596d46d46fdf")); - model = BinaryData.fromObject(model).toObject(PartnerRegistrationProperties.class); - Assertions.assertEquals(UUID.fromString("bb733e08-2a6a-47ab-8f2f-596d46d46fdf"), - model.partnerRegistrationImmutableId()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationUpdateParametersTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationUpdateParametersTests.java deleted file mode 100644 index 1801cd64c991..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationUpdateParametersTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.PartnerRegistrationUpdateParameters; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PartnerRegistrationUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartnerRegistrationUpdateParameters model = BinaryData.fromString( - "{\"tags\":{\"tzxpuamwabzxrv\":\"cazuaw\",\"phai\":\"cush\",\"wakoihkn\":\"mxyasflvgsgzw\",\"zotqyryuzcb\":\"mjblmljhlny\"}}") - .toObject(PartnerRegistrationUpdateParameters.class); - Assertions.assertEquals("cazuaw", model.tags().get("tzxpuamwabzxrv")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartnerRegistrationUpdateParameters model - = new PartnerRegistrationUpdateParameters().withTags(mapOf("tzxpuamwabzxrv", "cazuaw", "phai", "cush", - "wakoihkn", "mxyasflvgsgzw", "zotqyryuzcb", "mjblmljhlny")); - model = BinaryData.fromObject(model).toObject(PartnerRegistrationUpdateParameters.class); - Assertions.assertEquals("cazuaw", model.tags().get("tzxpuamwabzxrv")); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationsCreateOrUpdateMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationsCreateOrUpdateMockTests.java deleted file mode 100644 index 63aac0043a70..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.PartnerRegistration; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PartnerRegistrationsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"partnerRegistrationImmutableId\":\"0adbab65-218c-421b-9644-8d284a77c803\"},\"location\":\"ttpfsmwgsgh\",\"tags\":{\"thxuarigrjdl\":\"umlddauqmllfe\"},\"id\":\"lkqhvkrbzkua\",\"name\":\"taxklpruu\",\"type\":\"hgltoizwxvs\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PartnerRegistration response = manager.partnerRegistrations() - .define("tncwmhjobzrfpr") - .withRegion("yftcvbzwgwhg") - .withExistingResourceGroup("pyfaofdfp") - .withTags(mapOf("uoorssatfybipufd", "o", "q", "xuqbdqnasttuxvz", "xmndztgsqjayqmar", "yopbtsixhgvb", "nh", - "neibpgbrhbjdq")) - .withPartnerRegistrationImmutableId(UUID.fromString("97bd28ba-280b-4340-9c20-863095acb4c5")) - .create(); - - Assertions.assertEquals("ttpfsmwgsgh", response.location()); - Assertions.assertEquals("umlddauqmllfe", response.tags().get("thxuarigrjdl")); - Assertions.assertEquals(UUID.fromString("0adbab65-218c-421b-9644-8d284a77c803"), - response.partnerRegistrationImmutableId()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationsDeleteMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationsDeleteMockTests.java deleted file mode 100644 index 0c0e60256801..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PartnerRegistrationsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.partnerRegistrations().delete("zoofj", "qjsvep", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationsGetByResourceGroupWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 2a015f24d8aa..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.PartnerRegistration; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PartnerRegistrationsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Updating\",\"partnerRegistrationImmutableId\":\"a0589025-9668-4905-9275-dd44dde492cc\"},\"location\":\"hnysvlpyeu\",\"tags\":{\"hyqqegatxgr\":\"pdixqbolxv\"},\"id\":\"nmginmt\",\"name\":\"dixchwkib\",\"type\":\"gjymncjcagairwc\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PartnerRegistration response = manager.partnerRegistrations() - .getByResourceGroupWithResponse("bhlenntrvrkpsab", "u", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("hnysvlpyeu", response.location()); - Assertions.assertEquals("pdixqbolxv", response.tags().get("hyqqegatxgr")); - Assertions.assertEquals(UUID.fromString("a0589025-9668-4905-9275-dd44dde492cc"), - response.partnerRegistrationImmutableId()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationsListByResourceGroupMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationsListByResourceGroupMockTests.java deleted file mode 100644 index e0803b808aad..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationsListByResourceGroupMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.PartnerRegistration; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PartnerRegistrationsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"partnerRegistrationImmutableId\":\"c76451d3-a741-408b-8ea7-5ec4f0c66e81\"},\"location\":\"mxkbcjwwdxomra\",\"tags\":{\"fly\":\"keboo\",\"mgd\":\"cagaedaoiqc\",\"dxfkuzb\":\"wga\"},\"id\":\"jecooyvhtu\",\"name\":\"bpelniibncgagd\",\"type\":\"cdqhftz\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.partnerRegistrations() - .listByResourceGroup("pyrgu", "fazbkoc", 1213521586, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("mxkbcjwwdxomra", response.iterator().next().location()); - Assertions.assertEquals("keboo", response.iterator().next().tags().get("fly")); - Assertions.assertEquals(UUID.fromString("c76451d3-a741-408b-8ea7-5ec4f0c66e81"), - response.iterator().next().partnerRegistrationImmutableId()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationsListMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationsListMockTests.java deleted file mode 100644 index 22a66a1e82e5..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationsListMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.PartnerRegistration; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PartnerRegistrationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"partnerRegistrationImmutableId\":\"a991ae7c-a89b-4ee8-bea3-229bb39e9b92\"},\"location\":\"n\",\"tags\":{\"rxgkr\":\"qxowkdn\"},\"id\":\"wiehycpn\",\"name\":\"wawonoehrguql\",\"type\":\"fwafbjz\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response - = manager.partnerRegistrations().list("bhtleberpy", 2021743330, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("n", response.iterator().next().location()); - Assertions.assertEquals("qxowkdn", response.iterator().next().tags().get("rxgkr")); - Assertions.assertEquals(UUID.fromString("a991ae7c-a89b-4ee8-bea3-229bb39e9b92"), - response.iterator().next().partnerRegistrationImmutableId()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationsListResultTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationsListResultTests.java deleted file mode 100644 index 30f4dd28d529..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerRegistrationsListResultTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.PartnerRegistrationInner; -import com.azure.resourcemanager.eventgrid.models.PartnerRegistrationsListResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; - -public final class PartnerRegistrationsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartnerRegistrationsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"partnerRegistrationImmutableId\":\"eca7f1fb-20c6-406c-9988-bc94da5a64cb\"},\"location\":\"fgtayxonsup\",\"tags\":{\"ltnzoibgsxg\":\"lzqnhcvs\",\"dbxiqx\":\"xfyqonmpqoxwdo\"},\"id\":\"iiqbi\",\"name\":\"htmwwinh\",\"type\":\"hfqpofv\"}],\"nextLink\":\"cblembnkbwv\"}") - .toObject(PartnerRegistrationsListResult.class); - Assertions.assertEquals("fgtayxonsup", model.value().get(0).location()); - Assertions.assertEquals("lzqnhcvs", model.value().get(0).tags().get("ltnzoibgsxg")); - Assertions.assertEquals(UUID.fromString("eca7f1fb-20c6-406c-9988-bc94da5a64cb"), - model.value().get(0).partnerRegistrationImmutableId()); - Assertions.assertEquals("cblembnkbwv", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartnerRegistrationsListResult model = new PartnerRegistrationsListResult() - .withValue(Arrays.asList(new PartnerRegistrationInner().withLocation("fgtayxonsup") - .withTags(mapOf("ltnzoibgsxg", "lzqnhcvs", "dbxiqx", "xfyqonmpqoxwdo")) - .withPartnerRegistrationImmutableId(UUID.fromString("eca7f1fb-20c6-406c-9988-bc94da5a64cb")))) - .withNextLink("cblembnkbwv"); - model = BinaryData.fromObject(model).toObject(PartnerRegistrationsListResult.class); - Assertions.assertEquals("fgtayxonsup", model.value().get(0).location()); - Assertions.assertEquals("lzqnhcvs", model.value().get(0).tags().get("ltnzoibgsxg")); - Assertions.assertEquals(UUID.fromString("eca7f1fb-20c6-406c-9988-bc94da5a64cb"), - model.value().get(0).partnerRegistrationImmutableId()); - Assertions.assertEquals("cblembnkbwv", model.nextLink()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicEventSubscriptionsDeleteMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicEventSubscriptionsDeleteMockTests.java deleted file mode 100644 index fae0bedcd660..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicEventSubscriptionsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PartnerTopicEventSubscriptionsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.partnerTopicEventSubscriptions().delete("v", "jkqxetqmmli", "rj", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicEventSubscriptionsGetDeliveryAttributesWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicEventSubscriptionsGetDeliveryAttributesWithResponseMockTests.java deleted file mode 100644 index 6e50cef032a8..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicEventSubscriptionsGetDeliveryAttributesWithResponseMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeListResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PartnerTopicEventSubscriptionsGetDeliveryAttributesWithResponseMockTests { - @Test - public void testGetDeliveryAttributesWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"type\":\"DeliveryAttributeMapping\",\"name\":\"gftcvbiiftksdwg\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"kefgmwdhce\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - DeliveryAttributeListResult response = manager.partnerTopicEventSubscriptions() - .getDeliveryAttributesWithResponse("owcpjqduqgixexky", "fbwljavhuerkjdd", "r", - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("gftcvbiiftksdwg", response.value().get(0).name()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicEventSubscriptionsGetFullUrlWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicEventSubscriptionsGetFullUrlWithResponseMockTests.java deleted file mode 100644 index 192a5ab07420..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicEventSubscriptionsGetFullUrlWithResponseMockTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFullUrl; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PartnerTopicEventSubscriptionsGetFullUrlWithResponseMockTests { - @Test - public void testGetFullUrlWithResponse() throws Exception { - String responseStr = "{\"endpointUrl\":\"w\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - EventSubscriptionFullUrl response = manager.partnerTopicEventSubscriptions() - .getFullUrlWithResponse("xnwxdch", "ojxl", "hzlxpgfquw", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("w", response.endpointUrl()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicInfoTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicInfoTests.java deleted file mode 100644 index 79a7d67354a2..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicInfoTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import com.azure.resourcemanager.eventgrid.models.PartnerTopicInfo; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PartnerTopicInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartnerTopicInfo model = BinaryData.fromString( - "{\"azureSubscriptionId\":\"kknryrtihf\",\"resourceGroupName\":\"ijbpzvgnwzsymgl\",\"name\":\"fcyzkohdbihanufh\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"tfwvukxgaudc\":{\"description\":\"git\",\"displayName\":\"qhabifpikxwcz\",\"documentationUrl\":\"scnpqxuhivy\",\"dataSchemaUrl\":\"iwbybrkxvdumjg\"}}},\"source\":\"nhsjcnyej\"}") - .toObject(PartnerTopicInfo.class); - Assertions.assertEquals("kknryrtihf", model.azureSubscriptionId()); - Assertions.assertEquals("ijbpzvgnwzsymgl", model.resourceGroupName()); - Assertions.assertEquals("fcyzkohdbihanufh", model.name()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("git", model.eventTypeInfo().inlineEventTypes().get("tfwvukxgaudc").description()); - Assertions.assertEquals("qhabifpikxwcz", - model.eventTypeInfo().inlineEventTypes().get("tfwvukxgaudc").displayName()); - Assertions.assertEquals("scnpqxuhivy", - model.eventTypeInfo().inlineEventTypes().get("tfwvukxgaudc").documentationUrl()); - Assertions.assertEquals("iwbybrkxvdumjg", - model.eventTypeInfo().inlineEventTypes().get("tfwvukxgaudc").dataSchemaUrl()); - Assertions.assertEquals("nhsjcnyej", model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartnerTopicInfo model = new PartnerTopicInfo().withAzureSubscriptionId("kknryrtihf") - .withResourceGroupName("ijbpzvgnwzsymgl") - .withName("fcyzkohdbihanufh") - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("tfwvukxgaudc", - new InlineEventProperties().withDescription("git") - .withDisplayName("qhabifpikxwcz") - .withDocumentationUrl("scnpqxuhivy") - .withDataSchemaUrl("iwbybrkxvdumjg")))) - .withSource("nhsjcnyej"); - model = BinaryData.fromObject(model).toObject(PartnerTopicInfo.class); - Assertions.assertEquals("kknryrtihf", model.azureSubscriptionId()); - Assertions.assertEquals("ijbpzvgnwzsymgl", model.resourceGroupName()); - Assertions.assertEquals("fcyzkohdbihanufh", model.name()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("git", model.eventTypeInfo().inlineEventTypes().get("tfwvukxgaudc").description()); - Assertions.assertEquals("qhabifpikxwcz", - model.eventTypeInfo().inlineEventTypes().get("tfwvukxgaudc").displayName()); - Assertions.assertEquals("scnpqxuhivy", - model.eventTypeInfo().inlineEventTypes().get("tfwvukxgaudc").documentationUrl()); - Assertions.assertEquals("iwbybrkxvdumjg", - model.eventTypeInfo().inlineEventTypes().get("tfwvukxgaudc").dataSchemaUrl()); - Assertions.assertEquals("nhsjcnyej", model.source()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicInnerTests.java deleted file mode 100644 index 1911a08257d6..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicInnerTests.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.PartnerTopicInner; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import com.azure.resourcemanager.eventgrid.models.PartnerTopicActivationState; -import com.azure.resourcemanager.eventgrid.models.UserIdentityProperties; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; - -public final class PartnerTopicInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartnerTopicInner model = BinaryData.fromString( - "{\"properties\":{\"partnerRegistrationImmutableId\":\"bdb88235-6e10-4e71-9f26-69f378529554\",\"source\":\"divqi\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"acy\":{\"description\":\"bzuwfmdurag\",\"displayName\":\"izvcjfe\",\"documentationUrl\":\"sdjubggbqigkxkbs\",\"dataSchemaUrl\":\"gak\"},\"tkvnlvxbcuiiznkt\":{\"description\":\"m\",\"displayName\":\"mspofapvuhryl\",\"documentationUrl\":\"ofrzgb\",\"dataSchemaUrl\":\"edm\"},\"crpfbcunez\":{\"description\":\"ansnvp\",\"displayName\":\"bmikost\",\"documentationUrl\":\"bkiw\",\"dataSchemaUrl\":\"qnyophzfyls\"},\"sqqw\":{\"description\":\"e\",\"displayName\":\"lfwyfwlwxjwetn\",\"documentationUrl\":\"ihclafzv\",\"dataSchemaUrl\":\"lpt\"}}},\"expirationTimeIfNotActivatedUtc\":\"2021-10-08T01:02:03Z\",\"provisioningState\":\"Creating\",\"activationState\":\"Activated\",\"partnerTopicFriendlyDescription\":\"hcxwaxfewzjk\",\"messageForActivation\":\"xfdeqvhpsyl\"},\"identity\":{\"type\":\"SystemAssigned\",\"principalId\":\"ffmbmxzjrg\",\"tenantId\":\"wpgj\",\"userAssignedIdentities\":{\"tdewemxswvruu\":{\"principalId\":\"tf\",\"clientId\":\"gicgaaoepttaq\"},\"jqepqwhi\":{\"principalId\":\"zjgehkfkim\",\"clientId\":\"ixokffqyin\"}}},\"location\":\"monstshiyxgve\",\"tags\":{\"ds\":\"lduccbi\",\"b\":\"uwc\"},\"id\":\"egstmninwjizci\",\"name\":\"nghgshej\",\"type\":\"tbxqmuluxlxq\"}") - .toObject(PartnerTopicInner.class); - Assertions.assertEquals("monstshiyxgve", model.location()); - Assertions.assertEquals("lduccbi", model.tags().get("ds")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("ffmbmxzjrg", model.identity().principalId()); - Assertions.assertEquals("wpgj", model.identity().tenantId()); - Assertions.assertEquals("tf", model.identity().userAssignedIdentities().get("tdewemxswvruu").principalId()); - Assertions.assertEquals("gicgaaoepttaq", - model.identity().userAssignedIdentities().get("tdewemxswvruu").clientId()); - Assertions.assertEquals(UUID.fromString("bdb88235-6e10-4e71-9f26-69f378529554"), - model.partnerRegistrationImmutableId()); - Assertions.assertEquals("divqi", model.source()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("bzuwfmdurag", model.eventTypeInfo().inlineEventTypes().get("acy").description()); - Assertions.assertEquals("izvcjfe", model.eventTypeInfo().inlineEventTypes().get("acy").displayName()); - Assertions.assertEquals("sdjubggbqigkxkbs", - model.eventTypeInfo().inlineEventTypes().get("acy").documentationUrl()); - Assertions.assertEquals("gak", model.eventTypeInfo().inlineEventTypes().get("acy").dataSchemaUrl()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-08T01:02:03Z"), model.expirationTimeIfNotActivatedUtc()); - Assertions.assertEquals(PartnerTopicActivationState.ACTIVATED, model.activationState()); - Assertions.assertEquals("hcxwaxfewzjk", model.partnerTopicFriendlyDescription()); - Assertions.assertEquals("xfdeqvhpsyl", model.messageForActivation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartnerTopicInner model = new PartnerTopicInner().withLocation("monstshiyxgve") - .withTags(mapOf("ds", "lduccbi", "b", "uwc")) - .withIdentity(new IdentityInfo().withType(IdentityType.SYSTEM_ASSIGNED) - .withPrincipalId("ffmbmxzjrg") - .withTenantId("wpgj") - .withUserAssignedIdentities(mapOf("tdewemxswvruu", - new UserIdentityProperties().withPrincipalId("tf").withClientId("gicgaaoepttaq"), "jqepqwhi", - new UserIdentityProperties().withPrincipalId("zjgehkfkim").withClientId("ixokffqyin")))) - .withPartnerRegistrationImmutableId(UUID.fromString("bdb88235-6e10-4e71-9f26-69f378529554")) - .withSource("divqi") - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("acy", - new InlineEventProperties().withDescription("bzuwfmdurag") - .withDisplayName("izvcjfe") - .withDocumentationUrl("sdjubggbqigkxkbs") - .withDataSchemaUrl("gak"), - "tkvnlvxbcuiiznkt", - new InlineEventProperties().withDescription("m") - .withDisplayName("mspofapvuhryl") - .withDocumentationUrl("ofrzgb") - .withDataSchemaUrl("edm"), - "crpfbcunez", - new InlineEventProperties().withDescription("ansnvp") - .withDisplayName("bmikost") - .withDocumentationUrl("bkiw") - .withDataSchemaUrl("qnyophzfyls"), - "sqqw", - new InlineEventProperties().withDescription("e") - .withDisplayName("lfwyfwlwxjwetn") - .withDocumentationUrl("ihclafzv") - .withDataSchemaUrl("lpt")))) - .withExpirationTimeIfNotActivatedUtc(OffsetDateTime.parse("2021-10-08T01:02:03Z")) - .withActivationState(PartnerTopicActivationState.ACTIVATED) - .withPartnerTopicFriendlyDescription("hcxwaxfewzjk") - .withMessageForActivation("xfdeqvhpsyl"); - model = BinaryData.fromObject(model).toObject(PartnerTopicInner.class); - Assertions.assertEquals("monstshiyxgve", model.location()); - Assertions.assertEquals("lduccbi", model.tags().get("ds")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("ffmbmxzjrg", model.identity().principalId()); - Assertions.assertEquals("wpgj", model.identity().tenantId()); - Assertions.assertEquals("tf", model.identity().userAssignedIdentities().get("tdewemxswvruu").principalId()); - Assertions.assertEquals("gicgaaoepttaq", - model.identity().userAssignedIdentities().get("tdewemxswvruu").clientId()); - Assertions.assertEquals(UUID.fromString("bdb88235-6e10-4e71-9f26-69f378529554"), - model.partnerRegistrationImmutableId()); - Assertions.assertEquals("divqi", model.source()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("bzuwfmdurag", model.eventTypeInfo().inlineEventTypes().get("acy").description()); - Assertions.assertEquals("izvcjfe", model.eventTypeInfo().inlineEventTypes().get("acy").displayName()); - Assertions.assertEquals("sdjubggbqigkxkbs", - model.eventTypeInfo().inlineEventTypes().get("acy").documentationUrl()); - Assertions.assertEquals("gak", model.eventTypeInfo().inlineEventTypes().get("acy").dataSchemaUrl()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-08T01:02:03Z"), model.expirationTimeIfNotActivatedUtc()); - Assertions.assertEquals(PartnerTopicActivationState.ACTIVATED, model.activationState()); - Assertions.assertEquals("hcxwaxfewzjk", model.partnerTopicFriendlyDescription()); - Assertions.assertEquals("xfdeqvhpsyl", model.messageForActivation()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicPropertiesTests.java deleted file mode 100644 index 60dc4c0c5924..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicPropertiesTests.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.PartnerTopicProperties; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import com.azure.resourcemanager.eventgrid.models.PartnerTopicActivationState; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; - -public final class PartnerTopicPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartnerTopicProperties model = BinaryData.fromString( - "{\"partnerRegistrationImmutableId\":\"762d7716-96dc-4d58-9ce6-9cf8039814ec\",\"source\":\"ers\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"ycjsx\":{\"description\":\"namikzebrqbsms\",\"displayName\":\"iqg\",\"documentationUrl\":\"hokzrusw\",\"dataSchemaUrl\":\"hczznvf\"},\"xpelnjetagltsx\":{\"description\":\"wix\",\"displayName\":\"umwmxqhnd\",\"documentationUrl\":\"oamld\",\"dataSchemaUrl\":\"haohdjhhflzokxc\"},\"ky\":{\"description\":\"tft\",\"displayName\":\"pnpbswveflocc\",\"documentationUrl\":\"mozi\",\"dataSchemaUrl\":\"ipgawtxx\"}}},\"expirationTimeIfNotActivatedUtc\":\"2021-05-09T23:26:24Z\",\"provisioningState\":\"Updating\",\"activationState\":\"NeverActivated\",\"partnerTopicFriendlyDescription\":\"ytfmpc\",\"messageForActivation\":\"ilrmcaykggnox\"}") - .toObject(PartnerTopicProperties.class); - Assertions.assertEquals(UUID.fromString("762d7716-96dc-4d58-9ce6-9cf8039814ec"), - model.partnerRegistrationImmutableId()); - Assertions.assertEquals("ers", model.source()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("namikzebrqbsms", model.eventTypeInfo().inlineEventTypes().get("ycjsx").description()); - Assertions.assertEquals("iqg", model.eventTypeInfo().inlineEventTypes().get("ycjsx").displayName()); - Assertions.assertEquals("hokzrusw", model.eventTypeInfo().inlineEventTypes().get("ycjsx").documentationUrl()); - Assertions.assertEquals("hczznvf", model.eventTypeInfo().inlineEventTypes().get("ycjsx").dataSchemaUrl()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-09T23:26:24Z"), model.expirationTimeIfNotActivatedUtc()); - Assertions.assertEquals(PartnerTopicActivationState.NEVER_ACTIVATED, model.activationState()); - Assertions.assertEquals("ytfmpc", model.partnerTopicFriendlyDescription()); - Assertions.assertEquals("ilrmcaykggnox", model.messageForActivation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartnerTopicProperties model = new PartnerTopicProperties() - .withPartnerRegistrationImmutableId(UUID.fromString("762d7716-96dc-4d58-9ce6-9cf8039814ec")) - .withSource("ers") - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("ycjsx", - new InlineEventProperties().withDescription("namikzebrqbsms") - .withDisplayName("iqg") - .withDocumentationUrl("hokzrusw") - .withDataSchemaUrl("hczznvf"), - "xpelnjetagltsx", - new InlineEventProperties().withDescription("wix") - .withDisplayName("umwmxqhnd") - .withDocumentationUrl("oamld") - .withDataSchemaUrl("haohdjhhflzokxc"), - "ky", - new InlineEventProperties().withDescription("tft") - .withDisplayName("pnpbswveflocc") - .withDocumentationUrl("mozi") - .withDataSchemaUrl("ipgawtxx")))) - .withExpirationTimeIfNotActivatedUtc(OffsetDateTime.parse("2021-05-09T23:26:24Z")) - .withActivationState(PartnerTopicActivationState.NEVER_ACTIVATED) - .withPartnerTopicFriendlyDescription("ytfmpc") - .withMessageForActivation("ilrmcaykggnox"); - model = BinaryData.fromObject(model).toObject(PartnerTopicProperties.class); - Assertions.assertEquals(UUID.fromString("762d7716-96dc-4d58-9ce6-9cf8039814ec"), - model.partnerRegistrationImmutableId()); - Assertions.assertEquals("ers", model.source()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("namikzebrqbsms", model.eventTypeInfo().inlineEventTypes().get("ycjsx").description()); - Assertions.assertEquals("iqg", model.eventTypeInfo().inlineEventTypes().get("ycjsx").displayName()); - Assertions.assertEquals("hokzrusw", model.eventTypeInfo().inlineEventTypes().get("ycjsx").documentationUrl()); - Assertions.assertEquals("hczznvf", model.eventTypeInfo().inlineEventTypes().get("ycjsx").dataSchemaUrl()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-09T23:26:24Z"), model.expirationTimeIfNotActivatedUtc()); - Assertions.assertEquals(PartnerTopicActivationState.NEVER_ACTIVATED, model.activationState()); - Assertions.assertEquals("ytfmpc", model.partnerTopicFriendlyDescription()); - Assertions.assertEquals("ilrmcaykggnox", model.messageForActivation()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicUpdateParametersTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicUpdateParametersTests.java deleted file mode 100644 index 84aaca2ba969..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicUpdateParametersTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.IdentityInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.PartnerTopicUpdateParameters; -import com.azure.resourcemanager.eventgrid.models.UserIdentityProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PartnerTopicUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartnerTopicUpdateParameters model = BinaryData.fromString( - "{\"tags\":{\"fnznth\":\"rksxwpndfc\"},\"identity\":{\"type\":\"UserAssigned\",\"principalId\":\"aosrxuz\",\"tenantId\":\"amktcqiosmgbzah\",\"userAssignedIdentities\":{\"s\":{\"principalId\":\"lyrtltlaprlt\",\"clientId\":\"atbhjmznn\"},\"febwlnbmhyreeudz\":{\"principalId\":\"eq\",\"clientId\":\"arvlagunbt\"}}}}") - .toObject(PartnerTopicUpdateParameters.class); - Assertions.assertEquals("rksxwpndfc", model.tags().get("fnznth")); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("aosrxuz", model.identity().principalId()); - Assertions.assertEquals("amktcqiosmgbzah", model.identity().tenantId()); - Assertions.assertEquals("lyrtltlaprlt", model.identity().userAssignedIdentities().get("s").principalId()); - Assertions.assertEquals("atbhjmznn", model.identity().userAssignedIdentities().get("s").clientId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartnerTopicUpdateParameters model - = new PartnerTopicUpdateParameters().withTags(mapOf("fnznth", "rksxwpndfc")) - .withIdentity(new IdentityInfo().withType(IdentityType.USER_ASSIGNED) - .withPrincipalId("aosrxuz") - .withTenantId("amktcqiosmgbzah") - .withUserAssignedIdentities(mapOf("s", - new UserIdentityProperties().withPrincipalId("lyrtltlaprlt").withClientId("atbhjmznn"), - "febwlnbmhyreeudz", - new UserIdentityProperties().withPrincipalId("eq").withClientId("arvlagunbt")))); - model = BinaryData.fromObject(model).toObject(PartnerTopicUpdateParameters.class); - Assertions.assertEquals("rksxwpndfc", model.tags().get("fnznth")); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("aosrxuz", model.identity().principalId()); - Assertions.assertEquals("amktcqiosmgbzah", model.identity().tenantId()); - Assertions.assertEquals("lyrtltlaprlt", model.identity().userAssignedIdentities().get("s").principalId()); - Assertions.assertEquals("atbhjmznn", model.identity().userAssignedIdentities().get("s").clientId()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsActivateWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsActivateWithResponseMockTests.java deleted file mode 100644 index bfb8f85796c8..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsActivateWithResponseMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.PartnerTopic; -import com.azure.resourcemanager.eventgrid.models.PartnerTopicActivationState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PartnerTopicsActivateWithResponseMockTests { - @Test - public void testActivateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"partnerRegistrationImmutableId\":\"51a9cec9-2a0c-4c4f-b402-9132151a8c5b\",\"source\":\"lmwkptskwxjg\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"fejlzuqloiw\":{\"description\":\"kakmkookbputmgvm\",\"displayName\":\"akmlwktfowzkroyr\",\"documentationUrl\":\"r\",\"dataSchemaUrl\":\"lzqjimejtgzjxx\"}}},\"expirationTimeIfNotActivatedUtc\":\"2021-09-03T04:59:18Z\",\"provisioningState\":\"Failed\",\"activationState\":\"Activated\",\"partnerTopicFriendlyDescription\":\"mit\",\"messageForActivation\":\"qlhchwhrktjle\"},\"identity\":{\"type\":\"SystemAssigned\",\"principalId\":\"plhxfnsm\",\"tenantId\":\"jow\",\"userAssignedIdentities\":{\"zbuw\":{\"principalId\":\"zmudsqcm\",\"clientId\":\"x\"},\"mkzdllczdprwnhk\":{\"principalId\":\"machbkv\",\"clientId\":\"pbjrmvgoqplehm\"},\"wmhlymgnukx\":{\"principalId\":\"ggoxsstcivrakfrr\",\"clientId\":\"j\"},\"tfbclakkuc\":{\"principalId\":\"emjpequ\",\"clientId\":\"lzaudg\"}}},\"location\":\"dwnhczbutoucgjti\",\"tags\":{\"qwwvgwkslvl\":\"ayhic\"},\"id\":\"zedv\",\"name\":\"iabvnsrgek\",\"type\":\"yqxadyfhbmw\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PartnerTopic response = manager.partnerTopics() - .activateWithResponse("wj", "qtrotpvclp", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("dwnhczbutoucgjti", response.location()); - Assertions.assertEquals("ayhic", response.tags().get("qwwvgwkslvl")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, response.identity().type()); - Assertions.assertEquals("plhxfnsm", response.identity().principalId()); - Assertions.assertEquals("jow", response.identity().tenantId()); - Assertions.assertEquals("zmudsqcm", response.identity().userAssignedIdentities().get("zbuw").principalId()); - Assertions.assertEquals("x", response.identity().userAssignedIdentities().get("zbuw").clientId()); - Assertions.assertEquals(UUID.fromString("51a9cec9-2a0c-4c4f-b402-9132151a8c5b"), - response.partnerRegistrationImmutableId()); - Assertions.assertEquals("lmwkptskwxjg", response.source()); - Assertions.assertEquals(EventDefinitionKind.INLINE, response.eventTypeInfo().kind()); - Assertions.assertEquals("kakmkookbputmgvm", - response.eventTypeInfo().inlineEventTypes().get("fejlzuqloiw").description()); - Assertions.assertEquals("akmlwktfowzkroyr", - response.eventTypeInfo().inlineEventTypes().get("fejlzuqloiw").displayName()); - Assertions.assertEquals("r", response.eventTypeInfo().inlineEventTypes().get("fejlzuqloiw").documentationUrl()); - Assertions.assertEquals("lzqjimejtgzjxx", - response.eventTypeInfo().inlineEventTypes().get("fejlzuqloiw").dataSchemaUrl()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-03T04:59:18Z"), - response.expirationTimeIfNotActivatedUtc()); - Assertions.assertEquals(PartnerTopicActivationState.ACTIVATED, response.activationState()); - Assertions.assertEquals("mit", response.partnerTopicFriendlyDescription()); - Assertions.assertEquals("qlhchwhrktjle", response.messageForActivation()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsCreateOrUpdateWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 34f86c0596d7..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import com.azure.resourcemanager.eventgrid.models.PartnerTopic; -import com.azure.resourcemanager.eventgrid.models.PartnerTopicActivationState; -import com.azure.resourcemanager.eventgrid.models.UserIdentityProperties; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PartnerTopicsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"partnerRegistrationImmutableId\":\"b4e7b9a6-ec84-4a3c-b3bb-9d0c8a99cdab\",\"source\":\"tungbsoljckmiigz\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"lqcwnynll\":{\"description\":\"dsk\",\"displayName\":\"tiiqqcqikclsmaln\",\"documentationUrl\":\"woykdnonaaxwm\",\"dataSchemaUrl\":\"ru\"},\"icvnpvvdh\":{\"description\":\"q\",\"displayName\":\"bgvsbtsertoxadh\",\"documentationUrl\":\"vjhxmnrqst\",\"dataSchemaUrl\":\"metwml\"},\"ybfzdqekivycp\":{\"description\":\"naqyqipslzmvcds\",\"displayName\":\"wbitekdtfob\",\"documentationUrl\":\"iy\",\"dataSchemaUrl\":\"qich\"}}},\"expirationTimeIfNotActivatedUtc\":\"2021-11-17T03:47:56Z\",\"provisioningState\":\"Creating\",\"activationState\":\"Deactivated\",\"partnerTopicFriendlyDescription\":\"rqtbhtrezpzl\",\"messageForActivation\":\"yfmx\"},\"identity\":{\"type\":\"None\",\"principalId\":\"kgilnoudccgnd\",\"tenantId\":\"dpriggqq\",\"userAssignedIdentities\":{\"ujcyohigimwdc\":{\"principalId\":\"cbuulpyufl\",\"clientId\":\"fsh\"},\"rzwimbzayspz\":{\"principalId\":\"lkq\",\"clientId\":\"vkixnmbzmecu\"}}},\"location\":\"rietvfp\",\"tags\":{\"gschnzrsbk\":\"zxplgtpvdvatlz\",\"ws\":\"zovlzdmnfm\"},\"id\":\"afofu\",\"name\":\"orimmo\",\"type\":\"zwdehkkmvhz\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PartnerTopic response = manager.partnerTopics() - .define("aix") - .withRegion("czcxdfw") - .withExistingResourceGroup("yfozkbnzxbypfqp") - .withTags(mapOf("lxrljphraspifl", "yf", "fgsmdrjuqb", "imixlmdbgice")) - .withIdentity(new IdentityInfo().withType(IdentityType.NONE) - .withPrincipalId("qmkw") - .withTenantId("vcwloqd") - .withUserAssignedIdentities(mapOf("tkwppthuzd", - new UserIdentityProperties().withPrincipalId("uxxrwzobuzms").withClientId("amt"), "loamfmxtllfltym", - new UserIdentityProperties().withPrincipalId("mimrljdpoqfxyemh").withClientId("tbaewhte"), "irw", - new UserIdentityProperties().withPrincipalId("nrrfijhggabqb").withClientId("mkli"), "ddtullygta", - new UserIdentityProperties().withPrincipalId("ffhsdpzouhk").withClientId("rxqwqnjxrd")))) - .withPartnerRegistrationImmutableId(UUID.fromString("0d4b180a-a06e-4e35-9314-4d6cfa217bdb")) - .withSource("kkderfrswq") - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("djxh", - new InlineEventProperties().withDescription("g") - .withDisplayName("icwn") - .withDocumentationUrl("tfmcqbsudzpgc") - .withDataSchemaUrl("pgfqum")))) - .withExpirationTimeIfNotActivatedUtc(OffsetDateTime.parse("2021-06-16T00:01:12Z")) - .withActivationState(PartnerTopicActivationState.ACTIVATED) - .withPartnerTopicFriendlyDescription("nrceqavfdbdfmmx") - .withMessageForActivation("naj") - .create(); - - Assertions.assertEquals("rietvfp", response.location()); - Assertions.assertEquals("zxplgtpvdvatlz", response.tags().get("gschnzrsbk")); - Assertions.assertEquals(IdentityType.NONE, response.identity().type()); - Assertions.assertEquals("kgilnoudccgnd", response.identity().principalId()); - Assertions.assertEquals("dpriggqq", response.identity().tenantId()); - Assertions.assertEquals("cbuulpyufl", - response.identity().userAssignedIdentities().get("ujcyohigimwdc").principalId()); - Assertions.assertEquals("fsh", response.identity().userAssignedIdentities().get("ujcyohigimwdc").clientId()); - Assertions.assertEquals(UUID.fromString("b4e7b9a6-ec84-4a3c-b3bb-9d0c8a99cdab"), - response.partnerRegistrationImmutableId()); - Assertions.assertEquals("tungbsoljckmiigz", response.source()); - Assertions.assertEquals(EventDefinitionKind.INLINE, response.eventTypeInfo().kind()); - Assertions.assertEquals("dsk", response.eventTypeInfo().inlineEventTypes().get("lqcwnynll").description()); - Assertions.assertEquals("tiiqqcqikclsmaln", - response.eventTypeInfo().inlineEventTypes().get("lqcwnynll").displayName()); - Assertions.assertEquals("woykdnonaaxwm", - response.eventTypeInfo().inlineEventTypes().get("lqcwnynll").documentationUrl()); - Assertions.assertEquals("ru", response.eventTypeInfo().inlineEventTypes().get("lqcwnynll").dataSchemaUrl()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-17T03:47:56Z"), - response.expirationTimeIfNotActivatedUtc()); - Assertions.assertEquals(PartnerTopicActivationState.DEACTIVATED, response.activationState()); - Assertions.assertEquals("rqtbhtrezpzl", response.partnerTopicFriendlyDescription()); - Assertions.assertEquals("yfmx", response.messageForActivation()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsDeactivateWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsDeactivateWithResponseMockTests.java deleted file mode 100644 index d5caea67cf26..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsDeactivateWithResponseMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.PartnerTopic; -import com.azure.resourcemanager.eventgrid.models.PartnerTopicActivationState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PartnerTopicsDeactivateWithResponseMockTests { - @Test - public void testDeactivateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"partnerRegistrationImmutableId\":\"cae7e7ab-17fa-4625-80b5-7008e02e30e9\",\"source\":\"nsfdrlduye\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"obdoey\":{\"description\":\"gyuqwrldaxurfqa\",\"displayName\":\"sozjvxdzciggbnv\",\"documentationUrl\":\"o\",\"dataSchemaUrl\":\"alzyxwhoeamo\"},\"ueoqusvwluj\":{\"description\":\"pnimtwuuh\",\"displayName\":\"egnkwmnfeubtzjy\",\"documentationUrl\":\"wfugiph\",\"dataSchemaUrl\":\"kuumnqdurhzzfo\"},\"elfnzzryiz\":{\"description\":\"wnibittoz\",\"displayName\":\"dqumqvfm\",\"documentationUrl\":\"ad\",\"dataSchemaUrl\":\"gctxegtvgwyur\"}}},\"expirationTimeIfNotActivatedUtc\":\"2021-04-27T14:17:35Z\",\"provisioningState\":\"Deleting\",\"activationState\":\"Deactivated\",\"partnerTopicFriendlyDescription\":\"layunomirhpfabe\",\"messageForActivation\":\"lamwmgewa\"},\"identity\":{\"type\":\"SystemAssigned, UserAssigned\",\"principalId\":\"cpjs\",\"tenantId\":\"hemhcucsqsnxfbx\",\"userAssignedIdentities\":{\"pod\":{\"principalId\":\"pdr\",\"clientId\":\"yvbsuadu\"},\"qrojadhfztlray\":{\"principalId\":\"x\",\"clientId\":\"obkzhmhjdqltdel\"},\"dbkuwpzqxlcwe\":{\"principalId\":\"kg\",\"clientId\":\"yh\"}}},\"location\":\"kfecjvxf\",\"tags\":{\"jvppwooajeyy\":\"fqi\",\"zls\":\"mjjxizxpxh\",\"egh\":\"ekcttgzkjtyqpdwa\"},\"id\":\"tldsvczdjiahuq\",\"name\":\"mjzucwwme\",\"type\":\"jqhddwvmqxiyoo\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PartnerTopic response = manager.partnerTopics() - .deactivateWithResponse("hojqttbspvkhg", "aqjsgyzstujr", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("kfecjvxf", response.location()); - Assertions.assertEquals("fqi", response.tags().get("jvppwooajeyy")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("cpjs", response.identity().principalId()); - Assertions.assertEquals("hemhcucsqsnxfbx", response.identity().tenantId()); - Assertions.assertEquals("pdr", response.identity().userAssignedIdentities().get("pod").principalId()); - Assertions.assertEquals("yvbsuadu", response.identity().userAssignedIdentities().get("pod").clientId()); - Assertions.assertEquals(UUID.fromString("cae7e7ab-17fa-4625-80b5-7008e02e30e9"), - response.partnerRegistrationImmutableId()); - Assertions.assertEquals("nsfdrlduye", response.source()); - Assertions.assertEquals(EventDefinitionKind.INLINE, response.eventTypeInfo().kind()); - Assertions.assertEquals("gyuqwrldaxurfqa", - response.eventTypeInfo().inlineEventTypes().get("obdoey").description()); - Assertions.assertEquals("sozjvxdzciggbnv", - response.eventTypeInfo().inlineEventTypes().get("obdoey").displayName()); - Assertions.assertEquals("o", response.eventTypeInfo().inlineEventTypes().get("obdoey").documentationUrl()); - Assertions.assertEquals("alzyxwhoeamo", - response.eventTypeInfo().inlineEventTypes().get("obdoey").dataSchemaUrl()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-27T14:17:35Z"), - response.expirationTimeIfNotActivatedUtc()); - Assertions.assertEquals(PartnerTopicActivationState.DEACTIVATED, response.activationState()); - Assertions.assertEquals("layunomirhpfabe", response.partnerTopicFriendlyDescription()); - Assertions.assertEquals("lamwmgewa", response.messageForActivation()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsDeleteMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsDeleteMockTests.java deleted file mode 100644 index 39ff35442561..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PartnerTopicsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.partnerTopics().delete("vqojbxaotcgbz", "mbtple", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsGetByResourceGroupWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 05c86a31b585..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.PartnerTopic; -import com.azure.resourcemanager.eventgrid.models.PartnerTopicActivationState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PartnerTopicsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"partnerRegistrationImmutableId\":\"1247d6f1-18d9-467a-bad6-69907e3598bc\",\"source\":\"kwrt\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"qlcoqksyiibhyx\":{\"description\":\"szrtlhpdhwynct\",\"displayName\":\"zcnjfmbbfnvjxit\",\"documentationUrl\":\"vnk\",\"dataSchemaUrl\":\"iklsmni\"},\"agzlgpyai\":{\"description\":\"gbudav\",\"displayName\":\"orbccqcdhth\",\"documentationUrl\":\"vlirknuc\",\"dataSchemaUrl\":\"awrdt\"},\"ermhzicsbfdjhyaa\":{\"description\":\"hzqjjtsmuydqfttk\",\"displayName\":\"ybd\",\"documentationUrl\":\"urgmcdcp\",\"dataSchemaUrl\":\"hlo\"}}},\"expirationTimeIfNotActivatedUtc\":\"2021-12-08T00:07:25Z\",\"provisioningState\":\"Creating\",\"activationState\":\"Activated\",\"partnerTopicFriendlyDescription\":\"iglh\",\"messageForActivation\":\"zwxqtejpii\"},\"identity\":{\"type\":\"None\",\"principalId\":\"yagjjnxkbylhyyxg\",\"tenantId\":\"klvqzrwtrdgscn\",\"userAssignedIdentities\":{\"kvtwfvesobpbo\":{\"principalId\":\"nsgnwxlwmez\",\"clientId\":\"hxpthceop\"},\"blqhxkasm\":{\"principalId\":\"mmlcdyarng\",\"clientId\":\"jf\"}}},\"location\":\"olmugpyvao\",\"tags\":{\"wzxeygzvtyevjhu\":\"l\",\"y\":\"nobguqisqsqkpdmi\"},\"id\":\"pnml\",\"name\":\"iqcpszpmcvq\",\"type\":\"vrdmvxyrxdh\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PartnerTopic response = manager.partnerTopics() - .getByResourceGroupWithResponse("ksgfyyskyekg", "fxcz", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("olmugpyvao", response.location()); - Assertions.assertEquals("l", response.tags().get("wzxeygzvtyevjhu")); - Assertions.assertEquals(IdentityType.NONE, response.identity().type()); - Assertions.assertEquals("yagjjnxkbylhyyxg", response.identity().principalId()); - Assertions.assertEquals("klvqzrwtrdgscn", response.identity().tenantId()); - Assertions.assertEquals("nsgnwxlwmez", - response.identity().userAssignedIdentities().get("kvtwfvesobpbo").principalId()); - Assertions.assertEquals("hxpthceop", - response.identity().userAssignedIdentities().get("kvtwfvesobpbo").clientId()); - Assertions.assertEquals(UUID.fromString("1247d6f1-18d9-467a-bad6-69907e3598bc"), - response.partnerRegistrationImmutableId()); - Assertions.assertEquals("kwrt", response.source()); - Assertions.assertEquals(EventDefinitionKind.INLINE, response.eventTypeInfo().kind()); - Assertions.assertEquals("szrtlhpdhwynct", - response.eventTypeInfo().inlineEventTypes().get("qlcoqksyiibhyx").description()); - Assertions.assertEquals("zcnjfmbbfnvjxit", - response.eventTypeInfo().inlineEventTypes().get("qlcoqksyiibhyx").displayName()); - Assertions.assertEquals("vnk", - response.eventTypeInfo().inlineEventTypes().get("qlcoqksyiibhyx").documentationUrl()); - Assertions.assertEquals("iklsmni", - response.eventTypeInfo().inlineEventTypes().get("qlcoqksyiibhyx").dataSchemaUrl()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-08T00:07:25Z"), - response.expirationTimeIfNotActivatedUtc()); - Assertions.assertEquals(PartnerTopicActivationState.ACTIVATED, response.activationState()); - Assertions.assertEquals("iglh", response.partnerTopicFriendlyDescription()); - Assertions.assertEquals("zwxqtejpii", response.messageForActivation()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsListByResourceGroupMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsListByResourceGroupMockTests.java deleted file mode 100644 index 9b57f81cf230..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsListByResourceGroupMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.PartnerTopic; -import com.azure.resourcemanager.eventgrid.models.PartnerTopicActivationState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PartnerTopicsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"partnerRegistrationImmutableId\":\"a2acd50d-8952-4bed-b9ae-a22c3a031691\",\"source\":\"k\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"hkxfpwhdyslbklgl\":{\"description\":\"krknf\",\"displayName\":\"ugjqyckgtxkrdt\",\"documentationUrl\":\"crcjdklotcsubmz\",\"dataSchemaUrl\":\"nsvob\"},\"ylztp\":{\"description\":\"nkkw\",\"displayName\":\"qshwyqxridt\",\"documentationUrl\":\"saqjmkgx\",\"dataSchemaUrl\":\"queu\"}}},\"expirationTimeIfNotActivatedUtc\":\"2021-11-05T00:30:38Z\",\"provisioningState\":\"Creating\",\"activationState\":\"NeverActivated\",\"partnerTopicFriendlyDescription\":\"k\",\"messageForActivation\":\"vezefkhkqtwqle\"},\"identity\":{\"type\":\"None\",\"principalId\":\"as\",\"tenantId\":\"zcntogffjwajnrtw\",\"userAssignedIdentities\":{\"nhemvwfnqqw\":{\"principalId\":\"kifmxawo\",\"clientId\":\"fzknhrkmjqncfvds\"},\"muymvec\":{\"principalId\":\"vndrwbgodtg\",\"clientId\":\"ssgwjfkain\"},\"nrddclzeqoz\":{\"principalId\":\"tscbgmusai\",\"clientId\":\"dscnkzzo\"},\"pam\":{\"principalId\":\"hlbzqixbnjrqvzy\",\"clientId\":\"xozony\"}}},\"location\":\"udpabcreuwzos\",\"tags\":{\"dubewgzy\":\"xvcvasormrexz\",\"zrtdbakr\":\"baduvecovsdq\"},\"id\":\"imzfvpp\",\"name\":\"eqsifjmclngygnhr\",\"type\":\"ombcdtajdopggo\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.partnerTopics() - .listByResourceGroup("eocfkumcfjxok", "elsy", 1811444232, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("udpabcreuwzos", response.iterator().next().location()); - Assertions.assertEquals("xvcvasormrexz", response.iterator().next().tags().get("dubewgzy")); - Assertions.assertEquals(IdentityType.NONE, response.iterator().next().identity().type()); - Assertions.assertEquals("as", response.iterator().next().identity().principalId()); - Assertions.assertEquals("zcntogffjwajnrtw", response.iterator().next().identity().tenantId()); - Assertions.assertEquals("kifmxawo", - response.iterator().next().identity().userAssignedIdentities().get("nhemvwfnqqw").principalId()); - Assertions.assertEquals("fzknhrkmjqncfvds", - response.iterator().next().identity().userAssignedIdentities().get("nhemvwfnqqw").clientId()); - Assertions.assertEquals(UUID.fromString("a2acd50d-8952-4bed-b9ae-a22c3a031691"), - response.iterator().next().partnerRegistrationImmutableId()); - Assertions.assertEquals("k", response.iterator().next().source()); - Assertions.assertEquals(EventDefinitionKind.INLINE, response.iterator().next().eventTypeInfo().kind()); - Assertions.assertEquals("krknf", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("hkxfpwhdyslbklgl").description()); - Assertions.assertEquals("ugjqyckgtxkrdt", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("hkxfpwhdyslbklgl").displayName()); - Assertions.assertEquals("crcjdklotcsubmz", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("hkxfpwhdyslbklgl").documentationUrl()); - Assertions.assertEquals("nsvob", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("hkxfpwhdyslbklgl").dataSchemaUrl()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-05T00:30:38Z"), - response.iterator().next().expirationTimeIfNotActivatedUtc()); - Assertions.assertEquals(PartnerTopicActivationState.NEVER_ACTIVATED, - response.iterator().next().activationState()); - Assertions.assertEquals("k", response.iterator().next().partnerTopicFriendlyDescription()); - Assertions.assertEquals("vezefkhkqtwqle", response.iterator().next().messageForActivation()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsListMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsListMockTests.java deleted file mode 100644 index 592a25b92adf..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsListMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.PartnerTopic; -import com.azure.resourcemanager.eventgrid.models.PartnerTopicActivationState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PartnerTopicsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"partnerRegistrationImmutableId\":\"73f4c511-c86b-4ae2-99b2-e5c555232e8e\",\"source\":\"dawsxmrsz\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"bjmbnvynfaooeac\":{\"description\":\"pnerxrzut\",\"displayName\":\"c\",\"documentationUrl\":\"za\",\"dataSchemaUrl\":\"nbxqaeht\"}}},\"expirationTimeIfNotActivatedUtc\":\"2021-06-29T09:09:18Z\",\"provisioningState\":\"Updating\",\"activationState\":\"Deactivated\",\"partnerTopicFriendlyDescription\":\"akd\",\"messageForActivation\":\"dahzllrqm\"},\"identity\":{\"type\":\"SystemAssigned, UserAssigned\",\"principalId\":\"roid\",\"tenantId\":\"qypffmnoiicsu\",\"userAssignedIdentities\":{\"pjwyblvtbdmvs\":{\"principalId\":\"rjjtalxrdsjrho\",\"clientId\":\"qwgusxxhdo\"}}},\"location\":\"yidaelqpv\",\"tags\":{\"sui\":\"kwjfbotloggdusxu\",\"izfwihvaangqt\":\"uxcjkcoqwczsyiq\",\"jfwtgdfkkaui\":\"hjrfdmfdvbbaex\"},\"id\":\"vmuafmc\",\"name\":\"fedyuep\",\"type\":\"vpltidajjvy\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response - = manager.partnerTopics().list("oioyidoxznvgvd", 910812694, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("yidaelqpv", response.iterator().next().location()); - Assertions.assertEquals("kwjfbotloggdusxu", response.iterator().next().tags().get("sui")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, - response.iterator().next().identity().type()); - Assertions.assertEquals("roid", response.iterator().next().identity().principalId()); - Assertions.assertEquals("qypffmnoiicsu", response.iterator().next().identity().tenantId()); - Assertions.assertEquals("rjjtalxrdsjrho", - response.iterator().next().identity().userAssignedIdentities().get("pjwyblvtbdmvs").principalId()); - Assertions.assertEquals("qwgusxxhdo", - response.iterator().next().identity().userAssignedIdentities().get("pjwyblvtbdmvs").clientId()); - Assertions.assertEquals(UUID.fromString("73f4c511-c86b-4ae2-99b2-e5c555232e8e"), - response.iterator().next().partnerRegistrationImmutableId()); - Assertions.assertEquals("dawsxmrsz", response.iterator().next().source()); - Assertions.assertEquals(EventDefinitionKind.INLINE, response.iterator().next().eventTypeInfo().kind()); - Assertions.assertEquals("pnerxrzut", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("bjmbnvynfaooeac").description()); - Assertions.assertEquals("c", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("bjmbnvynfaooeac").displayName()); - Assertions.assertEquals("za", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("bjmbnvynfaooeac").documentationUrl()); - Assertions.assertEquals("nbxqaeht", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("bjmbnvynfaooeac").dataSchemaUrl()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-29T09:09:18Z"), - response.iterator().next().expirationTimeIfNotActivatedUtc()); - Assertions.assertEquals(PartnerTopicActivationState.DEACTIVATED, response.iterator().next().activationState()); - Assertions.assertEquals("akd", response.iterator().next().partnerTopicFriendlyDescription()); - Assertions.assertEquals("dahzllrqm", response.iterator().next().messageForActivation()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsListResultTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsListResultTests.java deleted file mode 100644 index ec40a96ddaf3..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerTopicsListResultTests.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.PartnerTopicInner; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import com.azure.resourcemanager.eventgrid.models.PartnerTopicActivationState; -import com.azure.resourcemanager.eventgrid.models.PartnerTopicsListResult; -import com.azure.resourcemanager.eventgrid.models.UserIdentityProperties; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; - -public final class PartnerTopicsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartnerTopicsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"partnerRegistrationImmutableId\":\"1b4907fb-0de6-42a6-9bf5-8cfcc373d128\",\"source\":\"qmjxlyyzglgouwtl\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"j\":{},\"tob\":{},\"xkjeytunlbfj\":{}}},\"expirationTimeIfNotActivatedUtc\":\"2021-01-21T02:32:08Z\",\"provisioningState\":\"Canceled\",\"activationState\":\"NeverActivated\",\"partnerTopicFriendlyDescription\":\"bhsy\",\"messageForActivation\":\"unjqh\"},\"identity\":{\"type\":\"None\",\"principalId\":\"l\",\"tenantId\":\"akdkifmjnnawtqab\",\"userAssignedIdentities\":{\"lqqmpiz\":{\"principalId\":\"kpggqoweyi\",\"clientId\":\"hlisngw\"},\"iixtmkzj\":{\"principalId\":\"w\",\"clientId\":\"qxpxiwfcngjsaa\"},\"tbrxkjz\":{\"principalId\":\"viirhgfgrws\",\"clientId\":\"gratzvzbglbyvict\"},\"pdbydpizqacln\":{\"principalId\":\"gxffmshkwf\",\"clientId\":\"gozxw\"}}},\"location\":\"pxbiygnugjknfs\",\"tags\":{\"rehmr\":\"ttuxuuyilflqoiqu\",\"jtwhauunf\":\"jhvsujztczyt\"},\"id\":\"rnjlet\",\"name\":\"xsmrpddouifamow\",\"type\":\"z\"},{\"properties\":{\"partnerRegistrationImmutableId\":\"d9a5535c-c736-41c3-9c00-87cecb200e5f\",\"source\":\"nlqwzdvpiwhx\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"aajquhuxylrj\":{},\"m\":{},\"ygjbmzyospspsh\":{}}},\"expirationTimeIfNotActivatedUtc\":\"2021-11-10T17:31:52Z\",\"provisioningState\":\"Succeeded\",\"activationState\":\"NeverActivated\",\"partnerTopicFriendlyDescription\":\"sp\",\"messageForActivation\":\"ssdfpp\"},\"identity\":{\"type\":\"SystemAssigned\",\"principalId\":\"yujtvczkcnyx\",\"tenantId\":\"munjdxvglnkvx\",\"userAssignedIdentities\":{\"iypfp\":{\"principalId\":\"glqivbgkcv\",\"clientId\":\"pzvuqdflvo\"},\"qjxgpnrhgovfgp\":{\"principalId\":\"cpzgpxtiv\",\"clientId\":\"knidib\"},\"kfvxcnq\":{\"principalId\":\"qmhhaowj\",\"clientId\":\"zvuporqzdfuydz\"}}},\"location\":\"xqpswok\",\"tags\":{\"gdhbe\":\"hl\"},\"id\":\"zqkzszuwi\",\"name\":\"tglxx\",\"type\":\"ljfp\"},{\"properties\":{\"partnerRegistrationImmutableId\":\"47e3cd3b-1169-4779-8fab-c781bc0e9f6e\",\"source\":\"rmnzhr\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"x\":{},\"pqcbfrmbodthsq\":{},\"gvriibakclac\":{},\"fr\":{}}},\"expirationTimeIfNotActivatedUtc\":\"2021-12-02T11:03:59Z\",\"provisioningState\":\"Creating\",\"activationState\":\"NeverActivated\",\"partnerTopicFriendlyDescription\":\"zlwvsgmwohqfz\",\"messageForActivation\":\"vux\"},\"identity\":{\"type\":\"None\",\"principalId\":\"thnwpzte\",\"tenantId\":\"vmribiat\",\"userAssignedIdentities\":{\"zqwmvt\":{\"principalId\":\"ucfotangcf\",\"clientId\":\"ykzcugswvxwl\"},\"npdkv\":{\"principalId\":\"jmxmcuqud\",\"clientId\":\"vclx\"},\"iknp\":{\"principalId\":\"abuiy\",\"clientId\":\"buzphdugn\"},\"d\":{\"principalId\":\"xgjiuqh\",\"clientId\":\"tozipqwj\"}}},\"location\":\"urrxxgewpktv\",\"tags\":{\"o\":\"kmqp\"},\"id\":\"hlfbcgwgc\",\"name\":\"oxoebqi\",\"type\":\"jipnwj\"},{\"properties\":{\"partnerRegistrationImmutableId\":\"b602a61f-62b9-4bbb-abb4-1ec7de0796d0\",\"source\":\"lafcbahh\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"iyjwpfilkmkkho\":{}}},\"expirationTimeIfNotActivatedUtc\":\"2021-04-17T01:40:25Z\",\"provisioningState\":\"IdleDueToMirroredChannelResourceDeletion\",\"activationState\":\"Deactivated\",\"partnerTopicFriendlyDescription\":\"uogphuartvtiuky\",\"messageForActivation\":\"chnmna\"},\"identity\":{\"type\":\"SystemAssigned, UserAssigned\",\"principalId\":\"xjqirwrweoox\",\"tenantId\":\"i\",\"userAssignedIdentities\":{\"taboidvmf\":{\"principalId\":\"rsnewmozqvbubqma\",\"clientId\":\"sycxhxzgaz\"},\"epdfgkmtdherng\":{\"principalId\":\"ppu\",\"clientId\":\"w\"}}},\"location\":\"tcjuahokqto\",\"tags\":{\"wzejywhslw\":\"uxofshfphwpnulai\",\"fugsnnfhyetefy\":\"ojpllndnpdwrpqaf\",\"ctfjgtixr\":\"oc\"},\"id\":\"vzuyturmlmu\",\"name\":\"wolba\",\"type\":\"iropionszon\"}],\"nextLink\":\"ngajinnixjawrtmj\"}") - .toObject(PartnerTopicsListResult.class); - Assertions.assertEquals("pxbiygnugjknfs", model.value().get(0).location()); - Assertions.assertEquals("ttuxuuyilflqoiqu", model.value().get(0).tags().get("rehmr")); - Assertions.assertEquals(IdentityType.NONE, model.value().get(0).identity().type()); - Assertions.assertEquals("l", model.value().get(0).identity().principalId()); - Assertions.assertEquals("akdkifmjnnawtqab", model.value().get(0).identity().tenantId()); - Assertions.assertEquals("kpggqoweyi", - model.value().get(0).identity().userAssignedIdentities().get("lqqmpiz").principalId()); - Assertions.assertEquals("hlisngw", - model.value().get(0).identity().userAssignedIdentities().get("lqqmpiz").clientId()); - Assertions.assertEquals(UUID.fromString("1b4907fb-0de6-42a6-9bf5-8cfcc373d128"), - model.value().get(0).partnerRegistrationImmutableId()); - Assertions.assertEquals("qmjxlyyzglgouwtl", model.value().get(0).source()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.value().get(0).eventTypeInfo().kind()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-21T02:32:08Z"), - model.value().get(0).expirationTimeIfNotActivatedUtc()); - Assertions.assertEquals(PartnerTopicActivationState.NEVER_ACTIVATED, model.value().get(0).activationState()); - Assertions.assertEquals("bhsy", model.value().get(0).partnerTopicFriendlyDescription()); - Assertions.assertEquals("unjqh", model.value().get(0).messageForActivation()); - Assertions.assertEquals("ngajinnixjawrtmj", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartnerTopicsListResult model - = new PartnerTopicsListResult().withValue(Arrays.asList( - new PartnerTopicInner().withLocation("pxbiygnugjknfs") - .withTags(mapOf("rehmr", "ttuxuuyilflqoiqu", "jtwhauunf", "jhvsujztczyt")) - .withIdentity(new IdentityInfo().withType(IdentityType.NONE) - .withPrincipalId("l") - .withTenantId("akdkifmjnnawtqab") - .withUserAssignedIdentities(mapOf("lqqmpiz", - new UserIdentityProperties().withPrincipalId("kpggqoweyi").withClientId("hlisngw"), - "iixtmkzj", - new UserIdentityProperties().withPrincipalId("w").withClientId("qxpxiwfcngjsaa"), "tbrxkjz", - new UserIdentityProperties().withPrincipalId("viirhgfgrws") - .withClientId("gratzvzbglbyvict"), - "pdbydpizqacln", - new UserIdentityProperties().withPrincipalId("gxffmshkwf").withClientId("gozxw")))) - .withPartnerRegistrationImmutableId(UUID.fromString("1b4907fb-0de6-42a6-9bf5-8cfcc373d128")) - .withSource("qmjxlyyzglgouwtl") - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("j", new InlineEventProperties(), "tob", - new InlineEventProperties(), "xkjeytunlbfj", new InlineEventProperties()))) - .withExpirationTimeIfNotActivatedUtc(OffsetDateTime.parse("2021-01-21T02:32:08Z")) - .withActivationState(PartnerTopicActivationState.NEVER_ACTIVATED) - .withPartnerTopicFriendlyDescription("bhsy") - .withMessageForActivation("unjqh"), - new PartnerTopicInner().withLocation("xqpswok") - .withTags(mapOf("gdhbe", "hl")) - .withIdentity(new IdentityInfo().withType(IdentityType.SYSTEM_ASSIGNED) - .withPrincipalId("yujtvczkcnyx") - .withTenantId("munjdxvglnkvx") - .withUserAssignedIdentities(mapOf("iypfp", - new UserIdentityProperties().withPrincipalId("glqivbgkcv").withClientId("pzvuqdflvo"), - "qjxgpnrhgovfgp", - new UserIdentityProperties().withPrincipalId("cpzgpxtiv").withClientId("knidib"), "kfvxcnq", - new UserIdentityProperties().withPrincipalId("qmhhaowj").withClientId("zvuporqzdfuydz")))) - .withPartnerRegistrationImmutableId(UUID.fromString("d9a5535c-c736-41c3-9c00-87cecb200e5f")) - .withSource("nlqwzdvpiwhx") - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("aajquhuxylrj", new InlineEventProperties(), "m", - new InlineEventProperties(), "ygjbmzyospspsh", new InlineEventProperties()))) - .withExpirationTimeIfNotActivatedUtc(OffsetDateTime.parse("2021-11-10T17:31:52Z")) - .withActivationState(PartnerTopicActivationState.NEVER_ACTIVATED) - .withPartnerTopicFriendlyDescription("sp") - .withMessageForActivation("ssdfpp"), - new PartnerTopicInner() - .withLocation("urrxxgewpktv") - .withTags(mapOf("o", "kmqp")) - .withIdentity(new IdentityInfo().withType(IdentityType.NONE) - .withPrincipalId("thnwpzte") - .withTenantId("vmribiat") - .withUserAssignedIdentities(mapOf("zqwmvt", - new UserIdentityProperties().withPrincipalId("ucfotangcf").withClientId("ykzcugswvxwl"), - "npdkv", new UserIdentityProperties().withPrincipalId("jmxmcuqud").withClientId("vclx"), - "iknp", new UserIdentityProperties().withPrincipalId("abuiy").withClientId("buzphdugn"), - "d", new UserIdentityProperties().withPrincipalId("xgjiuqh").withClientId("tozipqwj")))) - .withPartnerRegistrationImmutableId(UUID.fromString("47e3cd3b-1169-4779-8fab-c781bc0e9f6e")) - .withSource("rmnzhr") - .withEventTypeInfo( - new EventTypeInfo() - .withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes( - mapOf("x", new InlineEventProperties(), "pqcbfrmbodthsq", new InlineEventProperties(), - "gvriibakclac", new InlineEventProperties(), "fr", new InlineEventProperties()))) - .withExpirationTimeIfNotActivatedUtc(OffsetDateTime.parse("2021-12-02T11:03:59Z")) - .withActivationState(PartnerTopicActivationState.NEVER_ACTIVATED) - .withPartnerTopicFriendlyDescription("zlwvsgmwohqfz") - .withMessageForActivation("vux"), - new PartnerTopicInner().withLocation("tcjuahokqto") - .withTags(mapOf("wzejywhslw", "uxofshfphwpnulai", "fugsnnfhyetefy", "ojpllndnpdwrpqaf", "ctfjgtixr", - "oc")) - .withIdentity(new IdentityInfo().withType(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withPrincipalId("xjqirwrweoox") - .withTenantId("i") - .withUserAssignedIdentities(mapOf("taboidvmf", - new UserIdentityProperties().withPrincipalId("rsnewmozqvbubqma").withClientId("sycxhxzgaz"), - "epdfgkmtdherng", new UserIdentityProperties().withPrincipalId("ppu").withClientId("w")))) - .withPartnerRegistrationImmutableId(UUID.fromString("b602a61f-62b9-4bbb-abb4-1ec7de0796d0")) - .withSource("lafcbahh") - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("iyjwpfilkmkkho", new InlineEventProperties()))) - .withExpirationTimeIfNotActivatedUtc(OffsetDateTime.parse("2021-04-17T01:40:25Z")) - .withActivationState(PartnerTopicActivationState.DEACTIVATED) - .withPartnerTopicFriendlyDescription("uogphuartvtiuky") - .withMessageForActivation("chnmna"))) - .withNextLink("ngajinnixjawrtmj"); - model = BinaryData.fromObject(model).toObject(PartnerTopicsListResult.class); - Assertions.assertEquals("pxbiygnugjknfs", model.value().get(0).location()); - Assertions.assertEquals("ttuxuuyilflqoiqu", model.value().get(0).tags().get("rehmr")); - Assertions.assertEquals(IdentityType.NONE, model.value().get(0).identity().type()); - Assertions.assertEquals("l", model.value().get(0).identity().principalId()); - Assertions.assertEquals("akdkifmjnnawtqab", model.value().get(0).identity().tenantId()); - Assertions.assertEquals("kpggqoweyi", - model.value().get(0).identity().userAssignedIdentities().get("lqqmpiz").principalId()); - Assertions.assertEquals("hlisngw", - model.value().get(0).identity().userAssignedIdentities().get("lqqmpiz").clientId()); - Assertions.assertEquals(UUID.fromString("1b4907fb-0de6-42a6-9bf5-8cfcc373d128"), - model.value().get(0).partnerRegistrationImmutableId()); - Assertions.assertEquals("qmjxlyyzglgouwtl", model.value().get(0).source()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.value().get(0).eventTypeInfo().kind()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-21T02:32:08Z"), - model.value().get(0).expirationTimeIfNotActivatedUtc()); - Assertions.assertEquals(PartnerTopicActivationState.NEVER_ACTIVATED, model.value().get(0).activationState()); - Assertions.assertEquals("bhsy", model.value().get(0).partnerTopicFriendlyDescription()); - Assertions.assertEquals("unjqh", model.value().get(0).messageForActivation()); - Assertions.assertEquals("ngajinnixjawrtmj", model.nextLink()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerUpdateTopicInfoTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerUpdateTopicInfoTests.java deleted file mode 100644 index 2edd6d4818cb..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PartnerUpdateTopicInfoTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import com.azure.resourcemanager.eventgrid.models.PartnerUpdateTopicInfo; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PartnerUpdateTopicInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PartnerUpdateTopicInfo model = BinaryData.fromString( - "{\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"qedqytbciqfoufl\":{\"description\":\"ejk\",\"displayName\":\"ynqgoulzndlikwyq\",\"documentationUrl\":\"fgibmadgakeq\",\"dataSchemaUrl\":\"xybz\"},\"mkdo\":{\"description\":\"nkzsmodmglou\",\"displayName\":\"b\",\"documentationUrl\":\"tmut\",\"dataSchemaUrl\":\"qktapspwgcuert\"},\"psalgbqux\":{\"description\":\"qw\",\"displayName\":\"mdgbbjfdd\",\"documentationUrl\":\"bmbexppbhtqqro\",\"dataSchemaUrl\":\"p\"},\"wrlyxwjkcprb\":{\"description\":\"jyj\",\"displayName\":\"jaoyfhrtx\",\"documentationUrl\":\"n\",\"dataSchemaUrl\":\"kujysvlejuvfq\"}}}}") - .toObject(PartnerUpdateTopicInfo.class); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("ejk", model.eventTypeInfo().inlineEventTypes().get("qedqytbciqfoufl").description()); - Assertions.assertEquals("ynqgoulzndlikwyq", - model.eventTypeInfo().inlineEventTypes().get("qedqytbciqfoufl").displayName()); - Assertions.assertEquals("fgibmadgakeq", - model.eventTypeInfo().inlineEventTypes().get("qedqytbciqfoufl").documentationUrl()); - Assertions.assertEquals("xybz", - model.eventTypeInfo().inlineEventTypes().get("qedqytbciqfoufl").dataSchemaUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PartnerUpdateTopicInfo model - = new PartnerUpdateTopicInfo().withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("qedqytbciqfoufl", - new InlineEventProperties().withDescription("ejk") - .withDisplayName("ynqgoulzndlikwyq") - .withDocumentationUrl("fgibmadgakeq") - .withDataSchemaUrl("xybz"), - "mkdo", - new InlineEventProperties().withDescription("nkzsmodmglou") - .withDisplayName("b") - .withDocumentationUrl("tmut") - .withDataSchemaUrl("qktapspwgcuert"), - "psalgbqux", - new InlineEventProperties().withDescription("qw") - .withDisplayName("mdgbbjfdd") - .withDocumentationUrl("bmbexppbhtqqro") - .withDataSchemaUrl("p"), - "wrlyxwjkcprb", - new InlineEventProperties().withDescription("jyj") - .withDisplayName("jaoyfhrtx") - .withDocumentationUrl("n") - .withDataSchemaUrl("kujysvlejuvfq")))); - model = BinaryData.fromObject(model).toObject(PartnerUpdateTopicInfo.class); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("ejk", model.eventTypeInfo().inlineEventTypes().get("qedqytbciqfoufl").description()); - Assertions.assertEquals("ynqgoulzndlikwyq", - model.eventTypeInfo().inlineEventTypes().get("qedqytbciqfoufl").displayName()); - Assertions.assertEquals("fgibmadgakeq", - model.eventTypeInfo().inlineEventTypes().get("qedqytbciqfoufl").documentationUrl()); - Assertions.assertEquals("xybz", - model.eventTypeInfo().inlineEventTypes().get("qedqytbciqfoufl").dataSchemaUrl()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PermissionBindingInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PermissionBindingInnerTests.java deleted file mode 100644 index 733ef2ecbee6..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PermissionBindingInnerTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.PermissionBindingInner; -import com.azure.resourcemanager.eventgrid.models.PermissionType; -import org.junit.jupiter.api.Assertions; - -public final class PermissionBindingInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PermissionBindingInner model = BinaryData.fromString( - "{\"properties\":{\"description\":\"yccxlzhcox\",\"topicSpaceName\":\"nekhenlusfnrdtj\",\"permission\":\"Publisher\",\"clientGroupName\":\"dcqtjvidttge\",\"provisioningState\":\"Updating\"},\"id\":\"vyjtcvu\",\"name\":\"kasizie\",\"type\":\"fuughtuqfec\"}") - .toObject(PermissionBindingInner.class); - Assertions.assertEquals("yccxlzhcox", model.description()); - Assertions.assertEquals("nekhenlusfnrdtj", model.topicSpaceName()); - Assertions.assertEquals(PermissionType.PUBLISHER, model.permission()); - Assertions.assertEquals("dcqtjvidttge", model.clientGroupName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PermissionBindingInner model = new PermissionBindingInner().withDescription("yccxlzhcox") - .withTopicSpaceName("nekhenlusfnrdtj") - .withPermission(PermissionType.PUBLISHER) - .withClientGroupName("dcqtjvidttge"); - model = BinaryData.fromObject(model).toObject(PermissionBindingInner.class); - Assertions.assertEquals("yccxlzhcox", model.description()); - Assertions.assertEquals("nekhenlusfnrdtj", model.topicSpaceName()); - Assertions.assertEquals(PermissionType.PUBLISHER, model.permission()); - Assertions.assertEquals("dcqtjvidttge", model.clientGroupName()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PermissionBindingPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PermissionBindingPropertiesTests.java deleted file mode 100644 index 487fb3e273c8..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PermissionBindingPropertiesTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.PermissionBindingProperties; -import com.azure.resourcemanager.eventgrid.models.PermissionType; -import org.junit.jupiter.api.Assertions; - -public final class PermissionBindingPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PermissionBindingProperties model = BinaryData.fromString( - "{\"description\":\"ey\",\"topicSpaceName\":\"uhxu\",\"permission\":\"Publisher\",\"clientGroupName\":\"ewmrswnjlxu\",\"provisioningState\":\"Failed\"}") - .toObject(PermissionBindingProperties.class); - Assertions.assertEquals("ey", model.description()); - Assertions.assertEquals("uhxu", model.topicSpaceName()); - Assertions.assertEquals(PermissionType.PUBLISHER, model.permission()); - Assertions.assertEquals("ewmrswnjlxu", model.clientGroupName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PermissionBindingProperties model = new PermissionBindingProperties().withDescription("ey") - .withTopicSpaceName("uhxu") - .withPermission(PermissionType.PUBLISHER) - .withClientGroupName("ewmrswnjlxu"); - model = BinaryData.fromObject(model).toObject(PermissionBindingProperties.class); - Assertions.assertEquals("ey", model.description()); - Assertions.assertEquals("uhxu", model.topicSpaceName()); - Assertions.assertEquals(PermissionType.PUBLISHER, model.permission()); - Assertions.assertEquals("ewmrswnjlxu", model.clientGroupName()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PermissionBindingsCreateOrUpdateMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PermissionBindingsCreateOrUpdateMockTests.java deleted file mode 100644 index 40e9332bea29..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PermissionBindingsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.PermissionBinding; -import com.azure.resourcemanager.eventgrid.models.PermissionType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PermissionBindingsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"description\":\"tzcqipsd\",\"topicSpaceName\":\"gcozzomehxlant\",\"permission\":\"Publisher\",\"clientGroupName\":\"lbij\",\"provisioningState\":\"Succeeded\"},\"id\":\"llczipvwdt\",\"name\":\"ckzdqiqdlra\",\"type\":\"rkwxo\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PermissionBinding response = manager.permissionBindings() - .define("ulxfaryrvjl") - .withExistingNamespace("htmjo", "uif") - .withDescription("zvj") - .withTopicSpaceName("ahoyiyaxqvj") - .withPermission(PermissionType.PUBLISHER) - .withClientGroupName("tcz") - .create(); - - Assertions.assertEquals("tzcqipsd", response.description()); - Assertions.assertEquals("gcozzomehxlant", response.topicSpaceName()); - Assertions.assertEquals(PermissionType.PUBLISHER, response.permission()); - Assertions.assertEquals("lbij", response.clientGroupName()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PermissionBindingsDeleteMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PermissionBindingsDeleteMockTests.java deleted file mode 100644 index 9ccdd5cf1864..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PermissionBindingsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PermissionBindingsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.permissionBindings().delete("or", "nikcedpk", "riwmmtmqrxrzqv", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PermissionBindingsGetWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PermissionBindingsGetWithResponseMockTests.java deleted file mode 100644 index 0a2fe924f22e..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PermissionBindingsGetWithResponseMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.PermissionBinding; -import com.azure.resourcemanager.eventgrid.models.PermissionType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PermissionBindingsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"description\":\"qjumovs\",\"topicSpaceName\":\"pbvzopaxmfmvsmcw\",\"permission\":\"Subscriber\",\"clientGroupName\":\"xdtnqifbs\",\"provisioningState\":\"Creating\"},\"id\":\"iauesugmocpcjy\",\"name\":\"boel\",\"type\":\"gttwfldsi\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PermissionBinding response = manager.permissionBindings() - .getWithResponse("ovanyrva", "rtgelg", "ewikfyaqandmym", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("qjumovs", response.description()); - Assertions.assertEquals("pbvzopaxmfmvsmcw", response.topicSpaceName()); - Assertions.assertEquals(PermissionType.SUBSCRIBER, response.permission()); - Assertions.assertEquals("xdtnqifbs", response.clientGroupName()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PermissionBindingsListByNamespaceMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PermissionBindingsListByNamespaceMockTests.java deleted file mode 100644 index 5aa52028f4de..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PermissionBindingsListByNamespaceMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.PermissionBinding; -import com.azure.resourcemanager.eventgrid.models.PermissionType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PermissionBindingsListByNamespaceMockTests { - @Test - public void testListByNamespace() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"description\":\"lnupoyryefqmw\",\"topicSpaceName\":\"yztxlno\",\"permission\":\"Subscriber\",\"clientGroupName\":\"jceegvyiez\",\"provisioningState\":\"Canceled\"},\"id\":\"nji\",\"name\":\"l\",\"type\":\"kkreh\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.permissionBindings() - .listByNamespace("yczyayubtgm", "xiqahr", "gpx", 1761303389, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("lnupoyryefqmw", response.iterator().next().description()); - Assertions.assertEquals("yztxlno", response.iterator().next().topicSpaceName()); - Assertions.assertEquals(PermissionType.SUBSCRIBER, response.iterator().next().permission()); - Assertions.assertEquals("jceegvyiez", response.iterator().next().clientGroupName()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PermissionBindingsListResultTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PermissionBindingsListResultTests.java deleted file mode 100644 index dc8b2954e43a..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PermissionBindingsListResultTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.PermissionBindingInner; -import com.azure.resourcemanager.eventgrid.models.PermissionBindingsListResult; -import com.azure.resourcemanager.eventgrid.models.PermissionType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PermissionBindingsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PermissionBindingsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"description\":\"xjbaqehgpdohzjq\",\"topicSpaceName\":\"ucoig\",\"permission\":\"Publisher\",\"clientGroupName\":\"cnwfepbnwgfmxjg\",\"provisioningState\":\"Creating\"},\"id\":\"bgdlfgtdysna\",\"name\":\"uflqbctq\",\"type\":\"amz\"},{\"properties\":{\"description\":\"dkq\",\"topicSpaceName\":\"qy\",\"permission\":\"Subscriber\",\"clientGroupName\":\"iunjxdf\",\"provisioningState\":\"Deleted\"},\"id\":\"kwcegyamlbn\",\"name\":\"eqacjjvpilguooq\",\"type\":\"agmdit\"}],\"nextLink\":\"eiookjbsah\"}") - .toObject(PermissionBindingsListResult.class); - Assertions.assertEquals("xjbaqehgpdohzjq", model.value().get(0).description()); - Assertions.assertEquals("ucoig", model.value().get(0).topicSpaceName()); - Assertions.assertEquals(PermissionType.PUBLISHER, model.value().get(0).permission()); - Assertions.assertEquals("cnwfepbnwgfmxjg", model.value().get(0).clientGroupName()); - Assertions.assertEquals("eiookjbsah", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PermissionBindingsListResult model = new PermissionBindingsListResult().withValue(Arrays.asList( - new PermissionBindingInner().withDescription("xjbaqehgpdohzjq") - .withTopicSpaceName("ucoig") - .withPermission(PermissionType.PUBLISHER) - .withClientGroupName("cnwfepbnwgfmxjg"), - new PermissionBindingInner().withDescription("dkq") - .withTopicSpaceName("qy") - .withPermission(PermissionType.SUBSCRIBER) - .withClientGroupName("iunjxdf"))) - .withNextLink("eiookjbsah"); - model = BinaryData.fromObject(model).toObject(PermissionBindingsListResult.class); - Assertions.assertEquals("xjbaqehgpdohzjq", model.value().get(0).description()); - Assertions.assertEquals("ucoig", model.value().get(0).topicSpaceName()); - Assertions.assertEquals(PermissionType.PUBLISHER, model.value().get(0).permission()); - Assertions.assertEquals("cnwfepbnwgfmxjg", model.value().get(0).clientGroupName()); - Assertions.assertEquals("eiookjbsah", model.nextLink()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateEndpointConnectionInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateEndpointConnectionInnerTests.java deleted file mode 100644 index d2764b217841..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateEndpointConnectionInnerTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.eventgrid.models.ConnectionState; -import com.azure.resourcemanager.eventgrid.models.PersistedConnectionStatus; -import com.azure.resourcemanager.eventgrid.models.PrivateEndpoint; -import com.azure.resourcemanager.eventgrid.models.ResourceProvisioningState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionInner model = BinaryData.fromString( - "{\"properties\":{\"privateEndpoint\":{\"id\":\"bnlankxmyskpb\"},\"groupIds\":[\"btkcxywnytnrsyn\",\"qidybyx\",\"zfcl\",\"aaxdbabphlwrq\"],\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"thsu\",\"actionsRequired\":\"cmnyyazttb\"},\"provisioningState\":\"Canceled\"},\"id\":\"rq\",\"name\":\"uedck\",\"type\":\"ywbiexzfeyueax\"}") - .toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals("bnlankxmyskpb", model.privateEndpoint().id()); - Assertions.assertEquals("btkcxywnytnrsyn", model.groupIds().get(0)); - Assertions.assertEquals(PersistedConnectionStatus.REJECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("thsu", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("cmnyyazttb", model.privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals(ResourceProvisioningState.CANCELED, model.provisioningState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionInner model = new PrivateEndpointConnectionInner() - .withPrivateEndpoint(new PrivateEndpoint().withId("bnlankxmyskpb")) - .withGroupIds(Arrays.asList("btkcxywnytnrsyn", "qidybyx", "zfcl", "aaxdbabphlwrq")) - .withPrivateLinkServiceConnectionState(new ConnectionState().withStatus(PersistedConnectionStatus.REJECTED) - .withDescription("thsu") - .withActionsRequired("cmnyyazttb")) - .withProvisioningState(ResourceProvisioningState.CANCELED); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals("bnlankxmyskpb", model.privateEndpoint().id()); - Assertions.assertEquals("btkcxywnytnrsyn", model.groupIds().get(0)); - Assertions.assertEquals(PersistedConnectionStatus.REJECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("thsu", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("cmnyyazttb", model.privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals(ResourceProvisioningState.CANCELED, model.provisioningState()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateEndpointConnectionListResultTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateEndpointConnectionListResultTests.java deleted file mode 100644 index 07ff352f5927..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateEndpointConnectionListResultTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.eventgrid.models.ConnectionState; -import com.azure.resourcemanager.eventgrid.models.PersistedConnectionStatus; -import com.azure.resourcemanager.eventgrid.models.PrivateEndpoint; -import com.azure.resourcemanager.eventgrid.models.PrivateEndpointConnectionListResult; -import com.azure.resourcemanager.eventgrid.models.ResourceProvisioningState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"elqacslmot\"},\"groupIds\":[\"nfxofvcj\",\"gdirazf\"],\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"ab\",\"actionsRequired\":\"ujtmvcopexcmjurb\"},\"provisioningState\":\"Updating\"},\"id\":\"lkyqltqsrog\",\"name\":\"uwkffdjktsysid\",\"type\":\"vclglxnfuij\"}],\"nextLink\":\"busqogsfi\"}") - .toObject(PrivateEndpointConnectionListResult.class); - Assertions.assertEquals("elqacslmot", model.value().get(0).privateEndpoint().id()); - Assertions.assertEquals("nfxofvcj", model.value().get(0).groupIds().get(0)); - Assertions.assertEquals(PersistedConnectionStatus.APPROVED, - model.value().get(0).privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ab", model.value().get(0).privateLinkServiceConnectionState().description()); - Assertions.assertEquals("ujtmvcopexcmjurb", - model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals(ResourceProvisioningState.UPDATING, model.value().get(0).provisioningState()); - Assertions.assertEquals("busqogsfi", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionListResult model = new PrivateEndpointConnectionListResult().withValue(Arrays - .asList(new PrivateEndpointConnectionInner().withPrivateEndpoint(new PrivateEndpoint().withId("elqacslmot")) - .withGroupIds(Arrays.asList("nfxofvcj", "gdirazf")) - .withPrivateLinkServiceConnectionState( - new ConnectionState().withStatus(PersistedConnectionStatus.APPROVED) - .withDescription("ab") - .withActionsRequired("ujtmvcopexcmjurb")) - .withProvisioningState(ResourceProvisioningState.UPDATING))) - .withNextLink("busqogsfi"); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResult.class); - Assertions.assertEquals("elqacslmot", model.value().get(0).privateEndpoint().id()); - Assertions.assertEquals("nfxofvcj", model.value().get(0).groupIds().get(0)); - Assertions.assertEquals(PersistedConnectionStatus.APPROVED, - model.value().get(0).privateLinkServiceConnectionState().status()); - Assertions.assertEquals("ab", model.value().get(0).privateLinkServiceConnectionState().description()); - Assertions.assertEquals("ujtmvcopexcmjurb", - model.value().get(0).privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals(ResourceProvisioningState.UPDATING, model.value().get(0).provisioningState()); - Assertions.assertEquals("busqogsfi", model.nextLink()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateEndpointConnectionPropertiesTests.java deleted file mode 100644 index 542b762c5391..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateEndpointConnectionPropertiesTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.eventgrid.models.ConnectionState; -import com.azure.resourcemanager.eventgrid.models.PersistedConnectionStatus; -import com.azure.resourcemanager.eventgrid.models.PrivateEndpoint; -import com.azure.resourcemanager.eventgrid.models.ResourceProvisioningState; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionProperties model = BinaryData.fromString( - "{\"privateEndpoint\":{\"id\":\"ujwb\"},\"groupIds\":[\"almuzyoxaepdkzja\"],\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"hdwbavxbniwdjs\",\"actionsRequired\":\"tsdbpgn\"},\"provisioningState\":\"Canceled\"}") - .toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals("ujwb", model.privateEndpoint().id()); - Assertions.assertEquals("almuzyoxaepdkzja", model.groupIds().get(0)); - Assertions.assertEquals(PersistedConnectionStatus.DISCONNECTED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("hdwbavxbniwdjs", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("tsdbpgn", model.privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals(ResourceProvisioningState.CANCELED, model.provisioningState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionProperties model - = new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint().withId("ujwb")) - .withGroupIds(Arrays.asList("almuzyoxaepdkzja")) - .withPrivateLinkServiceConnectionState( - new ConnectionState().withStatus(PersistedConnectionStatus.DISCONNECTED) - .withDescription("hdwbavxbniwdjs") - .withActionsRequired("tsdbpgn")) - .withProvisioningState(ResourceProvisioningState.CANCELED); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals("ujwb", model.privateEndpoint().id()); - Assertions.assertEquals("almuzyoxaepdkzja", model.groupIds().get(0)); - Assertions.assertEquals(PersistedConnectionStatus.DISCONNECTED, - model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("hdwbavxbniwdjs", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("tsdbpgn", model.privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals(ResourceProvisioningState.CANCELED, model.provisioningState()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java deleted file mode 100644 index 916f3a6da406..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.PersistedConnectionStatus; -import com.azure.resourcemanager.eventgrid.models.PrivateEndpointConnection; -import com.azure.resourcemanager.eventgrid.models.PrivateEndpointConnectionsParentType; -import com.azure.resourcemanager.eventgrid.models.ResourceProvisioningState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"privateEndpoint\":{\"id\":\"kbdgddkrh\"},\"groupIds\":[\"xbeuuqu\",\"kzwtjwwguzytij\",\"xfn\",\"ndegjdydhqkkkbj\"],\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"tuqbhp\",\"actionsRequired\":\"cnxtpzdlysei\"},\"provisioningState\":\"Succeeded\"},\"id\":\"akatprytg\",\"name\":\"hzbqfdpfawrptvcs\",\"type\":\"tk\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PrivateEndpointConnection response = manager.privateEndpointConnections() - .getWithResponse("uwxsuykznhrfgsl", PrivateEndpointConnectionsParentType.NAMESPACES, "hpryjfzihuioa", - "ocpajt", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("kbdgddkrh", response.privateEndpoint().id()); - Assertions.assertEquals("xbeuuqu", response.groupIds().get(0)); - Assertions.assertEquals(PersistedConnectionStatus.DISCONNECTED, - response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("tuqbhp", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("cnxtpzdlysei", response.privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals(ResourceProvisioningState.SUCCEEDED, response.provisioningState()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateEndpointConnectionsListByResourceMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateEndpointConnectionsListByResourceMockTests.java deleted file mode 100644 index 38106a65dd7b..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateEndpointConnectionsListByResourceMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.PersistedConnectionStatus; -import com.azure.resourcemanager.eventgrid.models.PrivateEndpointConnection; -import com.azure.resourcemanager.eventgrid.models.PrivateEndpointConnectionsParentType; -import com.azure.resourcemanager.eventgrid.models.ResourceProvisioningState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsListByResourceMockTests { - @Test - public void testListByResource() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"fsqebuuxjxhfxf\"},\"groupIds\":[\"dkktpmbmxbmbrwgz\",\"xljbkhxsd\",\"laumydmhweqjf\",\"xydgtokvqbvwg\"],\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"vxakglh\",\"actionsRequired\":\"esrfgamqiydvx\"},\"provisioningState\":\"Canceled\"},\"id\":\"hyhgo\",\"name\":\"gs\",\"type\":\"yqyxyjrcbqpbis\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.privateEndpointConnections() - .listByResource("cpfpdofuckcl", PrivateEndpointConnectionsParentType.DOMAINS, "xlu", "vsolzwil", 1533197991, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("fsqebuuxjxhfxf", response.iterator().next().privateEndpoint().id()); - Assertions.assertEquals("dkktpmbmxbmbrwgz", response.iterator().next().groupIds().get(0)); - Assertions.assertEquals(PersistedConnectionStatus.APPROVED, - response.iterator().next().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("vxakglh", - response.iterator().next().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("esrfgamqiydvx", - response.iterator().next().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals(ResourceProvisioningState.CANCELED, response.iterator().next().provisioningState()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateEndpointConnectionsUpdateMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateEndpointConnectionsUpdateMockTests.java deleted file mode 100644 index 4f4edd184efc..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateEndpointConnectionsUpdateMockTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.eventgrid.models.ConnectionState; -import com.azure.resourcemanager.eventgrid.models.PersistedConnectionStatus; -import com.azure.resourcemanager.eventgrid.models.PrivateEndpoint; -import com.azure.resourcemanager.eventgrid.models.PrivateEndpointConnection; -import com.azure.resourcemanager.eventgrid.models.PrivateEndpointConnectionsParentType; -import com.azure.resourcemanager.eventgrid.models.ResourceProvisioningState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsUpdateMockTests { - @Test - public void testUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"privateEndpoint\":{\"id\":\"cgytoxuw\"},\"groupIds\":[\"nzqsaqmebgszpl\",\"sdekpdzz\"],\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"gvo\",\"actionsRequired\":\"ejidbdqzsq\"},\"provisioningState\":\"Succeeded\"},\"id\":\"cwztlvvws\",\"name\":\"mrkkyjtr\",\"type\":\"pwpwfkcauxuva\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PrivateEndpointConnection response = manager.privateEndpointConnections() - .update("tzc", PrivateEndpointConnectionsParentType.PARTNER_NAMESPACES, "bqgdird", "mmtzjgc", - new PrivateEndpointConnectionInner() - .withPrivateEndpoint(new PrivateEndpoint().withId("tbwjjirmuydgftt")) - .withGroupIds(Arrays.asList("fgeoagfuoftnx", "dwxmda")) - .withPrivateLinkServiceConnectionState( - new ConnectionState().withStatus(PersistedConnectionStatus.APPROVED) - .withDescription("mgsevmdmzenlr") - .withActionsRequired("gfc")) - .withProvisioningState(ResourceProvisioningState.SUCCEEDED), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("cgytoxuw", response.privateEndpoint().id()); - Assertions.assertEquals("nzqsaqmebgszpl", response.groupIds().get(0)); - Assertions.assertEquals(PersistedConnectionStatus.DISCONNECTED, - response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("gvo", response.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("ejidbdqzsq", response.privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals(ResourceProvisioningState.SUCCEEDED, response.provisioningState()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateEndpointTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateEndpointTests.java deleted file mode 100644 index 5bf59c5c9fc0..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateEndpointTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.PrivateEndpoint; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpoint model = BinaryData.fromString("{\"id\":\"hpzxbzpfzab\"}").toObject(PrivateEndpoint.class); - Assertions.assertEquals("hpzxbzpfzab", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpoint model = new PrivateEndpoint().withId("hpzxbzpfzab"); - model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); - Assertions.assertEquals("hpzxbzpfzab", model.id()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateLinkResourceInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateLinkResourceInnerTests.java deleted file mode 100644 index 2d8eaff8ba6e..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateLinkResourceInnerTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.PrivateLinkResourceInner; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceInner model = BinaryData.fromString( - "{\"properties\":{\"groupId\":\"ians\",\"displayName\":\"rujtjiqxfzyjq\",\"requiredMembers\":[\"wkpqhjpenuygbq\",\"qqekewvnqvcdlgu\"],\"requiredZoneNames\":[\"mfdjwn\",\"axpunjqikczvv\",\"tacgxmfc\"]},\"id\":\"er\",\"name\":\"tvsoxhlwntsj\",\"type\":\"rsxypruuu\"}") - .toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("er", model.id()); - Assertions.assertEquals("tvsoxhlwntsj", model.name()); - Assertions.assertEquals("rsxypruuu", model.type()); - Assertions.assertEquals("ians", model.groupId()); - Assertions.assertEquals("rujtjiqxfzyjq", model.displayName()); - Assertions.assertEquals("wkpqhjpenuygbq", model.requiredMembers().get(0)); - Assertions.assertEquals("mfdjwn", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceInner model = new PrivateLinkResourceInner().withId("er") - .withName("tvsoxhlwntsj") - .withType("rsxypruuu") - .withGroupId("ians") - .withDisplayName("rujtjiqxfzyjq") - .withRequiredMembers(Arrays.asList("wkpqhjpenuygbq", "qqekewvnqvcdlgu")) - .withRequiredZoneNames(Arrays.asList("mfdjwn", "axpunjqikczvv", "tacgxmfc")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceInner.class); - Assertions.assertEquals("er", model.id()); - Assertions.assertEquals("tvsoxhlwntsj", model.name()); - Assertions.assertEquals("rsxypruuu", model.type()); - Assertions.assertEquals("ians", model.groupId()); - Assertions.assertEquals("rujtjiqxfzyjq", model.displayName()); - Assertions.assertEquals("wkpqhjpenuygbq", model.requiredMembers().get(0)); - Assertions.assertEquals("mfdjwn", model.requiredZoneNames().get(0)); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateLinkResourcePropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateLinkResourcePropertiesTests.java deleted file mode 100644 index 1eba184aa9f9..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateLinkResourcePropertiesTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.PrivateLinkResourceProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceProperties model = BinaryData.fromString( - "{\"groupId\":\"nchrszizoyu\",\"displayName\":\"yetnd\",\"requiredMembers\":[\"qyggagfl\",\"lgmtrwahzjmucf\",\"byrplrohkpig\",\"fusuckzmkwklsno\"],\"requiredZoneNames\":[\"mqeq\",\"lhhjnh\"]}") - .toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("nchrszizoyu", model.groupId()); - Assertions.assertEquals("yetnd", model.displayName()); - Assertions.assertEquals("qyggagfl", model.requiredMembers().get(0)); - Assertions.assertEquals("mqeq", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceProperties model = new PrivateLinkResourceProperties().withGroupId("nchrszizoyu") - .withDisplayName("yetnd") - .withRequiredMembers(Arrays.asList("qyggagfl", "lgmtrwahzjmucf", "byrplrohkpig", "fusuckzmkwklsno")) - .withRequiredZoneNames(Arrays.asList("mqeq", "lhhjnh")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("nchrszizoyu", model.groupId()); - Assertions.assertEquals("yetnd", model.displayName()); - Assertions.assertEquals("qyggagfl", model.requiredMembers().get(0)); - Assertions.assertEquals("mqeq", model.requiredZoneNames().get(0)); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateLinkResourcesGetWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateLinkResourcesGetWithResponseMockTests.java deleted file mode 100644 index c52dbd209228..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateLinkResourcesGetWithResponseMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.PrivateLinkResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"groupId\":\"klajvcfocz\",\"displayName\":\"pejovt\",\"requiredMembers\":[\"nhwhhnoyrzaao\",\"e\"],\"requiredZoneNames\":[\"jenvjeateaxx\",\"rxoxdjxl\",\"n\"]},\"id\":\"yyi\",\"name\":\"kd\",\"type\":\"rndwdbvxvzaled\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PrivateLinkResource response = manager.privateLinkResources() - .getWithResponse("glqjoxtdahneaoov", "yjz", "ivfwjlofze", "fsr", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("yyi", response.id()); - Assertions.assertEquals("kd", response.name()); - Assertions.assertEquals("rndwdbvxvzaled", response.type()); - Assertions.assertEquals("klajvcfocz", response.groupId()); - Assertions.assertEquals("pejovt", response.displayName()); - Assertions.assertEquals("nhwhhnoyrzaao", response.requiredMembers().get(0)); - Assertions.assertEquals("jenvjeateaxx", response.requiredZoneNames().get(0)); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateLinkResourcesListByResourceMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateLinkResourcesListByResourceMockTests.java deleted file mode 100644 index 488099c5a9bd..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateLinkResourcesListByResourceMockTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.PrivateLinkResource; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesListByResourceMockTests { - @Test - public void testListByResource() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"groupId\":\"vznllaslkskhjqj\",\"displayName\":\"baihxjtgzg\",\"requiredMembers\":[\"ywbqgroigbsfsgs\",\"enwl\"],\"requiredZoneNames\":[\"hljqlxsp\",\"rjc\",\"ryldsxeb\"]},\"id\":\"sxrznmg\",\"name\":\"al\",\"type\":\"ckhefrb\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.privateLinkResources() - .listByResource("yqxlunkfthmcx", "qxmyzkl", "oanpohrvm", "rqra", 95301750, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("sxrznmg", response.iterator().next().id()); - Assertions.assertEquals("al", response.iterator().next().name()); - Assertions.assertEquals("ckhefrb", response.iterator().next().type()); - Assertions.assertEquals("vznllaslkskhjqj", response.iterator().next().groupId()); - Assertions.assertEquals("baihxjtgzg", response.iterator().next().displayName()); - Assertions.assertEquals("ywbqgroigbsfsgs", response.iterator().next().requiredMembers().get(0)); - Assertions.assertEquals("hljqlxsp", response.iterator().next().requiredZoneNames().get(0)); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateLinkResourcesListResultTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateLinkResourcesListResultTests.java deleted file mode 100644 index c0d87de5655a..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PrivateLinkResourcesListResultTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.eventgrid.models.PrivateLinkResourcesListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkResourcesListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourcesListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"ynfsvkhgbvqtan\",\"displayName\":\"fdlpukhpyr\",\"requiredMembers\":[\"zjcpeogk\",\"nmg\"],\"requiredZoneNames\":[\"uxddbhfh\",\"fpazjzoywjxhpd\",\"lontacnpq\",\"tehtuevrhrljyoog\"]},\"id\":\"hnsduugwbsreur\",\"name\":\"kfuarenlv\",\"type\":\"tklnvnafvvkyfed\"},{\"properties\":{\"groupId\":\"bo\",\"displayName\":\"cqxypokkhminq\",\"requiredMembers\":[\"czngnbdxxe\",\"unin\"],\"requiredZoneNames\":[\"bchaqd\"]},\"id\":\"qecrqctmxx\",\"name\":\"ddm\",\"type\":\"huytxzvtzn\"},{\"properties\":{\"groupId\":\"bannovvoxczytp\",\"displayName\":\"nwvroevytlyokrr\",\"requiredMembers\":[\"uxvnsasbcrymodi\",\"rxklobdxnazpmk\",\"lmv\"],\"requiredZoneNames\":[\"xzopjhbzxl\"]},\"id\":\"hrdd\",\"name\":\"fg\",\"type\":\"ba\"}],\"nextLink\":\"cbb\"}") - .toObject(PrivateLinkResourcesListResult.class); - Assertions.assertEquals("hnsduugwbsreur", model.value().get(0).id()); - Assertions.assertEquals("kfuarenlv", model.value().get(0).name()); - Assertions.assertEquals("tklnvnafvvkyfed", model.value().get(0).type()); - Assertions.assertEquals("ynfsvkhgbvqtan", model.value().get(0).groupId()); - Assertions.assertEquals("fdlpukhpyr", model.value().get(0).displayName()); - Assertions.assertEquals("zjcpeogk", model.value().get(0).requiredMembers().get(0)); - Assertions.assertEquals("uxddbhfh", model.value().get(0).requiredZoneNames().get(0)); - Assertions.assertEquals("cbb", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourcesListResult model = new PrivateLinkResourcesListResult().withValue(Arrays.asList( - new PrivateLinkResourceInner().withId("hnsduugwbsreur") - .withName("kfuarenlv") - .withType("tklnvnafvvkyfed") - .withGroupId("ynfsvkhgbvqtan") - .withDisplayName("fdlpukhpyr") - .withRequiredMembers(Arrays.asList("zjcpeogk", "nmg")) - .withRequiredZoneNames(Arrays.asList("uxddbhfh", "fpazjzoywjxhpd", "lontacnpq", "tehtuevrhrljyoog")), - new PrivateLinkResourceInner().withId("qecrqctmxx") - .withName("ddm") - .withType("huytxzvtzn") - .withGroupId("bo") - .withDisplayName("cqxypokkhminq") - .withRequiredMembers(Arrays.asList("czngnbdxxe", "unin")) - .withRequiredZoneNames(Arrays.asList("bchaqd")), - new PrivateLinkResourceInner().withId("hrdd") - .withName("fg") - .withType("ba") - .withGroupId("bannovvoxczytp") - .withDisplayName("nwvroevytlyokrr") - .withRequiredMembers(Arrays.asList("uxvnsasbcrymodi", "rxklobdxnazpmk", "lmv")) - .withRequiredZoneNames(Arrays.asList("xzopjhbzxl")))) - .withNextLink("cbb"); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourcesListResult.class); - Assertions.assertEquals("hnsduugwbsreur", model.value().get(0).id()); - Assertions.assertEquals("kfuarenlv", model.value().get(0).name()); - Assertions.assertEquals("tklnvnafvvkyfed", model.value().get(0).type()); - Assertions.assertEquals("ynfsvkhgbvqtan", model.value().get(0).groupId()); - Assertions.assertEquals("fdlpukhpyr", model.value().get(0).displayName()); - Assertions.assertEquals("zjcpeogk", model.value().get(0).requiredMembers().get(0)); - Assertions.assertEquals("uxddbhfh", model.value().get(0).requiredZoneNames().get(0)); - Assertions.assertEquals("cbb", model.nextLink()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PushInfoTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PushInfoTests.java deleted file mode 100644 index 018f0e7b13f5..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/PushInfoTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -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.EventSubscriptionDestination; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionIdentity; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionIdentityType; -import com.azure.resourcemanager.eventgrid.models.PushInfo; -import org.junit.jupiter.api.Assertions; - -public final class PushInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PushInfo model = BinaryData.fromString( - "{\"maxDeliveryCount\":1225314706,\"eventTimeToLive\":\"eqdcv\",\"deadLetterDestinationWithResourceIdentity\":{\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentity\":\"dsotbobzd\"},\"deadLetterDestination\":{\"endpointType\":\"DeadLetterDestination\"}},\"deliveryWithResourceIdentity\":{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"hdldwmgxcxrsl\"},\"destination\":{\"endpointType\":\"EventSubscriptionDestination\"}},\"destination\":{\"endpointType\":\"EventSubscriptionDestination\"}}") - .toObject(PushInfo.class); - Assertions.assertEquals(1225314706, model.maxDeliveryCount()); - Assertions.assertEquals("eqdcv", model.eventTimeToLive()); - Assertions.assertEquals(EventSubscriptionIdentityType.SYSTEM_ASSIGNED, - model.deadLetterDestinationWithResourceIdentity().identity().type()); - Assertions.assertEquals("dsotbobzd", - model.deadLetterDestinationWithResourceIdentity().identity().userAssignedIdentity()); - Assertions.assertEquals(EventSubscriptionIdentityType.USER_ASSIGNED, - model.deliveryWithResourceIdentity().identity().type()); - Assertions.assertEquals("hdldwmgxcxrsl", - model.deliveryWithResourceIdentity().identity().userAssignedIdentity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PushInfo model - = new PushInfo().withMaxDeliveryCount(1225314706) - .withEventTimeToLive("eqdcv") - .withDeadLetterDestinationWithResourceIdentity(new DeadLetterWithResourceIdentity() - .withIdentity( - new EventSubscriptionIdentity().withType(EventSubscriptionIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentity("dsotbobzd")) - .withDeadLetterDestination(new DeadLetterDestination())) - .withDeliveryWithResourceIdentity( - new DeliveryWithResourceIdentity() - .withIdentity( - new EventSubscriptionIdentity().withType(EventSubscriptionIdentityType.USER_ASSIGNED) - .withUserAssignedIdentity("hdldwmgxcxrsl")) - .withDestination(new EventSubscriptionDestination())) - .withDestination(new EventSubscriptionDestination()); - model = BinaryData.fromObject(model).toObject(PushInfo.class); - Assertions.assertEquals(1225314706, model.maxDeliveryCount()); - Assertions.assertEquals("eqdcv", model.eventTimeToLive()); - Assertions.assertEquals(EventSubscriptionIdentityType.SYSTEM_ASSIGNED, - model.deadLetterDestinationWithResourceIdentity().identity().type()); - Assertions.assertEquals("dsotbobzd", - model.deadLetterDestinationWithResourceIdentity().identity().userAssignedIdentity()); - Assertions.assertEquals(EventSubscriptionIdentityType.USER_ASSIGNED, - model.deliveryWithResourceIdentity().identity().type()); - Assertions.assertEquals("hdldwmgxcxrsl", - model.deliveryWithResourceIdentity().identity().userAssignedIdentity()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/QueueInfoTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/QueueInfoTests.java deleted file mode 100644 index 2d9f34adc092..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/QueueInfoTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.DeadLetterDestination; -import com.azure.resourcemanager.eventgrid.models.DeadLetterWithResourceIdentity; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionIdentity; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionIdentityType; -import com.azure.resourcemanager.eventgrid.models.QueueInfo; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class QueueInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QueueInfo model = BinaryData.fromString( - "{\"receiveLockDurationInSeconds\":1360002238,\"maxDeliveryCount\":749760843,\"deadLetterDestinationWithResourceIdentity\":{\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentity\":\"dlxyjrxs\"},\"deadLetterDestination\":{\"endpointType\":\"DeadLetterDestination\"}},\"eventTimeToLive\":\"PT82H11M42S\"}") - .toObject(QueueInfo.class); - Assertions.assertEquals(1360002238, model.receiveLockDurationInSeconds()); - Assertions.assertEquals(749760843, model.maxDeliveryCount()); - Assertions.assertEquals(EventSubscriptionIdentityType.SYSTEM_ASSIGNED, - model.deadLetterDestinationWithResourceIdentity().identity().type()); - Assertions.assertEquals("dlxyjrxs", - model.deadLetterDestinationWithResourceIdentity().identity().userAssignedIdentity()); - Assertions.assertEquals(Duration.parse("PT82H11M42S"), model.eventTimeToLive()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QueueInfo model - = new QueueInfo().withReceiveLockDurationInSeconds(1360002238) - .withMaxDeliveryCount(749760843) - .withDeadLetterDestinationWithResourceIdentity(new DeadLetterWithResourceIdentity() - .withIdentity( - new EventSubscriptionIdentity().withType(EventSubscriptionIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentity("dlxyjrxs")) - .withDeadLetterDestination(new DeadLetterDestination())) - .withEventTimeToLive(Duration.parse("PT82H11M42S")); - model = BinaryData.fromObject(model).toObject(QueueInfo.class); - Assertions.assertEquals(1360002238, model.receiveLockDurationInSeconds()); - Assertions.assertEquals(749760843, model.maxDeliveryCount()); - Assertions.assertEquals(EventSubscriptionIdentityType.SYSTEM_ASSIGNED, - model.deadLetterDestinationWithResourceIdentity().identity().type()); - Assertions.assertEquals("dlxyjrxs", - model.deadLetterDestinationWithResourceIdentity().identity().userAssignedIdentity()); - Assertions.assertEquals(Duration.parse("PT82H11M42S"), model.eventTimeToLive()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/RetryPolicyTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/RetryPolicyTests.java deleted file mode 100644 index ca3bd9aa847a..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/RetryPolicyTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.RetryPolicy; -import org.junit.jupiter.api.Assertions; - -public final class RetryPolicyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RetryPolicy model - = BinaryData.fromString("{\"maxDeliveryAttempts\":1026255480,\"eventTimeToLiveInMinutes\":443622503}") - .toObject(RetryPolicy.class); - Assertions.assertEquals(1026255480, model.maxDeliveryAttempts()); - Assertions.assertEquals(443622503, model.eventTimeToLiveInMinutes()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RetryPolicy model - = new RetryPolicy().withMaxDeliveryAttempts(1026255480).withEventTimeToLiveInMinutes(443622503); - model = BinaryData.fromObject(model).toObject(RetryPolicy.class); - Assertions.assertEquals(1026255480, model.maxDeliveryAttempts()); - Assertions.assertEquals(443622503, model.eventTimeToLiveInMinutes()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/RoutingIdentityInfoTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/RoutingIdentityInfoTests.java deleted file mode 100644 index 7c5bb0c2b09a..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/RoutingIdentityInfoTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.RoutingIdentityInfo; -import com.azure.resourcemanager.eventgrid.models.RoutingIdentityType; -import org.junit.jupiter.api.Assertions; - -public final class RoutingIdentityInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RoutingIdentityInfo model - = BinaryData.fromString("{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"nwoiind\"}") - .toObject(RoutingIdentityInfo.class); - Assertions.assertEquals(RoutingIdentityType.USER_ASSIGNED, model.type()); - Assertions.assertEquals("nwoiind", model.userAssignedIdentity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RoutingIdentityInfo model - = new RoutingIdentityInfo().withType(RoutingIdentityType.USER_ASSIGNED).withUserAssignedIdentity("nwoiind"); - model = BinaryData.fromObject(model).toObject(RoutingIdentityInfo.class); - Assertions.assertEquals(RoutingIdentityType.USER_ASSIGNED, model.type()); - Assertions.assertEquals("nwoiind", model.userAssignedIdentity()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ServiceBusQueueEventSubscriptionDestinationPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ServiceBusQueueEventSubscriptionDestinationPropertiesTests.java deleted file mode 100644 index 9ed0dad81219..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ServiceBusQueueEventSubscriptionDestinationPropertiesTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.ServiceBusQueueEventSubscriptionDestinationProperties; -import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeMapping; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServiceBusQueueEventSubscriptionDestinationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceBusQueueEventSubscriptionDestinationProperties model = BinaryData.fromString( - "{\"resourceId\":\"xk\",\"deliveryAttributeMappings\":[{\"type\":\"DeliveryAttributeMapping\",\"name\":\"rmmkyupiju\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"qjfkakfqfrkemyi\"}]}") - .toObject(ServiceBusQueueEventSubscriptionDestinationProperties.class); - Assertions.assertEquals("xk", model.resourceId()); - Assertions.assertEquals("rmmkyupiju", model.deliveryAttributeMappings().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceBusQueueEventSubscriptionDestinationProperties model - = new ServiceBusQueueEventSubscriptionDestinationProperties().withResourceId("xk") - .withDeliveryAttributeMappings(Arrays.asList(new DeliveryAttributeMapping().withName("rmmkyupiju"), - new DeliveryAttributeMapping().withName("qjfkakfqfrkemyi"))); - model = BinaryData.fromObject(model).toObject(ServiceBusQueueEventSubscriptionDestinationProperties.class); - Assertions.assertEquals("xk", model.resourceId()); - Assertions.assertEquals("rmmkyupiju", model.deliveryAttributeMappings().get(0).name()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ServiceBusQueueEventSubscriptionDestinationTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ServiceBusQueueEventSubscriptionDestinationTests.java deleted file mode 100644 index 265c8f292c0d..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ServiceBusQueueEventSubscriptionDestinationTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeMapping; -import com.azure.resourcemanager.eventgrid.models.ServiceBusQueueEventSubscriptionDestination; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServiceBusQueueEventSubscriptionDestinationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceBusQueueEventSubscriptionDestination model = BinaryData.fromString( - "{\"endpointType\":\"ServiceBusQueue\",\"properties\":{\"resourceId\":\"dxjascowvfdj\",\"deliveryAttributeMappings\":[{\"type\":\"DeliveryAttributeMapping\",\"name\":\"phlkksnm\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"vyfijdkzuqnw\"}]}}") - .toObject(ServiceBusQueueEventSubscriptionDestination.class); - Assertions.assertEquals("dxjascowvfdj", model.resourceId()); - Assertions.assertEquals("phlkksnm", model.deliveryAttributeMappings().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceBusQueueEventSubscriptionDestination model - = new ServiceBusQueueEventSubscriptionDestination().withResourceId("dxjascowvfdj") - .withDeliveryAttributeMappings(Arrays.asList(new DeliveryAttributeMapping().withName("phlkksnm"), - new DeliveryAttributeMapping().withName("vyfijdkzuqnw"))); - model = BinaryData.fromObject(model).toObject(ServiceBusQueueEventSubscriptionDestination.class); - Assertions.assertEquals("dxjascowvfdj", model.resourceId()); - Assertions.assertEquals("phlkksnm", model.deliveryAttributeMappings().get(0).name()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ServiceBusTopicEventSubscriptionDestinationPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ServiceBusTopicEventSubscriptionDestinationPropertiesTests.java deleted file mode 100644 index fef90c21c5c3..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ServiceBusTopicEventSubscriptionDestinationPropertiesTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.ServiceBusTopicEventSubscriptionDestinationProperties; -import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeMapping; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServiceBusTopicEventSubscriptionDestinationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceBusTopicEventSubscriptionDestinationProperties model = BinaryData.fromString( - "{\"resourceId\":\"thuqolyahluq\",\"deliveryAttributeMappings\":[{\"type\":\"DeliveryAttributeMapping\",\"name\":\"sutrjbhxykfhyqe\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"qqug\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"ftbcvexreuquow\"}]}") - .toObject(ServiceBusTopicEventSubscriptionDestinationProperties.class); - Assertions.assertEquals("thuqolyahluq", model.resourceId()); - Assertions.assertEquals("sutrjbhxykfhyqe", model.deliveryAttributeMappings().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceBusTopicEventSubscriptionDestinationProperties model - = new ServiceBusTopicEventSubscriptionDestinationProperties().withResourceId("thuqolyahluq") - .withDeliveryAttributeMappings(Arrays.asList(new DeliveryAttributeMapping().withName("sutrjbhxykfhyqe"), - new DeliveryAttributeMapping().withName("qqug"), - new DeliveryAttributeMapping().withName("ftbcvexreuquow"))); - model = BinaryData.fromObject(model).toObject(ServiceBusTopicEventSubscriptionDestinationProperties.class); - Assertions.assertEquals("thuqolyahluq", model.resourceId()); - Assertions.assertEquals("sutrjbhxykfhyqe", model.deliveryAttributeMappings().get(0).name()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ServiceBusTopicEventSubscriptionDestinationTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ServiceBusTopicEventSubscriptionDestinationTests.java deleted file mode 100644 index 5331264d60d5..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/ServiceBusTopicEventSubscriptionDestinationTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeMapping; -import com.azure.resourcemanager.eventgrid.models.ServiceBusTopicEventSubscriptionDestination; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServiceBusTopicEventSubscriptionDestinationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceBusTopicEventSubscriptionDestination model = BinaryData.fromString( - "{\"endpointType\":\"ServiceBusTopic\",\"properties\":{\"resourceId\":\"vfwhreagkhyxv\",\"deliveryAttributeMappings\":[{\"type\":\"DeliveryAttributeMapping\",\"name\":\"bczsulmdgglmepjp\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"eykgsangpszngaf\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"ylkvecjuj\"}]}}") - .toObject(ServiceBusTopicEventSubscriptionDestination.class); - Assertions.assertEquals("vfwhreagkhyxv", model.resourceId()); - Assertions.assertEquals("bczsulmdgglmepjp", model.deliveryAttributeMappings().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceBusTopicEventSubscriptionDestination model = new ServiceBusTopicEventSubscriptionDestination() - .withResourceId("vfwhreagkhyxv") - .withDeliveryAttributeMappings(Arrays.asList(new DeliveryAttributeMapping().withName("bczsulmdgglmepjp"), - new DeliveryAttributeMapping().withName("eykgsangpszngaf"), - new DeliveryAttributeMapping().withName("ylkvecjuj"))); - model = BinaryData.fromObject(model).toObject(ServiceBusTopicEventSubscriptionDestination.class); - Assertions.assertEquals("vfwhreagkhyxv", model.resourceId()); - Assertions.assertEquals("bczsulmdgglmepjp", model.deliveryAttributeMappings().get(0).name()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/StorageBlobDeadLetterDestinationPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/StorageBlobDeadLetterDestinationPropertiesTests.java deleted file mode 100644 index 148e673e6ef6..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/StorageBlobDeadLetterDestinationPropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.StorageBlobDeadLetterDestinationProperties; -import org.junit.jupiter.api.Assertions; - -public final class StorageBlobDeadLetterDestinationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageBlobDeadLetterDestinationProperties model - = BinaryData.fromString("{\"resourceId\":\"tcdxabbujftaben\",\"blobContainerName\":\"klqpx\"}") - .toObject(StorageBlobDeadLetterDestinationProperties.class); - Assertions.assertEquals("tcdxabbujftaben", model.resourceId()); - Assertions.assertEquals("klqpx", model.blobContainerName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageBlobDeadLetterDestinationProperties model - = new StorageBlobDeadLetterDestinationProperties().withResourceId("tcdxabbujftaben") - .withBlobContainerName("klqpx"); - model = BinaryData.fromObject(model).toObject(StorageBlobDeadLetterDestinationProperties.class); - Assertions.assertEquals("tcdxabbujftaben", model.resourceId()); - Assertions.assertEquals("klqpx", model.blobContainerName()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/StorageBlobDeadLetterDestinationTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/StorageBlobDeadLetterDestinationTests.java deleted file mode 100644 index 0f36e8ad149f..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/StorageBlobDeadLetterDestinationTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.StorageBlobDeadLetterDestination; -import org.junit.jupiter.api.Assertions; - -public final class StorageBlobDeadLetterDestinationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageBlobDeadLetterDestination model = BinaryData.fromString( - "{\"endpointType\":\"StorageBlob\",\"properties\":{\"resourceId\":\"w\",\"blobContainerName\":\"kvb\"}}") - .toObject(StorageBlobDeadLetterDestination.class); - Assertions.assertEquals("w", model.resourceId()); - Assertions.assertEquals("kvb", model.blobContainerName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageBlobDeadLetterDestination model - = new StorageBlobDeadLetterDestination().withResourceId("w").withBlobContainerName("kvb"); - model = BinaryData.fromObject(model).toObject(StorageBlobDeadLetterDestination.class); - Assertions.assertEquals("w", model.resourceId()); - Assertions.assertEquals("kvb", model.blobContainerName()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/StorageQueueEventSubscriptionDestinationPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/StorageQueueEventSubscriptionDestinationPropertiesTests.java deleted file mode 100644 index b983c588f6ca..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/StorageQueueEventSubscriptionDestinationPropertiesTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.StorageQueueEventSubscriptionDestinationProperties; -import org.junit.jupiter.api.Assertions; - -public final class StorageQueueEventSubscriptionDestinationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageQueueEventSubscriptionDestinationProperties model = BinaryData.fromString( - "{\"resourceId\":\"az\",\"queueName\":\"mtggmu\",\"queueMessageTimeToLiveInSeconds\":1948579345841432177}") - .toObject(StorageQueueEventSubscriptionDestinationProperties.class); - Assertions.assertEquals("az", model.resourceId()); - Assertions.assertEquals("mtggmu", model.queueName()); - Assertions.assertEquals(1948579345841432177L, model.queueMessageTimeToLiveInSeconds()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageQueueEventSubscriptionDestinationProperties model - = new StorageQueueEventSubscriptionDestinationProperties().withResourceId("az") - .withQueueName("mtggmu") - .withQueueMessageTimeToLiveInSeconds(1948579345841432177L); - model = BinaryData.fromObject(model).toObject(StorageQueueEventSubscriptionDestinationProperties.class); - Assertions.assertEquals("az", model.resourceId()); - Assertions.assertEquals("mtggmu", model.queueName()); - Assertions.assertEquals(1948579345841432177L, model.queueMessageTimeToLiveInSeconds()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/StorageQueueEventSubscriptionDestinationTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/StorageQueueEventSubscriptionDestinationTests.java deleted file mode 100644 index ef23f80fa7fe..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/StorageQueueEventSubscriptionDestinationTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.StorageQueueEventSubscriptionDestination; -import org.junit.jupiter.api.Assertions; - -public final class StorageQueueEventSubscriptionDestinationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageQueueEventSubscriptionDestination model = BinaryData.fromString( - "{\"endpointType\":\"StorageQueue\",\"properties\":{\"resourceId\":\"fnkf\",\"queueName\":\"lv\",\"queueMessageTimeToLiveInSeconds\":573222547469009901}}") - .toObject(StorageQueueEventSubscriptionDestination.class); - Assertions.assertEquals("fnkf", model.resourceId()); - Assertions.assertEquals("lv", model.queueName()); - Assertions.assertEquals(573222547469009901L, model.queueMessageTimeToLiveInSeconds()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageQueueEventSubscriptionDestination model - = new StorageQueueEventSubscriptionDestination().withResourceId("fnkf") - .withQueueName("lv") - .withQueueMessageTimeToLiveInSeconds(573222547469009901L); - model = BinaryData.fromObject(model).toObject(StorageQueueEventSubscriptionDestination.class); - Assertions.assertEquals("fnkf", model.resourceId()); - Assertions.assertEquals("lv", model.queueName()); - Assertions.assertEquals(573222547469009901L, model.queueMessageTimeToLiveInSeconds()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SubscriptionFullUrlInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SubscriptionFullUrlInnerTests.java deleted file mode 100644 index 3ec771d11d19..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SubscriptionFullUrlInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.SubscriptionFullUrlInner; -import org.junit.jupiter.api.Assertions; - -public final class SubscriptionFullUrlInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SubscriptionFullUrlInner model - = BinaryData.fromString("{\"endpointUrl\":\"mbltoo\"}").toObject(SubscriptionFullUrlInner.class); - Assertions.assertEquals("mbltoo", model.endpointUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SubscriptionFullUrlInner model = new SubscriptionFullUrlInner().withEndpointUrl("mbltoo"); - model = BinaryData.fromObject(model).toObject(SubscriptionFullUrlInner.class); - Assertions.assertEquals("mbltoo", model.endpointUrl()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SubscriptionsListResultTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SubscriptionsListResultTests.java deleted file mode 100644 index c851b6a7a208..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SubscriptionsListResultTests.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.SubscriptionInner; -import com.azure.resourcemanager.eventgrid.models.DeadLetterWithResourceIdentity; -import com.azure.resourcemanager.eventgrid.models.DeliveryConfiguration; -import com.azure.resourcemanager.eventgrid.models.DeliveryMode; -import com.azure.resourcemanager.eventgrid.models.DeliverySchema; -import com.azure.resourcemanager.eventgrid.models.DeliveryWithResourceIdentity; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionDestination; -import com.azure.resourcemanager.eventgrid.models.Filter; -import com.azure.resourcemanager.eventgrid.models.FiltersConfiguration; -import com.azure.resourcemanager.eventgrid.models.PushInfo; -import com.azure.resourcemanager.eventgrid.models.QueueInfo; -import com.azure.resourcemanager.eventgrid.models.SubscriptionsListResult; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SubscriptionsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SubscriptionsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"AwaitingManualAction\",\"deliveryConfiguration\":{\"deliveryMode\":\"Push\",\"queue\":{\"receiveLockDurationInSeconds\":1095331396,\"maxDeliveryCount\":361598801,\"deadLetterDestinationWithResourceIdentity\":{},\"eventTimeToLive\":\"PT231H48M36S\"},\"push\":{\"maxDeliveryCount\":1312962595,\"eventTimeToLive\":\"lp\",\"deadLetterDestinationWithResourceIdentity\":{},\"deliveryWithResourceIdentity\":{},\"destination\":{\"endpointType\":\"EventSubscriptionDestination\"}}},\"eventDeliverySchema\":\"CloudEventSchemaV1_0\",\"filtersConfiguration\":{\"includedEventTypes\":[\"dbutauvfbtkuwhh\",\"hykojoxafnndlpic\",\"koymkcd\"],\"filters\":[{\"operatorType\":\"Filter\"},{\"operatorType\":\"Filter\"},{\"operatorType\":\"Filter\"}]},\"expirationTimeUtc\":\"2021-05-25T06:23:15Z\"},\"id\":\"pwdreqnovvqf\",\"name\":\"vljxywsu\",\"type\":\"syrsndsytgadgvra\"}],\"nextLink\":\"en\"}") - .toObject(SubscriptionsListResult.class); - Assertions.assertEquals(DeliveryMode.PUSH, model.value().get(0).deliveryConfiguration().deliveryMode()); - Assertions.assertEquals(1095331396, - model.value().get(0).deliveryConfiguration().queue().receiveLockDurationInSeconds()); - Assertions.assertEquals(361598801, model.value().get(0).deliveryConfiguration().queue().maxDeliveryCount()); - Assertions.assertEquals(Duration.parse("PT231H48M36S"), - model.value().get(0).deliveryConfiguration().queue().eventTimeToLive()); - Assertions.assertEquals(1312962595, model.value().get(0).deliveryConfiguration().push().maxDeliveryCount()); - Assertions.assertEquals("lp", model.value().get(0).deliveryConfiguration().push().eventTimeToLive()); - Assertions.assertEquals(DeliverySchema.CLOUD_EVENT_SCHEMA_V1_0, model.value().get(0).eventDeliverySchema()); - Assertions.assertEquals("dbutauvfbtkuwhh", - model.value().get(0).filtersConfiguration().includedEventTypes().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-25T06:23:15Z"), model.value().get(0).expirationTimeUtc()); - Assertions.assertEquals("en", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SubscriptionsListResult model - = new SubscriptionsListResult() - .withValue( - Arrays - .asList( - new SubscriptionInner() - .withDeliveryConfiguration( - new DeliveryConfiguration().withDeliveryMode(DeliveryMode.PUSH) - .withQueue(new QueueInfo().withReceiveLockDurationInSeconds(1095331396) - .withMaxDeliveryCount(361598801) - .withDeadLetterDestinationWithResourceIdentity( - new DeadLetterWithResourceIdentity()) - .withEventTimeToLive(Duration.parse("PT231H48M36S"))) - .withPush(new PushInfo().withMaxDeliveryCount(1312962595) - .withEventTimeToLive("lp") - .withDeadLetterDestinationWithResourceIdentity( - new DeadLetterWithResourceIdentity()) - .withDeliveryWithResourceIdentity(new DeliveryWithResourceIdentity()) - .withDestination(new EventSubscriptionDestination()))) - .withEventDeliverySchema(DeliverySchema.CLOUD_EVENT_SCHEMA_V1_0) - .withFiltersConfiguration(new FiltersConfiguration() - .withIncludedEventTypes( - Arrays.asList("dbutauvfbtkuwhh", "hykojoxafnndlpic", "koymkcd")) - .withFilters(Arrays.asList(new Filter(), new Filter(), new Filter()))) - .withExpirationTimeUtc(OffsetDateTime.parse("2021-05-25T06:23:15Z")))) - .withNextLink("en"); - model = BinaryData.fromObject(model).toObject(SubscriptionsListResult.class); - Assertions.assertEquals(DeliveryMode.PUSH, model.value().get(0).deliveryConfiguration().deliveryMode()); - Assertions.assertEquals(1095331396, - model.value().get(0).deliveryConfiguration().queue().receiveLockDurationInSeconds()); - Assertions.assertEquals(361598801, model.value().get(0).deliveryConfiguration().queue().maxDeliveryCount()); - Assertions.assertEquals(Duration.parse("PT231H48M36S"), - model.value().get(0).deliveryConfiguration().queue().eventTimeToLive()); - Assertions.assertEquals(1312962595, model.value().get(0).deliveryConfiguration().push().maxDeliveryCount()); - Assertions.assertEquals("lp", model.value().get(0).deliveryConfiguration().push().eventTimeToLive()); - Assertions.assertEquals(DeliverySchema.CLOUD_EVENT_SCHEMA_V1_0, model.value().get(0).eventDeliverySchema()); - Assertions.assertEquals("dbutauvfbtkuwhh", - model.value().get(0).filtersConfiguration().includedEventTypes().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-25T06:23:15Z"), model.value().get(0).expirationTimeUtc()); - Assertions.assertEquals("en", model.nextLink()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicEventSubscriptionsDeleteMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicEventSubscriptionsDeleteMockTests.java deleted file mode 100644 index 2a55806b72aa..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicEventSubscriptionsDeleteMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SystemTopicEventSubscriptionsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.systemTopicEventSubscriptions() - .delete("jfncjwvuagfqw", "ltngvmreupt", "klzmijajw", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicEventSubscriptionsGetDeliveryAttributesWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicEventSubscriptionsGetDeliveryAttributesWithResponseMockTests.java deleted file mode 100644 index b8afd68e155e..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicEventSubscriptionsGetDeliveryAttributesWithResponseMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeListResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SystemTopicEventSubscriptionsGetDeliveryAttributesWithResponseMockTests { - @Test - public void testGetDeliveryAttributesWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"type\":\"DeliveryAttributeMapping\",\"name\":\"wgiksbbvtoo\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"p\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"wp\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"hgjtnhtukfaci\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - DeliveryAttributeListResult response = manager.systemTopicEventSubscriptions() - .getDeliveryAttributesWithResponse("zfbmjxuv", "ipfdvhaxdvwzaehp", "hthdklmvetatlakf", - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("wgiksbbvtoo", response.value().get(0).name()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicEventSubscriptionsGetFullUrlWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicEventSubscriptionsGetFullUrlWithResponseMockTests.java deleted file mode 100644 index 41b682dcdf04..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicEventSubscriptionsGetFullUrlWithResponseMockTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFullUrl; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SystemTopicEventSubscriptionsGetFullUrlWithResponseMockTests { - @Test - public void testGetFullUrlWithResponse() throws Exception { - String responseStr = "{\"endpointUrl\":\"qlapsnsso\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - EventSubscriptionFullUrl response = manager.systemTopicEventSubscriptions() - .getFullUrlWithResponse("l", "fsvagh", "pynwlslrcigtzjcv", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("qlapsnsso", response.endpointUrl()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicInnerTests.java deleted file mode 100644 index 72e4744d3911..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicInnerTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.SystemTopicInner; -import com.azure.resourcemanager.eventgrid.models.IdentityInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.UserIdentityProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SystemTopicInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SystemTopicInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Creating\",\"source\":\"knapq\",\"topicType\":\"yuicdhzbdy\",\"metricResourceId\":\"wgbdvibidmhmwffp\"},\"identity\":{\"type\":\"SystemAssigned, UserAssigned\",\"principalId\":\"pckc\",\"tenantId\":\"rv\",\"userAssignedIdentities\":{\"haim\":{\"principalId\":\"xoy\",\"clientId\":\"k\"},\"apyyrmfsvbpavbo\":{\"principalId\":\"iroqbosh\",\"clientId\":\"a\"}}},\"location\":\"fppdbwnu\",\"tags\":{\"pugmehqe\":\"hxkumasjcaacfdmm\",\"nlbqnbldxeaclg\":\"vufhbzehewhoq\"},\"id\":\"chorimkrsr\",\"name\":\"moucsofldpuviyfc\",\"type\":\"abeolhbhlvbm\"}") - .toObject(SystemTopicInner.class); - Assertions.assertEquals("fppdbwnu", model.location()); - Assertions.assertEquals("hxkumasjcaacfdmm", model.tags().get("pugmehqe")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("pckc", model.identity().principalId()); - Assertions.assertEquals("rv", model.identity().tenantId()); - Assertions.assertEquals("xoy", model.identity().userAssignedIdentities().get("haim").principalId()); - Assertions.assertEquals("k", model.identity().userAssignedIdentities().get("haim").clientId()); - Assertions.assertEquals("knapq", model.source()); - Assertions.assertEquals("yuicdhzbdy", model.topicType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SystemTopicInner model - = new SystemTopicInner().withLocation("fppdbwnu") - .withTags(mapOf("pugmehqe", "hxkumasjcaacfdmm", "nlbqnbldxeaclg", "vufhbzehewhoq")) - .withIdentity(new IdentityInfo().withType(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withPrincipalId("pckc") - .withTenantId("rv") - .withUserAssignedIdentities(mapOf("haim", - new UserIdentityProperties().withPrincipalId("xoy").withClientId("k"), "apyyrmfsvbpavbo", - new UserIdentityProperties().withPrincipalId("iroqbosh").withClientId("a")))) - .withSource("knapq") - .withTopicType("yuicdhzbdy"); - model = BinaryData.fromObject(model).toObject(SystemTopicInner.class); - Assertions.assertEquals("fppdbwnu", model.location()); - Assertions.assertEquals("hxkumasjcaacfdmm", model.tags().get("pugmehqe")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("pckc", model.identity().principalId()); - Assertions.assertEquals("rv", model.identity().tenantId()); - Assertions.assertEquals("xoy", model.identity().userAssignedIdentities().get("haim").principalId()); - Assertions.assertEquals("k", model.identity().userAssignedIdentities().get("haim").clientId()); - Assertions.assertEquals("knapq", model.source()); - Assertions.assertEquals("yuicdhzbdy", model.topicType()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicPropertiesTests.java deleted file mode 100644 index 826f52b77764..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicPropertiesTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.SystemTopicProperties; -import org.junit.jupiter.api.Assertions; - -public final class SystemTopicPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SystemTopicProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Canceled\",\"source\":\"bsxtkcudfbsfarfs\",\"topicType\":\"wlkjxn\",\"metricResourceId\":\"vwgf\"}") - .toObject(SystemTopicProperties.class); - Assertions.assertEquals("bsxtkcudfbsfarfs", model.source()); - Assertions.assertEquals("wlkjxn", model.topicType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SystemTopicProperties model - = new SystemTopicProperties().withSource("bsxtkcudfbsfarfs").withTopicType("wlkjxn"); - model = BinaryData.fromObject(model).toObject(SystemTopicProperties.class); - Assertions.assertEquals("bsxtkcudfbsfarfs", model.source()); - Assertions.assertEquals("wlkjxn", model.topicType()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicUpdateParametersTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicUpdateParametersTests.java deleted file mode 100644 index 0a2e70c99413..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicUpdateParametersTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.IdentityInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.SystemTopicUpdateParameters; -import com.azure.resourcemanager.eventgrid.models.UserIdentityProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SystemTopicUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SystemTopicUpdateParameters model = BinaryData.fromString( - "{\"tags\":{\"aoaf\":\"hqykizmdk\",\"gc\":\"luqvoxmycjimryv\",\"hecbvopwndyq\":\"wpbmzgwesydsxwef\"},\"identity\":{\"type\":\"SystemAssigned\",\"principalId\":\"klmtkhlowkx\",\"tenantId\":\"vbrdfjmzsyzfho\",\"userAssignedIdentities\":{\"vuicp\":{\"principalId\":\"k\",\"clientId\":\"ychunsjlpjrtwszh\"}}}}") - .toObject(SystemTopicUpdateParameters.class); - Assertions.assertEquals("hqykizmdk", model.tags().get("aoaf")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("klmtkhlowkx", model.identity().principalId()); - Assertions.assertEquals("vbrdfjmzsyzfho", model.identity().tenantId()); - Assertions.assertEquals("k", model.identity().userAssignedIdentities().get("vuicp").principalId()); - Assertions.assertEquals("ychunsjlpjrtwszh", model.identity().userAssignedIdentities().get("vuicp").clientId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SystemTopicUpdateParameters model = new SystemTopicUpdateParameters() - .withTags(mapOf("aoaf", "hqykizmdk", "gc", "luqvoxmycjimryv", "hecbvopwndyq", "wpbmzgwesydsxwef")) - .withIdentity(new IdentityInfo().withType(IdentityType.SYSTEM_ASSIGNED) - .withPrincipalId("klmtkhlowkx") - .withTenantId("vbrdfjmzsyzfho") - .withUserAssignedIdentities(mapOf("vuicp", - new UserIdentityProperties().withPrincipalId("k").withClientId("ychunsjlpjrtwszh")))); - model = BinaryData.fromObject(model).toObject(SystemTopicUpdateParameters.class); - Assertions.assertEquals("hqykizmdk", model.tags().get("aoaf")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("klmtkhlowkx", model.identity().principalId()); - Assertions.assertEquals("vbrdfjmzsyzfho", model.identity().tenantId()); - Assertions.assertEquals("k", model.identity().userAssignedIdentities().get("vuicp").principalId()); - Assertions.assertEquals("ychunsjlpjrtwszh", model.identity().userAssignedIdentities().get("vuicp").clientId()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicsCreateOrUpdateMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicsCreateOrUpdateMockTests.java deleted file mode 100644 index d88b959b01ce..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.IdentityInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.SystemTopic; -import com.azure.resourcemanager.eventgrid.models.UserIdentityProperties; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SystemTopicsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"source\":\"ifgufyjfdkqiyv\",\"topicType\":\"jokgwesymzqh\",\"metricResourceId\":\"p\"},\"identity\":{\"type\":\"UserAssigned\",\"principalId\":\"tznxlu\",\"tenantId\":\"ujqbbgsimwejl\",\"userAssignedIdentities\":{\"dtnaczkf\":{\"principalId\":\"pjzobdwbcpr\",\"clientId\":\"wkuh\"},\"goqb\":{\"principalId\":\"atgawphnsk\",\"clientId\":\"dwgtqcumecsaa\"},\"hzhrbkhtm\":{\"principalId\":\"uy\",\"clientId\":\"bskowkr\"},\"druozk\":{\"principalId\":\"wiuasfg\",\"clientId\":\"ucyhfaimq\"}}},\"location\":\"yfpeoehgfmqmsk\",\"tags\":{\"lhpevasyntvzjyie\":\"vlzjx\",\"nmpecqxgiqasifub\":\"bqrvvbqv\",\"wqpjnxjkhtupsvy\":\"snstl\",\"fwkztsms\":\"uweuiy\"},\"id\":\"b\",\"name\":\"vy\",\"type\":\"lznfhkqytkztado\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - SystemTopic response = manager.systemTopics() - .define("zltkaszfj") - .withRegion("xgzxlermkmer") - .withExistingResourceGroup("lweeprne") - .withTags(mapOf("upkcbkfukdljqnvt", "kirhn", "afyalo", "dydshk")) - .withIdentity(new IdentityInfo().withType(IdentityType.SYSTEM_ASSIGNED) - .withPrincipalId("dfedsb") - .withTenantId("ancoinmphymcqid") - .withUserAssignedIdentities(mapOf("ihaouwudhua", - new UserIdentityProperties().withPrincipalId("dhqnufbxweiib").withClientId("ojovfnybydh"), - "ejcvjkjyczcmta", - new UserIdentityProperties().withPrincipalId("hjkehwvumosqir").withClientId("mqprlobru"), - "rcjkjymgqbgcxhn", - new UserIdentityProperties().withPrincipalId("lajdyoljeqyxq").withClientId("zsizzhra")))) - .withSource("dux") - .withTopicType("grcqebmvrdj") - .create(); - - Assertions.assertEquals("yfpeoehgfmqmsk", response.location()); - Assertions.assertEquals("vlzjx", response.tags().get("lhpevasyntvzjyie")); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("tznxlu", response.identity().principalId()); - Assertions.assertEquals("ujqbbgsimwejl", response.identity().tenantId()); - Assertions.assertEquals("pjzobdwbcpr", - response.identity().userAssignedIdentities().get("dtnaczkf").principalId()); - Assertions.assertEquals("wkuh", response.identity().userAssignedIdentities().get("dtnaczkf").clientId()); - Assertions.assertEquals("ifgufyjfdkqiyv", response.source()); - Assertions.assertEquals("jokgwesymzqh", response.topicType()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicsDeleteMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicsDeleteMockTests.java deleted file mode 100644 index 6d3c39599b11..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SystemTopicsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.systemTopics().delete("idzlvssqywjopa", "kyhydvikmf", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicsGetByResourceGroupWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index db2e61b713ad..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.SystemTopic; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SystemTopicsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Canceled\",\"source\":\"tujraxdtpryjm\",\"topicType\":\"nsewouxl\",\"metricResourceId\":\"s\"},\"identity\":{\"type\":\"None\",\"principalId\":\"rkepos\",\"tenantId\":\"qqylmpctwjwds\",\"userAssignedIdentities\":{\"owgomvvhxowp\":{\"principalId\":\"kxerxxx\",\"clientId\":\"eehk\"}}},\"location\":\"bap\",\"tags\":{\"wbmpspfeylqloc\":\"raq\"},\"id\":\"vujex\",\"name\":\"yglxrkgjnm\",\"type\":\"paslavxjfiuofpi\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - SystemTopic response = manager.systemTopics() - .getByResourceGroupWithResponse("s", "uerbgpxebjl", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("bap", response.location()); - Assertions.assertEquals("raq", response.tags().get("wbmpspfeylqloc")); - Assertions.assertEquals(IdentityType.NONE, response.identity().type()); - Assertions.assertEquals("rkepos", response.identity().principalId()); - Assertions.assertEquals("qqylmpctwjwds", response.identity().tenantId()); - Assertions.assertEquals("kxerxxx", - response.identity().userAssignedIdentities().get("owgomvvhxowp").principalId()); - Assertions.assertEquals("eehk", response.identity().userAssignedIdentities().get("owgomvvhxowp").clientId()); - Assertions.assertEquals("tujraxdtpryjm", response.source()); - Assertions.assertEquals("nsewouxl", response.topicType()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicsListByResourceGroupMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicsListByResourceGroupMockTests.java deleted file mode 100644 index 802a62b15f39..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicsListByResourceGroupMockTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.SystemTopic; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SystemTopicsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Creating\",\"source\":\"bctvbpzuj\",\"topicType\":\"totdxposcslh\",\"metricResourceId\":\"usiecktybhjuxid\"},\"identity\":{\"type\":\"UserAssigned\",\"principalId\":\"lddxjxdugxwjwilm\",\"tenantId\":\"sl\",\"userAssignedIdentities\":{\"qwlxrhg\":{\"principalId\":\"p\",\"clientId\":\"ujjzgxq\"},\"mkorvvmv\":{\"principalId\":\"hvtqqykbkk\",\"clientId\":\"ozejo\"},\"yalhtgm\":{\"principalId\":\"ofnqhlbs\",\"clientId\":\"snqliwkmzojfe\"},\"crcmmaixp\":{\"principalId\":\"azg\",\"clientId\":\"bhrpgiqsttc\"}}},\"location\":\"jiwifhbksldttoh\",\"tags\":{\"tpmglxkoikmtr\":\"naihtgsiqikvllr\"},\"id\":\"wrqkza\",\"name\":\"bun\",\"type\":\"paklw\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.systemTopics() - .listByResourceGroup("ekwuyckyvn", "nsm", 758363440, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("jiwifhbksldttoh", response.iterator().next().location()); - Assertions.assertEquals("naihtgsiqikvllr", response.iterator().next().tags().get("tpmglxkoikmtr")); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("lddxjxdugxwjwilm", response.iterator().next().identity().principalId()); - Assertions.assertEquals("sl", response.iterator().next().identity().tenantId()); - Assertions.assertEquals("p", - response.iterator().next().identity().userAssignedIdentities().get("qwlxrhg").principalId()); - Assertions.assertEquals("ujjzgxq", - response.iterator().next().identity().userAssignedIdentities().get("qwlxrhg").clientId()); - Assertions.assertEquals("bctvbpzuj", response.iterator().next().source()); - Assertions.assertEquals("totdxposcslh", response.iterator().next().topicType()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicsListMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicsListMockTests.java deleted file mode 100644 index 8ce3cfdd3e99..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicsListMockTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.SystemTopic; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SystemTopicsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"source\":\"oriobijei\",\"topicType\":\"yeuynhbokay\",\"metricResourceId\":\"wybriopdwe\"},\"identity\":{\"type\":\"None\",\"principalId\":\"w\",\"tenantId\":\"gsioc\",\"userAssignedIdentities\":{\"tfjxtvlx\":{\"principalId\":\"vjanx\",\"clientId\":\"fffhtjnwos\"}}},\"location\":\"zqfcwrriomxee\",\"tags\":{\"egmxdbsohc\":\"hjmbji\"},\"id\":\"hpyvdkgdet\",\"name\":\"z\",\"type\":\"canzb\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response - = manager.systemTopics().list("gpmillxgjs", 2123049533, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("zqfcwrriomxee", response.iterator().next().location()); - Assertions.assertEquals("hjmbji", response.iterator().next().tags().get("egmxdbsohc")); - Assertions.assertEquals(IdentityType.NONE, response.iterator().next().identity().type()); - Assertions.assertEquals("w", response.iterator().next().identity().principalId()); - Assertions.assertEquals("gsioc", response.iterator().next().identity().tenantId()); - Assertions.assertEquals("vjanx", - response.iterator().next().identity().userAssignedIdentities().get("tfjxtvlx").principalId()); - Assertions.assertEquals("fffhtjnwos", - response.iterator().next().identity().userAssignedIdentities().get("tfjxtvlx").clientId()); - Assertions.assertEquals("oriobijei", response.iterator().next().source()); - Assertions.assertEquals("yeuynhbokay", response.iterator().next().topicType()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicsListResultTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicsListResultTests.java deleted file mode 100644 index 927027f1f5b5..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/SystemTopicsListResultTests.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.SystemTopicInner; -import com.azure.resourcemanager.eventgrid.models.IdentityInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.SystemTopicsListResult; -import com.azure.resourcemanager.eventgrid.models.UserIdentityProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SystemTopicsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SystemTopicsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"source\":\"wrbfdpyflubh\",\"topicType\":\"glrocuy\",\"metricResourceId\":\"whhmemhooc\"},\"identity\":{\"type\":\"SystemAssigned\",\"principalId\":\"memczjkmmyk\",\"tenantId\":\"jxsglhsr\",\"userAssignedIdentities\":{\"wlpxuzzjg\":{\"principalId\":\"jylmbkzudnigr\",\"clientId\":\"hotj\"},\"rkwpzdqtvhcspod\":{\"principalId\":\"efqyhqotoihiqaky\",\"clientId\":\"wf\"},\"dlpnfpubn\":{\"principalId\":\"axsipietgb\",\"clientId\":\"jfulbmoic\"},\"attcju\":{\"principalId\":\"batzviqsows\",\"clientId\":\"el\"}}},\"location\":\"plrvkmjcwmjvlg\",\"tags\":{\"sfxsf\":\"cvkyylizrzbj\",\"ukoveofi\":\"ztlvtmvagbwidqlv\"},\"id\":\"rvjfnmjmvlw\",\"name\":\"z\",\"type\":\"iblkujr\"},{\"properties\":{\"provisioningState\":\"Updating\",\"source\":\"uidjpuuyjucej\",\"topicType\":\"zoeovvtzejet\",\"metricResourceId\":\"ln\"},\"identity\":{\"type\":\"SystemAssigned\",\"principalId\":\"zkdbqzolx\",\"tenantId\":\"vhqjwtrhtgvg\",\"userAssignedIdentities\":{\"itlhguyn\":{\"principalId\":\"rkolawjm\",\"clientId\":\"mwrokcdxfzzzwyja\"}}},\"location\":\"chl\",\"tags\":{\"hmoz\":\"txd\",\"ns\":\"sgzv\",\"fpafolpymwamxq\":\"nj\"},\"id\":\"rag\",\"name\":\"gdphtvdula\",\"type\":\"vl\"}],\"nextLink\":\"c\"}") - .toObject(SystemTopicsListResult.class); - Assertions.assertEquals("plrvkmjcwmjvlg", model.value().get(0).location()); - Assertions.assertEquals("cvkyylizrzbj", model.value().get(0).tags().get("sfxsf")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("memczjkmmyk", model.value().get(0).identity().principalId()); - Assertions.assertEquals("jxsglhsr", model.value().get(0).identity().tenantId()); - Assertions.assertEquals("jylmbkzudnigr", - model.value().get(0).identity().userAssignedIdentities().get("wlpxuzzjg").principalId()); - Assertions.assertEquals("hotj", - model.value().get(0).identity().userAssignedIdentities().get("wlpxuzzjg").clientId()); - Assertions.assertEquals("wrbfdpyflubh", model.value().get(0).source()); - Assertions.assertEquals("glrocuy", model.value().get(0).topicType()); - Assertions.assertEquals("c", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SystemTopicsListResult model - = new SystemTopicsListResult() - .withValue( - Arrays.asList( - new SystemTopicInner().withLocation("plrvkmjcwmjvlg") - .withTags(mapOf("sfxsf", "cvkyylizrzbj", "ukoveofi", "ztlvtmvagbwidqlv")) - .withIdentity(new IdentityInfo().withType(IdentityType.SYSTEM_ASSIGNED) - .withPrincipalId("memczjkmmyk") - .withTenantId("jxsglhsr") - .withUserAssignedIdentities(mapOf("wlpxuzzjg", - new UserIdentityProperties().withPrincipalId("jylmbkzudnigr").withClientId("hotj"), - "rkwpzdqtvhcspod", - new UserIdentityProperties().withPrincipalId("efqyhqotoihiqaky").withClientId("wf"), - "dlpnfpubn", - new UserIdentityProperties().withPrincipalId("axsipietgb") - .withClientId("jfulbmoic"), - "attcju", - new UserIdentityProperties().withPrincipalId("batzviqsows").withClientId("el")))) - .withSource("wrbfdpyflubh") - .withTopicType("glrocuy"), - new SystemTopicInner().withLocation("chl") - .withTags(mapOf("hmoz", "txd", "ns", "sgzv", "fpafolpymwamxq", "nj")) - .withIdentity(new IdentityInfo().withType(IdentityType.SYSTEM_ASSIGNED) - .withPrincipalId("zkdbqzolx") - .withTenantId("vhqjwtrhtgvg") - .withUserAssignedIdentities(mapOf("itlhguyn", - new UserIdentityProperties().withPrincipalId("rkolawjm") - .withClientId("mwrokcdxfzzzwyja")))) - .withSource("uidjpuuyjucej") - .withTopicType("zoeovvtzejet"))) - .withNextLink("c"); - model = BinaryData.fromObject(model).toObject(SystemTopicsListResult.class); - Assertions.assertEquals("plrvkmjcwmjvlg", model.value().get(0).location()); - Assertions.assertEquals("cvkyylizrzbj", model.value().get(0).tags().get("sfxsf")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("memczjkmmyk", model.value().get(0).identity().principalId()); - Assertions.assertEquals("jxsglhsr", model.value().get(0).identity().tenantId()); - Assertions.assertEquals("jylmbkzudnigr", - model.value().get(0).identity().userAssignedIdentities().get("wlpxuzzjg").principalId()); - Assertions.assertEquals("hotj", - model.value().get(0).identity().userAssignedIdentities().get("wlpxuzzjg").clientId()); - Assertions.assertEquals("wrbfdpyflubh", model.value().get(0).source()); - Assertions.assertEquals("glrocuy", model.value().get(0).topicType()); - Assertions.assertEquals("c", model.nextLink()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicEventSubscriptionsDeleteMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicEventSubscriptionsDeleteMockTests.java deleted file mode 100644 index dec056c496a0..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicEventSubscriptionsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class TopicEventSubscriptionsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.topicEventSubscriptions().delete("skwxe", "qphr", "fn", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicEventSubscriptionsGetDeliveryAttributesWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicEventSubscriptionsGetDeliveryAttributesWithResponseMockTests.java deleted file mode 100644 index 6d942c8aae9d..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicEventSubscriptionsGetDeliveryAttributesWithResponseMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeListResult; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class TopicEventSubscriptionsGetDeliveryAttributesWithResponseMockTests { - @Test - public void testGetDeliveryAttributesWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"type\":\"DeliveryAttributeMapping\",\"name\":\"uagntetaou\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"pdctuhspfefyi\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"uyeuyl\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - DeliveryAttributeListResult response = manager.topicEventSubscriptions() - .getDeliveryAttributesWithResponse("pakftngatwm", "kyutrymdwmfjhpyc", "jqdvdwkqpldrlefg", - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("uagntetaou", response.value().get(0).name()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicEventSubscriptionsGetFullUrlWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicEventSubscriptionsGetFullUrlWithResponseMockTests.java deleted file mode 100644 index 54d52af3e880..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicEventSubscriptionsGetFullUrlWithResponseMockTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.EventSubscriptionFullUrl; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class TopicEventSubscriptionsGetFullUrlWithResponseMockTests { - @Test - public void testGetFullUrlWithResponse() throws Exception { - String responseStr = "{\"endpointUrl\":\"dtzmpype\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - EventSubscriptionFullUrl response = manager.topicEventSubscriptions() - .getFullUrlWithResponse("hctmjtsgh", "bcbcpz", "rpzeqac", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("dtzmpype", response.endpointUrl()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicInnerTests.java deleted file mode 100644 index 6045a263d1c1..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicInnerTests.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.TopicInner; -import com.azure.resourcemanager.eventgrid.models.DataResidencyBoundary; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.InboundIpRule; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import com.azure.resourcemanager.eventgrid.models.InputSchema; -import com.azure.resourcemanager.eventgrid.models.InputSchemaMapping; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import com.azure.resourcemanager.eventgrid.models.UserIdentityProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TopicInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopicInner model = BinaryData.fromString( - "{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"okqdzfvaz\"},\"groupIds\":[\"l\",\"rqttbajlkatnw\"],\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"id\",\"actionsRequired\":\"qfkuvscxkdmli\"},\"provisioningState\":\"Canceled\"},\"id\":\"ibrxkp\",\"name\":\"loazuruocbgoo\",\"type\":\"bteoybf\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"kvvjgslordilmyww\"},\"groupIds\":[\"kxn\",\"edabgyvudtjue\",\"bcihxuuwhc\"],\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"ybvpay\",\"actionsRequired\":\"kudzpxgwj\"},\"provisioningState\":\"Updating\"},\"id\":\"agst\",\"name\":\"yohpfkyrkdbdgiog\",\"type\":\"jkmnwq\"}],\"provisioningState\":\"Updating\",\"endpoint\":\"aiy\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"swsmys\":{\"description\":\"egfnmntfpmvmemfn\",\"displayName\":\"dwvvba\",\"documentationUrl\":\"lllchpodb\",\"dataSchemaUrl\":\"vwrdnhfukuvsj\"},\"qddrihpfhoqcaae\":{\"description\":\"luqypfcvlerch\",\"displayName\":\"bm\",\"documentationUrl\":\"jbabwidf\",\"dataSchemaUrl\":\"sspuunnoxyhkx\"},\"y\":{\"description\":\"aomdjvlpjxx\",\"displayName\":\"brm\",\"documentationUrl\":\"eivsiykzkdnc\",\"dataSchemaUrl\":\"xonbzoggculapz\"}}},\"minimumTlsVersionAllowed\":\"1.2\",\"inputSchema\":\"CloudEventSchemaV1_0\",\"inputSchemaMapping\":{\"inputSchemaMappingType\":\"InputSchemaMapping\"},\"metricResourceId\":\"xepnyl\",\"publicNetworkAccess\":\"Enabled\",\"inboundIpRules\":[{\"ipMask\":\"yjt\",\"action\":\"Allow\"},{\"ipMask\":\"qzhv\",\"action\":\"Allow\"},{\"ipMask\":\"yfm\",\"action\":\"Allow\"}],\"disableLocalAuth\":true,\"dataResidencyBoundary\":\"WithinGeopair\"},\"identity\":{\"type\":\"None\",\"principalId\":\"xfzwi\",\"tenantId\":\"wzjbh\",\"userAssignedIdentities\":{\"bkkd\":{\"principalId\":\"jrkambtrnegvmnv\",\"clientId\":\"eqvldspast\"},\"ilozapeewchpxlk\":{\"principalId\":\"lves\",\"clientId\":\"jlxr\"}}},\"location\":\"kuziycsle\",\"tags\":{\"gzulwmmrqzzr\":\"uztcktyhjtqed\"},\"id\":\"jvpglydzgk\",\"name\":\"vqeevtoep\",\"type\":\"yutnwytpzdmov\"}") - .toObject(TopicInner.class); - Assertions.assertEquals("kuziycsle", model.location()); - Assertions.assertEquals("uztcktyhjtqed", model.tags().get("gzulwmmrqzzr")); - Assertions.assertEquals(IdentityType.NONE, model.identity().type()); - Assertions.assertEquals("xfzwi", model.identity().principalId()); - Assertions.assertEquals("wzjbh", model.identity().tenantId()); - Assertions.assertEquals("jrkambtrnegvmnv", model.identity().userAssignedIdentities().get("bkkd").principalId()); - Assertions.assertEquals("eqvldspast", model.identity().userAssignedIdentities().get("bkkd").clientId()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("egfnmntfpmvmemfn", - model.eventTypeInfo().inlineEventTypes().get("swsmys").description()); - Assertions.assertEquals("dwvvba", model.eventTypeInfo().inlineEventTypes().get("swsmys").displayName()); - Assertions.assertEquals("lllchpodb", model.eventTypeInfo().inlineEventTypes().get("swsmys").documentationUrl()); - Assertions.assertEquals("vwrdnhfukuvsj", - model.eventTypeInfo().inlineEventTypes().get("swsmys").dataSchemaUrl()); - Assertions.assertEquals(TlsVersion.ONE_TWO, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(InputSchema.CLOUD_EVENT_SCHEMA_V1_0, model.inputSchema()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - Assertions.assertEquals("yjt", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(true, model.disableLocalAuth()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_GEOPAIR, model.dataResidencyBoundary()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopicInner model = new TopicInner().withLocation("kuziycsle") - .withTags(mapOf("gzulwmmrqzzr", "uztcktyhjtqed")) - .withIdentity(new IdentityInfo().withType(IdentityType.NONE) - .withPrincipalId("xfzwi") - .withTenantId("wzjbh") - .withUserAssignedIdentities(mapOf("bkkd", - new UserIdentityProperties().withPrincipalId("jrkambtrnegvmnv").withClientId("eqvldspast"), - "ilozapeewchpxlk", new UserIdentityProperties().withPrincipalId("lves").withClientId("jlxr")))) - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("swsmys", - new InlineEventProperties().withDescription("egfnmntfpmvmemfn") - .withDisplayName("dwvvba") - .withDocumentationUrl("lllchpodb") - .withDataSchemaUrl("vwrdnhfukuvsj"), - "qddrihpfhoqcaae", - new InlineEventProperties().withDescription("luqypfcvlerch") - .withDisplayName("bm") - .withDocumentationUrl("jbabwidf") - .withDataSchemaUrl("sspuunnoxyhkx"), - "y", - new InlineEventProperties().withDescription("aomdjvlpjxx") - .withDisplayName("brm") - .withDocumentationUrl("eivsiykzkdnc") - .withDataSchemaUrl("xonbzoggculapz")))) - .withMinimumTlsVersionAllowed(TlsVersion.ONE_TWO) - .withInputSchema(InputSchema.CLOUD_EVENT_SCHEMA_V1_0) - .withInputSchemaMapping(new InputSchemaMapping()) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withInboundIpRules(Arrays.asList(new InboundIpRule().withIpMask("yjt").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("qzhv").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("yfm").withAction(IpActionType.ALLOW))) - .withDisableLocalAuth(true) - .withDataResidencyBoundary(DataResidencyBoundary.WITHIN_GEOPAIR); - model = BinaryData.fromObject(model).toObject(TopicInner.class); - Assertions.assertEquals("kuziycsle", model.location()); - Assertions.assertEquals("uztcktyhjtqed", model.tags().get("gzulwmmrqzzr")); - Assertions.assertEquals(IdentityType.NONE, model.identity().type()); - Assertions.assertEquals("xfzwi", model.identity().principalId()); - Assertions.assertEquals("wzjbh", model.identity().tenantId()); - Assertions.assertEquals("jrkambtrnegvmnv", model.identity().userAssignedIdentities().get("bkkd").principalId()); - Assertions.assertEquals("eqvldspast", model.identity().userAssignedIdentities().get("bkkd").clientId()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("egfnmntfpmvmemfn", - model.eventTypeInfo().inlineEventTypes().get("swsmys").description()); - Assertions.assertEquals("dwvvba", model.eventTypeInfo().inlineEventTypes().get("swsmys").displayName()); - Assertions.assertEquals("lllchpodb", model.eventTypeInfo().inlineEventTypes().get("swsmys").documentationUrl()); - Assertions.assertEquals("vwrdnhfukuvsj", - model.eventTypeInfo().inlineEventTypes().get("swsmys").dataSchemaUrl()); - Assertions.assertEquals(TlsVersion.ONE_TWO, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(InputSchema.CLOUD_EVENT_SCHEMA_V1_0, model.inputSchema()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - Assertions.assertEquals("yjt", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(true, model.disableLocalAuth()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_GEOPAIR, model.dataResidencyBoundary()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicPropertiesTests.java deleted file mode 100644 index 1204d4bf3904..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicPropertiesTests.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.TopicProperties; -import com.azure.resourcemanager.eventgrid.models.DataResidencyBoundary; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.InboundIpRule; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import com.azure.resourcemanager.eventgrid.models.InputSchema; -import com.azure.resourcemanager.eventgrid.models.InputSchemaMapping; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TopicPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopicProperties model = BinaryData.fromString( - "{\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"wzqa\"},\"groupIds\":[\"gzuriglaecxndt\",\"cokpv\"],\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"mldgxobfirc\",\"actionsRequired\":\"pkc\"},\"provisioningState\":\"Creating\"},\"id\":\"zriykhy\",\"name\":\"wf\",\"type\":\"jlb\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"kjlmx\"},\"groupIds\":[\"dynhdwdigum\"],\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"uzzptjazysdz\",\"actionsRequired\":\"zwwva\"},\"provisioningState\":\"Creating\"},\"id\":\"uvvfonkp\",\"name\":\"hqyikvy\",\"type\":\"auy\"}],\"provisioningState\":\"Succeeded\",\"endpoint\":\"wmn\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"u\":{\"description\":\"y\",\"displayName\":\"poekrsgsgb\",\"documentationUrl\":\"uzqgnjdgkynsc\",\"dataSchemaUrl\":\"qhzvhxnkomt\"},\"lfkqojpy\":{\"description\":\"tppn\",\"displayName\":\"xz\",\"documentationUrl\":\"ihfrbbcevqa\",\"dataSchemaUrl\":\"ltd\"},\"m\":{\"description\":\"gtrd\",\"displayName\":\"ifmzzsd\",\"documentationUrl\":\"brn\",\"dataSchemaUrl\":\"u\"},\"hrv\":{\"description\":\"a\",\"displayName\":\"g\",\"documentationUrl\":\"hocxvdfffwafqrou\",\"dataSchemaUrl\":\"spave\"}}},\"minimumTlsVersionAllowed\":\"1.2\",\"inputSchema\":\"EventGridSchema\",\"inputSchemaMapping\":{\"inputSchemaMappingType\":\"InputSchemaMapping\"},\"metricResourceId\":\"ud\",\"publicNetworkAccess\":\"Enabled\",\"inboundIpRules\":[{\"ipMask\":\"oyxcdyuib\",\"action\":\"Allow\"},{\"ipMask\":\"nbzydvfvfcj\",\"action\":\"Allow\"},{\"ipMask\":\"isrvhm\",\"action\":\"Allow\"}],\"disableLocalAuth\":true,\"dataResidencyBoundary\":\"WithinRegion\"}") - .toObject(TopicProperties.class); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("y", model.eventTypeInfo().inlineEventTypes().get("u").description()); - Assertions.assertEquals("poekrsgsgb", model.eventTypeInfo().inlineEventTypes().get("u").displayName()); - Assertions.assertEquals("uzqgnjdgkynsc", model.eventTypeInfo().inlineEventTypes().get("u").documentationUrl()); - Assertions.assertEquals("qhzvhxnkomt", model.eventTypeInfo().inlineEventTypes().get("u").dataSchemaUrl()); - Assertions.assertEquals(TlsVersion.ONE_TWO, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(InputSchema.EVENT_GRID_SCHEMA, model.inputSchema()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - Assertions.assertEquals("oyxcdyuib", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(true, model.disableLocalAuth()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_REGION, model.dataResidencyBoundary()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopicProperties model = new TopicProperties() - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("u", - new InlineEventProperties().withDescription("y") - .withDisplayName("poekrsgsgb") - .withDocumentationUrl("uzqgnjdgkynsc") - .withDataSchemaUrl("qhzvhxnkomt"), - "lfkqojpy", - new InlineEventProperties().withDescription("tppn") - .withDisplayName("xz") - .withDocumentationUrl("ihfrbbcevqa") - .withDataSchemaUrl("ltd"), - "m", - new InlineEventProperties().withDescription("gtrd") - .withDisplayName("ifmzzsd") - .withDocumentationUrl("brn") - .withDataSchemaUrl("u"), - "hrv", - new InlineEventProperties().withDescription("a") - .withDisplayName("g") - .withDocumentationUrl("hocxvdfffwafqrou") - .withDataSchemaUrl("spave")))) - .withMinimumTlsVersionAllowed(TlsVersion.ONE_TWO) - .withInputSchema(InputSchema.EVENT_GRID_SCHEMA) - .withInputSchemaMapping(new InputSchemaMapping()) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withInboundIpRules( - Arrays.asList(new InboundIpRule().withIpMask("oyxcdyuib").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("nbzydvfvfcj").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("isrvhm").withAction(IpActionType.ALLOW))) - .withDisableLocalAuth(true) - .withDataResidencyBoundary(DataResidencyBoundary.WITHIN_REGION); - model = BinaryData.fromObject(model).toObject(TopicProperties.class); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("y", model.eventTypeInfo().inlineEventTypes().get("u").description()); - Assertions.assertEquals("poekrsgsgb", model.eventTypeInfo().inlineEventTypes().get("u").displayName()); - Assertions.assertEquals("uzqgnjdgkynsc", model.eventTypeInfo().inlineEventTypes().get("u").documentationUrl()); - Assertions.assertEquals("qhzvhxnkomt", model.eventTypeInfo().inlineEventTypes().get("u").dataSchemaUrl()); - Assertions.assertEquals(TlsVersion.ONE_TWO, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(InputSchema.EVENT_GRID_SCHEMA, model.inputSchema()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - Assertions.assertEquals("oyxcdyuib", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(true, model.disableLocalAuth()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_REGION, model.dataResidencyBoundary()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicSpaceInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicSpaceInnerTests.java deleted file mode 100644 index c52196bd8917..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicSpaceInnerTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.TopicSpaceInner; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class TopicSpaceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopicSpaceInner model = BinaryData.fromString( - "{\"properties\":{\"description\":\"jyfdvlv\",\"topicTemplates\":[\"rnfxtgddp\",\"th\",\"hn\"],\"provisioningState\":\"Deleting\"},\"id\":\"yank\",\"name\":\"oe\",\"type\":\"swankltytmh\"}") - .toObject(TopicSpaceInner.class); - Assertions.assertEquals("jyfdvlv", model.description()); - Assertions.assertEquals("rnfxtgddp", model.topicTemplates().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopicSpaceInner model = new TopicSpaceInner().withDescription("jyfdvlv") - .withTopicTemplates(Arrays.asList("rnfxtgddp", "th", "hn")); - model = BinaryData.fromObject(model).toObject(TopicSpaceInner.class); - Assertions.assertEquals("jyfdvlv", model.description()); - Assertions.assertEquals("rnfxtgddp", model.topicTemplates().get(0)); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicSpacePropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicSpacePropertiesTests.java deleted file mode 100644 index ec034c4bf2bd..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicSpacePropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.TopicSpaceProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class TopicSpacePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopicSpaceProperties model = BinaryData.fromString( - "{\"description\":\"oznnhdrlktgj\",\"topicTemplates\":[\"guxhem\",\"wyw\",\"eeczgfbu\"],\"provisioningState\":\"Deleting\"}") - .toObject(TopicSpaceProperties.class); - Assertions.assertEquals("oznnhdrlktgj", model.description()); - Assertions.assertEquals("guxhem", model.topicTemplates().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopicSpaceProperties model = new TopicSpaceProperties().withDescription("oznnhdrlktgj") - .withTopicTemplates(Arrays.asList("guxhem", "wyw", "eeczgfbu")); - model = BinaryData.fromObject(model).toObject(TopicSpaceProperties.class); - Assertions.assertEquals("oznnhdrlktgj", model.description()); - Assertions.assertEquals("guxhem", model.topicTemplates().get(0)); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicSpacesCreateOrUpdateMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicSpacesCreateOrUpdateMockTests.java deleted file mode 100644 index 082e1254d2a3..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicSpacesCreateOrUpdateMockTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.TopicSpace; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class TopicSpacesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"description\":\"ih\",\"topicTemplates\":[\"kzsrz\",\"ffjilzfbpnt\",\"gkensckhbmcarmo\"],\"provisioningState\":\"Succeeded\"},\"id\":\"kwykuqdndxl\",\"name\":\"kh\",\"type\":\"gga\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - TopicSpace response = manager.topicSpaces() - .define("bdxmd") - .withExistingNamespace("oewyhxessmvrkd", "sqeq") - .withDescription("br") - .withTopicTemplates(Arrays.asList("jppp", "tlpd", "bfm")) - .create(); - - Assertions.assertEquals("ih", response.description()); - Assertions.assertEquals("kzsrz", response.topicTemplates().get(0)); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicSpacesDeleteMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicSpacesDeleteMockTests.java deleted file mode 100644 index bcd870d05326..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicSpacesDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class TopicSpacesDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.topicSpaces().delete("xrfomcke", "vmyifopxf", "jt", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicSpacesGetWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicSpacesGetWithResponseMockTests.java deleted file mode 100644 index 53247dc641a6..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicSpacesGetWithResponseMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.TopicSpace; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class TopicSpacesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"description\":\"ergaghpuzx\",\"topicTemplates\":[\"ehhf\",\"yldhgyed\",\"fzqiyuq\"],\"provisioningState\":\"Updating\"},\"id\":\"reunokak\",\"name\":\"whpjlw\",\"type\":\"xedzn\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - TopicSpace response = manager.topicSpaces() - .getWithResponse("ekwwnthropmdudsy", "urz", "vktjhffecqkoq", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ergaghpuzx", response.description()); - Assertions.assertEquals("ehhf", response.topicTemplates().get(0)); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicSpacesListByNamespaceMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicSpacesListByNamespaceMockTests.java deleted file mode 100644 index 48b55e2c8fc8..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicSpacesListByNamespaceMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.TopicSpace; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class TopicSpacesListByNamespaceMockTests { - @Test - public void testListByNamespace() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"description\":\"lufbortb\",\"topicTemplates\":[\"k\"],\"provisioningState\":\"Creating\"},\"id\":\"svbxxyjisskob\",\"name\":\"ocl\",\"type\":\"l\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.topicSpaces() - .listByNamespace("dyzoutxfptofhg", "uywezygvadg", "aqwvkgjpytpmpvdn", 1304500188, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("lufbortb", response.iterator().next().description()); - Assertions.assertEquals("k", response.iterator().next().topicTemplates().get(0)); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicSpacesListResultTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicSpacesListResultTests.java deleted file mode 100644 index 4e478a2087ba..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicSpacesListResultTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.TopicSpaceInner; -import com.azure.resourcemanager.eventgrid.models.TopicSpacesListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class TopicSpacesListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopicSpacesListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"description\":\"xblycsxzuj\",\"topicTemplates\":[\"lsmdesqplpvmjc\",\"oewbid\",\"vteo\",\"xvgpiude\"],\"provisioningState\":\"Deleting\"},\"id\":\"xzecpaxwkufykhvu\",\"name\":\"xepmrut\",\"type\":\"nabaobnslujd\"},{\"properties\":{\"description\":\"ymkmvguihyw\",\"topicTemplates\":[\"spphk\",\"xkykxdssjp\",\"mmuc\",\"xhikkflrmymyin\"],\"provisioningState\":\"Deleting\"},\"id\":\"riswslmiiio\",\"name\":\"gqcg\",\"type\":\"uugqk\"},{\"properties\":{\"description\":\"tiowlx\",\"topicTemplates\":[\"dptjgwdtgukranb\"],\"provisioningState\":\"Updating\"},\"id\":\"qlkccuzgygqwaho\",\"name\":\"ulwgniiprglvawuw\",\"type\":\"d\"},{\"properties\":{\"description\":\"pivlsbbjpm\",\"topicTemplates\":[\"kmifoxxkub\",\"phavpmhbrb\",\"gvgovpbbttefjo\"],\"provisioningState\":\"Updating\"},\"id\":\"qyzqedikdfrdb\",\"name\":\"qmrjg\",\"type\":\"ihfqlggwfiwzc\"}],\"nextLink\":\"jpbyephmgtv\"}") - .toObject(TopicSpacesListResult.class); - Assertions.assertEquals("xblycsxzuj", model.value().get(0).description()); - Assertions.assertEquals("lsmdesqplpvmjc", model.value().get(0).topicTemplates().get(0)); - Assertions.assertEquals("jpbyephmgtv", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopicSpacesListResult model = new TopicSpacesListResult() - .withValue(Arrays.asList( - new TopicSpaceInner().withDescription("xblycsxzuj") - .withTopicTemplates(Arrays.asList("lsmdesqplpvmjc", "oewbid", "vteo", "xvgpiude")), - new TopicSpaceInner().withDescription("ymkmvguihyw") - .withTopicTemplates(Arrays.asList("spphk", "xkykxdssjp", "mmuc", "xhikkflrmymyin")), - new TopicSpaceInner().withDescription("tiowlx").withTopicTemplates(Arrays.asList("dptjgwdtgukranb")), - new TopicSpaceInner().withDescription("pivlsbbjpm") - .withTopicTemplates(Arrays.asList("kmifoxxkub", "phavpmhbrb", "gvgovpbbttefjo")))) - .withNextLink("jpbyephmgtv"); - model = BinaryData.fromObject(model).toObject(TopicSpacesListResult.class); - Assertions.assertEquals("xblycsxzuj", model.value().get(0).description()); - Assertions.assertEquals("lsmdesqplpvmjc", model.value().get(0).topicTemplates().get(0)); - Assertions.assertEquals("jpbyephmgtv", model.nextLink()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicTypeAdditionalEnforcedPermissionTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicTypeAdditionalEnforcedPermissionTests.java deleted file mode 100644 index f0f1c21ce38d..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicTypeAdditionalEnforcedPermissionTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.TopicTypeAdditionalEnforcedPermission; -import org.junit.jupiter.api.Assertions; - -public final class TopicTypeAdditionalEnforcedPermissionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopicTypeAdditionalEnforcedPermission model - = BinaryData.fromString("{\"permissionName\":\"rqofulopmjnlexwh\",\"isDataAction\":false}") - .toObject(TopicTypeAdditionalEnforcedPermission.class); - Assertions.assertEquals("rqofulopmjnlexwh", model.permissionName()); - Assertions.assertEquals(false, model.isDataAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopicTypeAdditionalEnforcedPermission model - = new TopicTypeAdditionalEnforcedPermission().withPermissionName("rqofulopmjnlexwh") - .withIsDataAction(false); - model = BinaryData.fromObject(model).toObject(TopicTypeAdditionalEnforcedPermission.class); - Assertions.assertEquals("rqofulopmjnlexwh", model.permissionName()); - Assertions.assertEquals(false, model.isDataAction()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicTypeInfoInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicTypeInfoInnerTests.java deleted file mode 100644 index 26c2300773eb..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicTypeInfoInnerTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.TopicTypeInfoInner; -import com.azure.resourcemanager.eventgrid.models.ResourceRegionType; -import com.azure.resourcemanager.eventgrid.models.TopicTypeAdditionalEnforcedPermission; -import com.azure.resourcemanager.eventgrid.models.TopicTypeProvisioningState; -import com.azure.resourcemanager.eventgrid.models.TopicTypeSourceScope; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class TopicTypeInfoInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopicTypeInfoInner model = BinaryData.fromString( - "{\"properties\":{\"provider\":\"oj\",\"displayName\":\"x\",\"description\":\"zdcgdzbenr\",\"resourceRegionType\":\"GlobalResource\",\"provisioningState\":\"Canceled\",\"supportedLocations\":[\"zqddtjwfljhzn\",\"mtuatmzwcjjncqtj\"],\"sourceResourceFormat\":\"izvg\",\"supportedScopesForSource\":[\"ResourceGroup\",\"AzureSubscription\"],\"areRegionalAndGlobalSourcesSupported\":false,\"additionalEnforcedPermissions\":[{\"permissionName\":\"ngrebwg\",\"isDataAction\":true}]},\"id\":\"ttzlswvajqfutlx\",\"name\":\"oqza\",\"type\":\"unwqr\"}") - .toObject(TopicTypeInfoInner.class); - Assertions.assertEquals("oj", model.provider()); - Assertions.assertEquals("x", model.displayName()); - Assertions.assertEquals("zdcgdzbenr", model.description()); - Assertions.assertEquals(ResourceRegionType.GLOBAL_RESOURCE, model.resourceRegionType()); - Assertions.assertEquals(TopicTypeProvisioningState.CANCELED, model.provisioningState()); - Assertions.assertEquals("zqddtjwfljhzn", model.supportedLocations().get(0)); - Assertions.assertEquals("izvg", model.sourceResourceFormat()); - Assertions.assertEquals(TopicTypeSourceScope.RESOURCE_GROUP, model.supportedScopesForSource().get(0)); - Assertions.assertEquals(false, model.areRegionalAndGlobalSourcesSupported()); - Assertions.assertEquals("ngrebwg", model.additionalEnforcedPermissions().get(0).permissionName()); - Assertions.assertEquals(true, model.additionalEnforcedPermissions().get(0).isDataAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopicTypeInfoInner model = new TopicTypeInfoInner().withProvider("oj") - .withDisplayName("x") - .withDescription("zdcgdzbenr") - .withResourceRegionType(ResourceRegionType.GLOBAL_RESOURCE) - .withProvisioningState(TopicTypeProvisioningState.CANCELED) - .withSupportedLocations(Arrays.asList("zqddtjwfljhzn", "mtuatmzwcjjncqtj")) - .withSourceResourceFormat("izvg") - .withSupportedScopesForSource( - Arrays.asList(TopicTypeSourceScope.RESOURCE_GROUP, TopicTypeSourceScope.AZURE_SUBSCRIPTION)) - .withAreRegionalAndGlobalSourcesSupported(false) - .withAdditionalEnforcedPermissions(Arrays.asList( - new TopicTypeAdditionalEnforcedPermission().withPermissionName("ngrebwg").withIsDataAction(true))); - model = BinaryData.fromObject(model).toObject(TopicTypeInfoInner.class); - Assertions.assertEquals("oj", model.provider()); - Assertions.assertEquals("x", model.displayName()); - Assertions.assertEquals("zdcgdzbenr", model.description()); - Assertions.assertEquals(ResourceRegionType.GLOBAL_RESOURCE, model.resourceRegionType()); - Assertions.assertEquals(TopicTypeProvisioningState.CANCELED, model.provisioningState()); - Assertions.assertEquals("zqddtjwfljhzn", model.supportedLocations().get(0)); - Assertions.assertEquals("izvg", model.sourceResourceFormat()); - Assertions.assertEquals(TopicTypeSourceScope.RESOURCE_GROUP, model.supportedScopesForSource().get(0)); - Assertions.assertEquals(false, model.areRegionalAndGlobalSourcesSupported()); - Assertions.assertEquals("ngrebwg", model.additionalEnforcedPermissions().get(0).permissionName()); - Assertions.assertEquals(true, model.additionalEnforcedPermissions().get(0).isDataAction()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicTypePropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicTypePropertiesTests.java deleted file mode 100644 index 9e022fbd99aa..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicTypePropertiesTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.TopicTypeProperties; -import com.azure.resourcemanager.eventgrid.models.ResourceRegionType; -import com.azure.resourcemanager.eventgrid.models.TopicTypeAdditionalEnforcedPermission; -import com.azure.resourcemanager.eventgrid.models.TopicTypeProvisioningState; -import com.azure.resourcemanager.eventgrid.models.TopicTypeSourceScope; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class TopicTypePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopicTypeProperties model = BinaryData.fromString( - "{\"provider\":\"frgqhaohcm\",\"displayName\":\"oc\",\"description\":\"r\",\"resourceRegionType\":\"GlobalResource\",\"provisioningState\":\"Succeeded\",\"supportedLocations\":[\"yx\",\"meblyd\",\"vkfkmr\",\"cxneh\"],\"sourceResourceFormat\":\"mtodl\",\"supportedScopesForSource\":[\"ResourceGroup\",\"ManagementGroup\",\"ResourceGroup\"],\"areRegionalAndGlobalSourcesSupported\":true,\"additionalEnforcedPermissions\":[{\"permissionName\":\"avyunssxlg\",\"isDataAction\":false},{\"permissionName\":\"gjlgvvpase\",\"isDataAction\":true},{\"permissionName\":\"uxantuygdhgaqipi\",\"isDataAction\":true}]}") - .toObject(TopicTypeProperties.class); - Assertions.assertEquals("frgqhaohcm", model.provider()); - Assertions.assertEquals("oc", model.displayName()); - Assertions.assertEquals("r", model.description()); - Assertions.assertEquals(ResourceRegionType.GLOBAL_RESOURCE, model.resourceRegionType()); - Assertions.assertEquals(TopicTypeProvisioningState.SUCCEEDED, model.provisioningState()); - Assertions.assertEquals("yx", model.supportedLocations().get(0)); - Assertions.assertEquals("mtodl", model.sourceResourceFormat()); - Assertions.assertEquals(TopicTypeSourceScope.RESOURCE_GROUP, model.supportedScopesForSource().get(0)); - Assertions.assertEquals(true, model.areRegionalAndGlobalSourcesSupported()); - Assertions.assertEquals("avyunssxlg", model.additionalEnforcedPermissions().get(0).permissionName()); - Assertions.assertEquals(false, model.additionalEnforcedPermissions().get(0).isDataAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopicTypeProperties model = new TopicTypeProperties().withProvider("frgqhaohcm") - .withDisplayName("oc") - .withDescription("r") - .withResourceRegionType(ResourceRegionType.GLOBAL_RESOURCE) - .withProvisioningState(TopicTypeProvisioningState.SUCCEEDED) - .withSupportedLocations(Arrays.asList("yx", "meblyd", "vkfkmr", "cxneh")) - .withSourceResourceFormat("mtodl") - .withSupportedScopesForSource(Arrays.asList(TopicTypeSourceScope.RESOURCE_GROUP, - TopicTypeSourceScope.MANAGEMENT_GROUP, TopicTypeSourceScope.RESOURCE_GROUP)) - .withAreRegionalAndGlobalSourcesSupported(true) - .withAdditionalEnforcedPermissions(Arrays.asList( - new TopicTypeAdditionalEnforcedPermission().withPermissionName("avyunssxlg").withIsDataAction(false), - new TopicTypeAdditionalEnforcedPermission().withPermissionName("gjlgvvpase").withIsDataAction(true), - new TopicTypeAdditionalEnforcedPermission().withPermissionName("uxantuygdhgaqipi") - .withIsDataAction(true))); - model = BinaryData.fromObject(model).toObject(TopicTypeProperties.class); - Assertions.assertEquals("frgqhaohcm", model.provider()); - Assertions.assertEquals("oc", model.displayName()); - Assertions.assertEquals("r", model.description()); - Assertions.assertEquals(ResourceRegionType.GLOBAL_RESOURCE, model.resourceRegionType()); - Assertions.assertEquals(TopicTypeProvisioningState.SUCCEEDED, model.provisioningState()); - Assertions.assertEquals("yx", model.supportedLocations().get(0)); - Assertions.assertEquals("mtodl", model.sourceResourceFormat()); - Assertions.assertEquals(TopicTypeSourceScope.RESOURCE_GROUP, model.supportedScopesForSource().get(0)); - Assertions.assertEquals(true, model.areRegionalAndGlobalSourcesSupported()); - Assertions.assertEquals("avyunssxlg", model.additionalEnforcedPermissions().get(0).permissionName()); - Assertions.assertEquals(false, model.additionalEnforcedPermissions().get(0).isDataAction()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicTypesGetWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicTypesGetWithResponseMockTests.java deleted file mode 100644 index 70a0f8340ac5..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicTypesGetWithResponseMockTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.ResourceRegionType; -import com.azure.resourcemanager.eventgrid.models.TopicTypeInfo; -import com.azure.resourcemanager.eventgrid.models.TopicTypeProvisioningState; -import com.azure.resourcemanager.eventgrid.models.TopicTypeSourceScope; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class TopicTypesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provider\":\"qpmnu\",\"displayName\":\"hr\",\"description\":\"x\",\"resourceRegionType\":\"RegionalResource\",\"provisioningState\":\"Failed\",\"supportedLocations\":[\"vwlvivjmxmlit\",\"dsjipdviscotyxb\"],\"sourceResourceFormat\":\"ifefndslv\",\"supportedScopesForSource\":[\"ManagementGroup\",\"ManagementGroup\"],\"areRegionalAndGlobalSourcesSupported\":false,\"additionalEnforcedPermissions\":[{\"permissionName\":\"ailwdqmqfyd\",\"isDataAction\":false},{\"permissionName\":\"fxlkd\",\"isDataAction\":true}]},\"id\":\"gnamkuuyiu\",\"name\":\"uafixlxicwgp\",\"type\":\"hdcfm\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - TopicTypeInfo response - = manager.topicTypes().getWithResponse("vucgji", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("qpmnu", response.provider()); - Assertions.assertEquals("hr", response.displayName()); - Assertions.assertEquals("x", response.description()); - Assertions.assertEquals(ResourceRegionType.REGIONAL_RESOURCE, response.resourceRegionType()); - Assertions.assertEquals(TopicTypeProvisioningState.FAILED, response.provisioningState()); - Assertions.assertEquals("vwlvivjmxmlit", response.supportedLocations().get(0)); - Assertions.assertEquals("ifefndslv", response.sourceResourceFormat()); - Assertions.assertEquals(TopicTypeSourceScope.MANAGEMENT_GROUP, response.supportedScopesForSource().get(0)); - Assertions.assertEquals(false, response.areRegionalAndGlobalSourcesSupported()); - Assertions.assertEquals("ailwdqmqfyd", response.additionalEnforcedPermissions().get(0).permissionName()); - Assertions.assertEquals(false, response.additionalEnforcedPermissions().get(0).isDataAction()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicTypesListEventTypesMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicTypesListEventTypesMockTests.java deleted file mode 100644 index 161304461629..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicTypesListEventTypesMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.EventType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class TopicTypesListEventTypesMockTests { - @Test - public void testListEventTypes() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"displayName\":\"sfodropalvng\",\"description\":\"yuskwgqrntaumdr\",\"schemaUrl\":\"lv\",\"isInDefaultSet\":false},\"id\":\"egtyc\",\"name\":\"uppiyxlzm\",\"type\":\"yddeeqz\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.topicTypes().listEventTypes("z", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("sfodropalvng", response.iterator().next().displayName()); - Assertions.assertEquals("yuskwgqrntaumdr", response.iterator().next().description()); - Assertions.assertEquals("lv", response.iterator().next().schemaUrl()); - Assertions.assertEquals(false, response.iterator().next().isInDefaultSet()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicTypesListMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicTypesListMockTests.java deleted file mode 100644 index 011c8e342861..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicTypesListMockTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.ResourceRegionType; -import com.azure.resourcemanager.eventgrid.models.TopicTypeInfo; -import com.azure.resourcemanager.eventgrid.models.TopicTypeProvisioningState; -import com.azure.resourcemanager.eventgrid.models.TopicTypeSourceScope; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class TopicTypesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provider\":\"gtf\",\"displayName\":\"erscdx\",\"description\":\"rnjr\",\"resourceRegionType\":\"RegionalResource\",\"provisioningState\":\"Creating\",\"supportedLocations\":[\"cnrgfdtnc\",\"spsanmameubkq\",\"qmlfv\",\"lqcskkqjmxptueip\"],\"sourceResourceFormat\":\"gkwdr\",\"supportedScopesForSource\":[\"Resource\",\"ManagementGroup\",\"AzureSubscription\",\"ManagementGroup\"],\"areRegionalAndGlobalSourcesSupported\":true,\"additionalEnforcedPermissions\":[{\"permissionName\":\"kxukguehvvpxjoe\",\"isDataAction\":false},{\"permissionName\":\"j\",\"isDataAction\":false}]},\"id\":\"uidpmtonvhg\",\"name\":\"htmep\",\"type\":\"hbpjbapmummmkv\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.topicTypes().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("gtf", response.iterator().next().provider()); - Assertions.assertEquals("erscdx", response.iterator().next().displayName()); - Assertions.assertEquals("rnjr", response.iterator().next().description()); - Assertions.assertEquals(ResourceRegionType.REGIONAL_RESOURCE, response.iterator().next().resourceRegionType()); - Assertions.assertEquals(TopicTypeProvisioningState.CREATING, response.iterator().next().provisioningState()); - Assertions.assertEquals("cnrgfdtnc", response.iterator().next().supportedLocations().get(0)); - Assertions.assertEquals("gkwdr", response.iterator().next().sourceResourceFormat()); - Assertions.assertEquals(TopicTypeSourceScope.RESOURCE, - response.iterator().next().supportedScopesForSource().get(0)); - Assertions.assertEquals(true, response.iterator().next().areRegionalAndGlobalSourcesSupported()); - Assertions.assertEquals("kxukguehvvpxjoe", - response.iterator().next().additionalEnforcedPermissions().get(0).permissionName()); - Assertions.assertEquals(false, - response.iterator().next().additionalEnforcedPermissions().get(0).isDataAction()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicTypesListResultTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicTypesListResultTests.java deleted file mode 100644 index 5e8c4f440619..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicTypesListResultTests.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.TopicTypeInfoInner; -import com.azure.resourcemanager.eventgrid.models.ResourceRegionType; -import com.azure.resourcemanager.eventgrid.models.TopicTypeAdditionalEnforcedPermission; -import com.azure.resourcemanager.eventgrid.models.TopicTypeProvisioningState; -import com.azure.resourcemanager.eventgrid.models.TopicTypeSourceScope; -import com.azure.resourcemanager.eventgrid.models.TopicTypesListResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class TopicTypesListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopicTypesListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provider\":\"m\",\"displayName\":\"qipgx\",\"description\":\"pomyqwcabvnuile\",\"resourceRegionType\":\"RegionalResource\",\"provisioningState\":\"Deleting\",\"supportedLocations\":[\"augmrmfjlr\",\"wtoaukhfk\",\"cisiz\",\"oaedsxjwuivedwcg\"],\"sourceResourceFormat\":\"ewxeiqbpsm\",\"supportedScopesForSource\":[\"ResourceGroup\",\"Resource\"],\"areRegionalAndGlobalSourcesSupported\":true,\"additionalEnforcedPermissions\":[{\"permissionName\":\"l\",\"isDataAction\":true},{\"permissionName\":\"plzgaufcshhvn\",\"isDataAction\":true},{\"permissionName\":\"xkym\",\"isDataAction\":false},{\"permissionName\":\"xrjkixtwb\",\"isDataAction\":false}]},\"id\":\"ypnyghshxc\",\"name\":\"lhkgmnsghp\",\"type\":\"ycphdrwjjkhvyo\"},{\"properties\":{\"provider\":\"luzvxnq\",\"displayName\":\"rpqpd\",\"description\":\"mkoisqcssf\",\"resourceRegionType\":\"RegionalResource\",\"provisioningState\":\"Canceled\",\"supportedLocations\":[\"s\",\"p\",\"bkdq\",\"rdzsylollgtrczzy\"],\"sourceResourceFormat\":\"xzji\",\"supportedScopesForSource\":[\"AzureSubscription\",\"AzureSubscription\"],\"areRegionalAndGlobalSourcesSupported\":true,\"additionalEnforcedPermissions\":[{\"permissionName\":\"ci\",\"isDataAction\":false},{\"permissionName\":\"fx\",\"isDataAction\":false},{\"permissionName\":\"xnbkkj\",\"isDataAction\":true}]},\"id\":\"rnnqb\",\"name\":\"q\",\"type\":\"pizxqltgrdogyp\"},{\"properties\":{\"provider\":\"vbfihwuhvctafsr\",\"displayName\":\"rblmli\",\"description\":\"xihspnxwq\",\"resourceRegionType\":\"GlobalResource\",\"provisioningState\":\"Canceled\",\"supportedLocations\":[\"aklsbsbq\",\"qagwwrxaomz\",\"sgl\"],\"sourceResourceFormat\":\"czezkhhlt\",\"supportedScopesForSource\":[\"ResourceGroup\",\"Resource\"],\"areRegionalAndGlobalSourcesSupported\":true,\"additionalEnforcedPermissions\":[{\"permissionName\":\"qoyueayfbpcmsplb\",\"isDataAction\":false}]},\"id\":\"ueq\",\"name\":\"hwmgnmbscbbxig\",\"type\":\"hxiidlopedb\"},{\"properties\":{\"provider\":\"yqyybxubmdna\",\"displayName\":\"bqwremjela\",\"description\":\"cigeleohdbvqvw\",\"resourceRegionType\":\"GlobalResource\",\"provisioningState\":\"Deleting\",\"supportedLocations\":[\"eonrlkwzdqybxce\",\"kxcpt\",\"oqfyiaseqch\"],\"sourceResourceFormat\":\"ttzrazisgyki\",\"supportedScopesForSource\":[\"ManagementGroup\",\"ManagementGroup\"],\"areRegionalAndGlobalSourcesSupported\":true,\"additionalEnforcedPermissions\":[{\"permissionName\":\"hmnr\",\"isDataAction\":false},{\"permissionName\":\"ojklin\",\"isDataAction\":true},{\"permissionName\":\"tysprqsgnzxojpsl\",\"isDataAction\":false}]},\"id\":\"g\",\"name\":\"liufiqwoyxq\",\"type\":\"apcohhouc\"}]}") - .toObject(TopicTypesListResult.class); - Assertions.assertEquals("m", model.value().get(0).provider()); - Assertions.assertEquals("qipgx", model.value().get(0).displayName()); - Assertions.assertEquals("pomyqwcabvnuile", model.value().get(0).description()); - Assertions.assertEquals(ResourceRegionType.REGIONAL_RESOURCE, model.value().get(0).resourceRegionType()); - Assertions.assertEquals(TopicTypeProvisioningState.DELETING, model.value().get(0).provisioningState()); - Assertions.assertEquals("augmrmfjlr", model.value().get(0).supportedLocations().get(0)); - Assertions.assertEquals("ewxeiqbpsm", model.value().get(0).sourceResourceFormat()); - Assertions.assertEquals(TopicTypeSourceScope.RESOURCE_GROUP, - model.value().get(0).supportedScopesForSource().get(0)); - Assertions.assertEquals(true, model.value().get(0).areRegionalAndGlobalSourcesSupported()); - Assertions.assertEquals("l", model.value().get(0).additionalEnforcedPermissions().get(0).permissionName()); - Assertions.assertEquals(true, model.value().get(0).additionalEnforcedPermissions().get(0).isDataAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopicTypesListResult model - = new TopicTypesListResult() - .withValue( - Arrays.asList( - new TopicTypeInfoInner().withProvider("m") - .withDisplayName("qipgx") - .withDescription("pomyqwcabvnuile") - .withResourceRegionType(ResourceRegionType.REGIONAL_RESOURCE) - .withProvisioningState(TopicTypeProvisioningState.DELETING) - .withSupportedLocations( - Arrays.asList("augmrmfjlr", "wtoaukhfk", "cisiz", "oaedsxjwuivedwcg")) - .withSourceResourceFormat("ewxeiqbpsm") - .withSupportedScopesForSource( - Arrays.asList(TopicTypeSourceScope.RESOURCE_GROUP, TopicTypeSourceScope.RESOURCE)) - .withAreRegionalAndGlobalSourcesSupported(true) - .withAdditionalEnforcedPermissions(Arrays.asList( - new TopicTypeAdditionalEnforcedPermission().withPermissionName("l") - .withIsDataAction(true), - new TopicTypeAdditionalEnforcedPermission().withPermissionName("plzgaufcshhvn") - .withIsDataAction(true), - new TopicTypeAdditionalEnforcedPermission().withPermissionName("xkym") - .withIsDataAction(false), - new TopicTypeAdditionalEnforcedPermission() - .withPermissionName("xrjkixtwb") - .withIsDataAction(false))), - new TopicTypeInfoInner().withProvider("luzvxnq") - .withDisplayName("rpqpd") - .withDescription("mkoisqcssf") - .withResourceRegionType(ResourceRegionType.REGIONAL_RESOURCE) - .withProvisioningState(TopicTypeProvisioningState.CANCELED) - .withSupportedLocations(Arrays.asList("s", "p", "bkdq", "rdzsylollgtrczzy")) - .withSourceResourceFormat("xzji") - .withSupportedScopesForSource(Arrays.asList(TopicTypeSourceScope.AZURE_SUBSCRIPTION, - TopicTypeSourceScope.AZURE_SUBSCRIPTION)) - .withAreRegionalAndGlobalSourcesSupported(true) - .withAdditionalEnforcedPermissions(Arrays.asList( - new TopicTypeAdditionalEnforcedPermission().withPermissionName("ci") - .withIsDataAction(false), - new TopicTypeAdditionalEnforcedPermission().withPermissionName("fx") - .withIsDataAction(false), - new TopicTypeAdditionalEnforcedPermission().withPermissionName("xnbkkj") - .withIsDataAction(true))), - new TopicTypeInfoInner().withProvider("vbfihwuhvctafsr") - .withDisplayName("rblmli") - .withDescription("xihspnxwq") - .withResourceRegionType(ResourceRegionType.GLOBAL_RESOURCE) - .withProvisioningState(TopicTypeProvisioningState.CANCELED) - .withSupportedLocations(Arrays.asList("aklsbsbq", "qagwwrxaomz", "sgl")) - .withSourceResourceFormat("czezkhhlt") - .withSupportedScopesForSource( - Arrays.asList(TopicTypeSourceScope.RESOURCE_GROUP, TopicTypeSourceScope.RESOURCE)) - .withAreRegionalAndGlobalSourcesSupported(true) - .withAdditionalEnforcedPermissions( - Arrays.asList(new TopicTypeAdditionalEnforcedPermission() - .withPermissionName("qoyueayfbpcmsplb") - .withIsDataAction(false))), - new TopicTypeInfoInner().withProvider("yqyybxubmdna") - .withDisplayName("bqwremjela") - .withDescription("cigeleohdbvqvw") - .withResourceRegionType(ResourceRegionType.GLOBAL_RESOURCE) - .withProvisioningState(TopicTypeProvisioningState.DELETING) - .withSupportedLocations(Arrays.asList("eonrlkwzdqybxce", "kxcpt", "oqfyiaseqch")) - .withSourceResourceFormat("ttzrazisgyki") - .withSupportedScopesForSource(Arrays.asList(TopicTypeSourceScope.MANAGEMENT_GROUP, - TopicTypeSourceScope.MANAGEMENT_GROUP)) - .withAreRegionalAndGlobalSourcesSupported(true) - .withAdditionalEnforcedPermissions(Arrays.asList( - new TopicTypeAdditionalEnforcedPermission().withPermissionName("hmnr") - .withIsDataAction(false), - new TopicTypeAdditionalEnforcedPermission().withPermissionName("ojklin") - .withIsDataAction(true), - new TopicTypeAdditionalEnforcedPermission().withPermissionName("tysprqsgnzxojpsl") - .withIsDataAction(false))))); - model = BinaryData.fromObject(model).toObject(TopicTypesListResult.class); - Assertions.assertEquals("m", model.value().get(0).provider()); - Assertions.assertEquals("qipgx", model.value().get(0).displayName()); - Assertions.assertEquals("pomyqwcabvnuile", model.value().get(0).description()); - Assertions.assertEquals(ResourceRegionType.REGIONAL_RESOURCE, model.value().get(0).resourceRegionType()); - Assertions.assertEquals(TopicTypeProvisioningState.DELETING, model.value().get(0).provisioningState()); - Assertions.assertEquals("augmrmfjlr", model.value().get(0).supportedLocations().get(0)); - Assertions.assertEquals("ewxeiqbpsm", model.value().get(0).sourceResourceFormat()); - Assertions.assertEquals(TopicTypeSourceScope.RESOURCE_GROUP, - model.value().get(0).supportedScopesForSource().get(0)); - Assertions.assertEquals(true, model.value().get(0).areRegionalAndGlobalSourcesSupported()); - Assertions.assertEquals("l", model.value().get(0).additionalEnforcedPermissions().get(0).permissionName()); - Assertions.assertEquals(true, model.value().get(0).additionalEnforcedPermissions().get(0).isDataAction()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicUpdateParameterPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicUpdateParameterPropertiesTests.java deleted file mode 100644 index 25e30f1d1cd8..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicUpdateParameterPropertiesTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.TopicUpdateParameterProperties; -import com.azure.resourcemanager.eventgrid.models.DataResidencyBoundary; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.InboundIpRule; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TopicUpdateParameterPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopicUpdateParameterProperties model = BinaryData.fromString( - "{\"publicNetworkAccess\":\"Enabled\",\"inboundIpRules\":[{\"ipMask\":\"hvnh\",\"action\":\"Allow\"},{\"ipMask\":\"q\",\"action\":\"Allow\"},{\"ipMask\":\"jcjbt\",\"action\":\"Allow\"}],\"minimumTlsVersionAllowed\":\"1.1\",\"disableLocalAuth\":false,\"dataResidencyBoundary\":\"WithinGeopair\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"yhohujswtwkozzwc\":{\"description\":\"oqbeitpkxzt\",\"displayName\":\"ob\",\"documentationUrl\":\"ft\",\"dataSchemaUrl\":\"gfcwqmpimaqxzhem\"}}}}") - .toObject(TopicUpdateParameterProperties.class); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - Assertions.assertEquals("hvnh", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(TlsVersion.ONE_ONE, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(false, model.disableLocalAuth()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_GEOPAIR, model.dataResidencyBoundary()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("oqbeitpkxzt", - model.eventTypeInfo().inlineEventTypes().get("yhohujswtwkozzwc").description()); - Assertions.assertEquals("ob", model.eventTypeInfo().inlineEventTypes().get("yhohujswtwkozzwc").displayName()); - Assertions.assertEquals("ft", - model.eventTypeInfo().inlineEventTypes().get("yhohujswtwkozzwc").documentationUrl()); - Assertions.assertEquals("gfcwqmpimaqxzhem", - model.eventTypeInfo().inlineEventTypes().get("yhohujswtwkozzwc").dataSchemaUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopicUpdateParameterProperties model - = new TopicUpdateParameterProperties().withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withInboundIpRules(Arrays.asList(new InboundIpRule().withIpMask("hvnh").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("q").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("jcjbt").withAction(IpActionType.ALLOW))) - .withMinimumTlsVersionAllowed(TlsVersion.ONE_ONE) - .withDisableLocalAuth(false) - .withDataResidencyBoundary(DataResidencyBoundary.WITHIN_GEOPAIR) - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("yhohujswtwkozzwc", - new InlineEventProperties().withDescription("oqbeitpkxzt") - .withDisplayName("ob") - .withDocumentationUrl("ft") - .withDataSchemaUrl("gfcwqmpimaqxzhem")))); - model = BinaryData.fromObject(model).toObject(TopicUpdateParameterProperties.class); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - Assertions.assertEquals("hvnh", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(TlsVersion.ONE_ONE, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(false, model.disableLocalAuth()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_GEOPAIR, model.dataResidencyBoundary()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("oqbeitpkxzt", - model.eventTypeInfo().inlineEventTypes().get("yhohujswtwkozzwc").description()); - Assertions.assertEquals("ob", model.eventTypeInfo().inlineEventTypes().get("yhohujswtwkozzwc").displayName()); - Assertions.assertEquals("ft", - model.eventTypeInfo().inlineEventTypes().get("yhohujswtwkozzwc").documentationUrl()); - Assertions.assertEquals("gfcwqmpimaqxzhem", - model.eventTypeInfo().inlineEventTypes().get("yhohujswtwkozzwc").dataSchemaUrl()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicUpdateParametersTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicUpdateParametersTests.java deleted file mode 100644 index fd4d1ea30569..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicUpdateParametersTests.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.DataResidencyBoundary; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.InboundIpRule; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import com.azure.resourcemanager.eventgrid.models.TopicUpdateParameters; -import com.azure.resourcemanager.eventgrid.models.UserIdentityProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TopicUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopicUpdateParameters model = BinaryData.fromString( - "{\"tags\":{\"vxilcbt\":\"cvwmzhwplefa\",\"jfzqlqhycavodgg\":\"nhnzeyqxt\",\"nlrariaawiuagy\":\"dbeesmie\"},\"identity\":{\"type\":\"SystemAssigned\",\"principalId\":\"ylyrfgiagtco\",\"tenantId\":\"cqwogfnzjvusfzl\",\"userAssignedIdentities\":{\"tgkbugrjqctojc\":{\"principalId\":\"uxylfsbtkadpy\",\"clientId\":\"wn\"},\"lcplc\":{\"principalId\":\"sofieypefojyqd\",\"clientId\":\"u\"},\"cjhfgmvecactxmw\":{\"principalId\":\"hihihlhzdsqtzbsr\",\"clientId\":\"o\"},\"uwifzmpjwyiv\":{\"principalId\":\"e\",\"clientId\":\"wcluqovekqvgq\"}}},\"properties\":{\"publicNetworkAccess\":\"Enabled\",\"inboundIpRules\":[{\"ipMask\":\"hrfsphuagrtti\",\"action\":\"Allow\"},{\"ipMask\":\"sqczkvyklxubyj\",\"action\":\"Allow\"}],\"minimumTlsVersionAllowed\":\"1.0\",\"disableLocalAuth\":false,\"dataResidencyBoundary\":\"WithinGeopair\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"apzhyrpetoge\":{\"description\":\"qibrtalme\",\"displayName\":\"t\",\"documentationUrl\":\"dslqxihhrmooizqs\",\"dataSchemaUrl\":\"pxiutc\"}}}}}") - .toObject(TopicUpdateParameters.class); - Assertions.assertEquals("cvwmzhwplefa", model.tags().get("vxilcbt")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("ylyrfgiagtco", model.identity().principalId()); - Assertions.assertEquals("cqwogfnzjvusfzl", model.identity().tenantId()); - Assertions.assertEquals("uxylfsbtkadpy", - model.identity().userAssignedIdentities().get("tgkbugrjqctojc").principalId()); - Assertions.assertEquals("wn", model.identity().userAssignedIdentities().get("tgkbugrjqctojc").clientId()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - Assertions.assertEquals("hrfsphuagrtti", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(TlsVersion.ONE_ZERO, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(false, model.disableLocalAuth()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_GEOPAIR, model.dataResidencyBoundary()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("qibrtalme", - model.eventTypeInfo().inlineEventTypes().get("apzhyrpetoge").description()); - Assertions.assertEquals("t", model.eventTypeInfo().inlineEventTypes().get("apzhyrpetoge").displayName()); - Assertions.assertEquals("dslqxihhrmooizqs", - model.eventTypeInfo().inlineEventTypes().get("apzhyrpetoge").documentationUrl()); - Assertions.assertEquals("pxiutc", model.eventTypeInfo().inlineEventTypes().get("apzhyrpetoge").dataSchemaUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopicUpdateParameters model = new TopicUpdateParameters() - .withTags(mapOf("vxilcbt", "cvwmzhwplefa", "jfzqlqhycavodgg", "nhnzeyqxt", "nlrariaawiuagy", "dbeesmie")) - .withIdentity(new IdentityInfo().withType(IdentityType.SYSTEM_ASSIGNED) - .withPrincipalId("ylyrfgiagtco") - .withTenantId("cqwogfnzjvusfzl") - .withUserAssignedIdentities(mapOf("tgkbugrjqctojc", - new UserIdentityProperties().withPrincipalId("uxylfsbtkadpy").withClientId("wn"), "lcplc", - new UserIdentityProperties().withPrincipalId("sofieypefojyqd").withClientId("u"), "cjhfgmvecactxmw", - new UserIdentityProperties().withPrincipalId("hihihlhzdsqtzbsr").withClientId("o"), "uwifzmpjwyiv", - new UserIdentityProperties().withPrincipalId("e").withClientId("wcluqovekqvgq")))) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withInboundIpRules( - Arrays.asList(new InboundIpRule().withIpMask("hrfsphuagrtti").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("sqczkvyklxubyj").withAction(IpActionType.ALLOW))) - .withMinimumTlsVersionAllowed(TlsVersion.ONE_ZERO) - .withDisableLocalAuth(false) - .withDataResidencyBoundary(DataResidencyBoundary.WITHIN_GEOPAIR) - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("apzhyrpetoge", - new InlineEventProperties().withDescription("qibrtalme") - .withDisplayName("t") - .withDocumentationUrl("dslqxihhrmooizqs") - .withDataSchemaUrl("pxiutc")))); - model = BinaryData.fromObject(model).toObject(TopicUpdateParameters.class); - Assertions.assertEquals("cvwmzhwplefa", model.tags().get("vxilcbt")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("ylyrfgiagtco", model.identity().principalId()); - Assertions.assertEquals("cqwogfnzjvusfzl", model.identity().tenantId()); - Assertions.assertEquals("uxylfsbtkadpy", - model.identity().userAssignedIdentities().get("tgkbugrjqctojc").principalId()); - Assertions.assertEquals("wn", model.identity().userAssignedIdentities().get("tgkbugrjqctojc").clientId()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.publicNetworkAccess()); - Assertions.assertEquals("hrfsphuagrtti", model.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.inboundIpRules().get(0).action()); - Assertions.assertEquals(TlsVersion.ONE_ZERO, model.minimumTlsVersionAllowed()); - Assertions.assertEquals(false, model.disableLocalAuth()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_GEOPAIR, model.dataResidencyBoundary()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.eventTypeInfo().kind()); - Assertions.assertEquals("qibrtalme", - model.eventTypeInfo().inlineEventTypes().get("apzhyrpetoge").description()); - Assertions.assertEquals("t", model.eventTypeInfo().inlineEventTypes().get("apzhyrpetoge").displayName()); - Assertions.assertEquals("dslqxihhrmooizqs", - model.eventTypeInfo().inlineEventTypes().get("apzhyrpetoge").documentationUrl()); - Assertions.assertEquals("pxiutc", model.eventTypeInfo().inlineEventTypes().get("apzhyrpetoge").dataSchemaUrl()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicsConfigurationTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicsConfigurationTests.java deleted file mode 100644 index 19af7c9f1a77..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicsConfigurationTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.CustomDomainConfiguration; -import com.azure.resourcemanager.eventgrid.models.CustomDomainIdentity; -import com.azure.resourcemanager.eventgrid.models.CustomDomainIdentityType; -import com.azure.resourcemanager.eventgrid.models.CustomDomainValidationState; -import com.azure.resourcemanager.eventgrid.models.TopicsConfiguration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class TopicsConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopicsConfiguration model = BinaryData.fromString( - "{\"hostname\":\"h\",\"customDomains\":[{\"fullyQualifiedDomainName\":\"wpracstwitykhev\",\"validationState\":\"Approved\",\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"nmdyodnwzxl\"},\"certificateUrl\":\"cvnhltiugc\",\"expectedTxtRecordName\":\"avvwxqi\",\"expectedTxtRecordValue\":\"qunyowxwlmdjr\"},{\"fullyQualifiedDomainName\":\"vfgbvfvpdboda\",\"validationState\":\"ErrorRetrievingDnsRecord\",\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentity\":\"hkr\"},\"certificateUrl\":\"bdeibqipqk\",\"expectedTxtRecordName\":\"vxndz\",\"expectedTxtRecordValue\":\"krefajpjo\"},{\"fullyQualifiedDomainName\":\"wkqnyhg\",\"validationState\":\"Pending\",\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"fxzsjabibsyst\"},\"certificateUrl\":\"fsdjpvkvp\",\"expectedTxtRecordName\":\"xbkzbzkdvncj\",\"expectedTxtRecordValue\":\"udurgkakmokz\"}]}") - .toObject(TopicsConfiguration.class); - Assertions.assertEquals("wpracstwitykhev", model.customDomains().get(0).fullyQualifiedDomainName()); - Assertions.assertEquals(CustomDomainValidationState.APPROVED, model.customDomains().get(0).validationState()); - Assertions.assertEquals(CustomDomainIdentityType.USER_ASSIGNED, model.customDomains().get(0).identity().type()); - Assertions.assertEquals("nmdyodnwzxl", model.customDomains().get(0).identity().userAssignedIdentity()); - Assertions.assertEquals("cvnhltiugc", model.customDomains().get(0).certificateUrl()); - Assertions.assertEquals("avvwxqi", model.customDomains().get(0).expectedTxtRecordName()); - Assertions.assertEquals("qunyowxwlmdjr", model.customDomains().get(0).expectedTxtRecordValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopicsConfiguration model = new TopicsConfiguration().withCustomDomains(Arrays.asList( - new CustomDomainConfiguration().withFullyQualifiedDomainName("wpracstwitykhev") - .withValidationState(CustomDomainValidationState.APPROVED) - .withIdentity(new CustomDomainIdentity().withType(CustomDomainIdentityType.USER_ASSIGNED) - .withUserAssignedIdentity("nmdyodnwzxl")) - .withCertificateUrl("cvnhltiugc") - .withExpectedTxtRecordName("avvwxqi") - .withExpectedTxtRecordValue("qunyowxwlmdjr"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("vfgbvfvpdboda") - .withValidationState(CustomDomainValidationState.ERROR_RETRIEVING_DNS_RECORD) - .withIdentity(new CustomDomainIdentity().withType(CustomDomainIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentity("hkr")) - .withCertificateUrl("bdeibqipqk") - .withExpectedTxtRecordName("vxndz") - .withExpectedTxtRecordValue("krefajpjo"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("wkqnyhg") - .withValidationState(CustomDomainValidationState.PENDING) - .withIdentity(new CustomDomainIdentity().withType(CustomDomainIdentityType.USER_ASSIGNED) - .withUserAssignedIdentity("fxzsjabibsyst")) - .withCertificateUrl("fsdjpvkvp") - .withExpectedTxtRecordName("xbkzbzkdvncj") - .withExpectedTxtRecordValue("udurgkakmokz"))); - model = BinaryData.fromObject(model).toObject(TopicsConfiguration.class); - Assertions.assertEquals("wpracstwitykhev", model.customDomains().get(0).fullyQualifiedDomainName()); - Assertions.assertEquals(CustomDomainValidationState.APPROVED, model.customDomains().get(0).validationState()); - Assertions.assertEquals(CustomDomainIdentityType.USER_ASSIGNED, model.customDomains().get(0).identity().type()); - Assertions.assertEquals("nmdyodnwzxl", model.customDomains().get(0).identity().userAssignedIdentity()); - Assertions.assertEquals("cvnhltiugc", model.customDomains().get(0).certificateUrl()); - Assertions.assertEquals("avvwxqi", model.customDomains().get(0).expectedTxtRecordName()); - Assertions.assertEquals("qunyowxwlmdjr", model.customDomains().get(0).expectedTxtRecordValue()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicsGetByResourceGroupWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index fdbc684b0df9..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.DataResidencyBoundary; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.InputSchema; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import com.azure.resourcemanager.eventgrid.models.Topic; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class TopicsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"q\",\"zpdgonjhxshthmgp\",\"zqulptkbv\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Succeeded\"},\"id\":\"zhigqqbtimpkj\",\"name\":\"lornsihqh\",\"type\":\"dsmusuaawjakxwj\"}],\"provisioningState\":\"Updating\",\"endpoint\":\"mnn\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"vlkpzwb\":{\"description\":\"ba\",\"displayName\":\"sjtgirnbgmgmddo\",\"documentationUrl\":\"mynltwmpftmfoeaj\",\"dataSchemaUrl\":\"syxwetamfdd\"},\"rrihufoi\":{\"description\":\"recchdidrmu\",\"displayName\":\"ahmjedbiu\",\"documentationUrl\":\"khhwmj\",\"dataSchemaUrl\":\"bweunxc\"}}},\"minimumTlsVersionAllowed\":\"1.0\",\"inputSchema\":\"CustomEventSchema\",\"inputSchemaMapping\":{\"inputSchemaMappingType\":\"InputSchemaMapping\"},\"metricResourceId\":\"vgnzuzpbgkzcsc\",\"publicNetworkAccess\":\"Disabled\",\"inboundIpRules\":[{\"ipMask\":\"unhdimjuk\",\"action\":\"Allow\"},{\"ipMask\":\"kaugpucdocfqplwg\",\"action\":\"Allow\"}],\"disableLocalAuth\":false,\"dataResidencyBoundary\":\"WithinRegion\"},\"identity\":{\"type\":\"SystemAssigned, UserAssigned\",\"principalId\":\"klkvb\",\"tenantId\":\"kyjtkakvl\",\"userAssignedIdentities\":{\"nujvqynvavi\":{\"principalId\":\"jvpzaptuoskaoiz\",\"clientId\":\"xwfgcdiykkcx\"},\"quddrwjclj\":{\"principalId\":\"dmuqohhi\",\"clientId\":\"a\"},\"fhxrzfr\":{\"principalId\":\"hlhpvzadb\",\"clientId\":\"nnin\"},\"xgcbvzarmqcbp\":{\"principalId\":\"ztiucwviql\",\"clientId\":\"khkrc\"}}},\"location\":\"stsinvag\",\"tags\":{\"dvcehqw\":\"yhdrxb\",\"buwvorba\":\"itxnmxgnmgu\"},\"id\":\"kjnbkbdhlltqstq\",\"name\":\"qsygxiynec\",\"type\":\"vagzkheuba\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - Topic response = manager.topics() - .getByResourceGroupWithResponse("rbypi", "dbkp", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("stsinvag", response.location()); - Assertions.assertEquals("yhdrxb", response.tags().get("dvcehqw")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("klkvb", response.identity().principalId()); - Assertions.assertEquals("kyjtkakvl", response.identity().tenantId()); - Assertions.assertEquals("jvpzaptuoskaoiz", - response.identity().userAssignedIdentities().get("nujvqynvavi").principalId()); - Assertions.assertEquals("xwfgcdiykkcx", - response.identity().userAssignedIdentities().get("nujvqynvavi").clientId()); - Assertions.assertEquals(EventDefinitionKind.INLINE, response.eventTypeInfo().kind()); - Assertions.assertEquals("ba", response.eventTypeInfo().inlineEventTypes().get("vlkpzwb").description()); - Assertions.assertEquals("sjtgirnbgmgmddo", - response.eventTypeInfo().inlineEventTypes().get("vlkpzwb").displayName()); - Assertions.assertEquals("mynltwmpftmfoeaj", - response.eventTypeInfo().inlineEventTypes().get("vlkpzwb").documentationUrl()); - Assertions.assertEquals("syxwetamfdd", - response.eventTypeInfo().inlineEventTypes().get("vlkpzwb").dataSchemaUrl()); - Assertions.assertEquals(TlsVersion.ONE_ZERO, response.minimumTlsVersionAllowed()); - Assertions.assertEquals(InputSchema.CUSTOM_EVENT_SCHEMA, response.inputSchema()); - Assertions.assertEquals(PublicNetworkAccess.DISABLED, response.publicNetworkAccess()); - Assertions.assertEquals("unhdimjuk", response.inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, response.inboundIpRules().get(0).action()); - Assertions.assertEquals(false, response.disableLocalAuth()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_REGION, response.dataResidencyBoundary()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicsListByResourceGroupMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicsListByResourceGroupMockTests.java deleted file mode 100644 index 28f56f2d05a0..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicsListByResourceGroupMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.DataResidencyBoundary; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.InputSchema; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import com.azure.resourcemanager.eventgrid.models.Topic; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class TopicsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"itoqcahfsg\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Canceled\"},\"id\":\"reesrfwsszvl\",\"name\":\"wliso\",\"type\":\"ntfxxcrqmipfjwfo\"},{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"s\",\"xxbaizabuln\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Canceled\"},\"id\":\"jtoxjdzjsj\",\"name\":\"nvhxqqmqip\",\"type\":\"y\"},{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"ocxm\",\"fshksnyzmspamwb\",\"m\",\"nlslcef\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Failed\"},\"id\":\"twtkvih\",\"name\":\"pfliwo\",\"type\":\"nguuzhwvla\"},{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"jha\",\"sybkekymffzt\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Succeeded\"},\"id\":\"c\",\"name\":\"qs\",\"type\":\"eiihfymko\"}],\"provisioningState\":\"Creating\",\"endpoint\":\"eseuugci\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"izpacz\":{\"description\":\"gbvm\",\"displayName\":\"wrqbebjnfv\",\"documentationUrl\":\"labt\",\"dataSchemaUrl\":\"biwznhtfgficudy\"}}},\"minimumTlsVersionAllowed\":\"1.0\",\"inputSchema\":\"EventGridSchema\",\"inputSchemaMapping\":{\"inputSchemaMappingType\":\"InputSchemaMapping\"},\"metricResourceId\":\"znhokhoitwhrjsd\",\"publicNetworkAccess\":\"Enabled\",\"inboundIpRules\":[{\"ipMask\":\"ckidbjpglhzqpxzb\",\"action\":\"Allow\"},{\"ipMask\":\"kcdgfhbssd\",\"action\":\"Allow\"},{\"ipMask\":\"oq\",\"action\":\"Allow\"},{\"ipMask\":\"ecf\",\"action\":\"Allow\"}],\"disableLocalAuth\":false,\"dataResidencyBoundary\":\"WithinRegion\"},\"identity\":{\"type\":\"SystemAssigned, UserAssigned\",\"principalId\":\"qrshzzbgullcxiq\",\"tenantId\":\"jkoxdupna\",\"userAssignedIdentities\":{\"gd\":{\"principalId\":\"ouigdmfivjqte\",\"clientId\":\"qq\"},\"yhhmvfxl\":{\"principalId\":\"kghpcv\",\"clientId\":\"qirvtk\"},\"qlujqgi\":{\"principalId\":\"jajodmkrr\",\"clientId\":\"pgqvqo\"}}},\"location\":\"bwlyvxc\",\"tags\":{\"s\":\"vctsfaeuhw\",\"lppdpgz\":\"nstvzuzhasup\"},\"id\":\"zqazvb\",\"name\":\"arkptgongruatsyi\",\"type\":\"sjqhenigbeqngu\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.topics() - .listByResourceGroup("rlxcznnhz", "bnbmxlxm", 1892710553, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("bwlyvxc", response.iterator().next().location()); - Assertions.assertEquals("vctsfaeuhw", response.iterator().next().tags().get("s")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, - response.iterator().next().identity().type()); - Assertions.assertEquals("qrshzzbgullcxiq", response.iterator().next().identity().principalId()); - Assertions.assertEquals("jkoxdupna", response.iterator().next().identity().tenantId()); - Assertions.assertEquals("ouigdmfivjqte", - response.iterator().next().identity().userAssignedIdentities().get("gd").principalId()); - Assertions.assertEquals("qq", - response.iterator().next().identity().userAssignedIdentities().get("gd").clientId()); - Assertions.assertEquals(EventDefinitionKind.INLINE, response.iterator().next().eventTypeInfo().kind()); - Assertions.assertEquals("gbvm", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("izpacz").description()); - Assertions.assertEquals("wrqbebjnfv", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("izpacz").displayName()); - Assertions.assertEquals("labt", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("izpacz").documentationUrl()); - Assertions.assertEquals("biwznhtfgficudy", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("izpacz").dataSchemaUrl()); - Assertions.assertEquals(TlsVersion.ONE_ZERO, response.iterator().next().minimumTlsVersionAllowed()); - Assertions.assertEquals(InputSchema.EVENT_GRID_SCHEMA, response.iterator().next().inputSchema()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, response.iterator().next().publicNetworkAccess()); - Assertions.assertEquals("ckidbjpglhzqpxzb", response.iterator().next().inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, response.iterator().next().inboundIpRules().get(0).action()); - Assertions.assertEquals(false, response.iterator().next().disableLocalAuth()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_REGION, - response.iterator().next().dataResidencyBoundary()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicsListEventTypesMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicsListEventTypesMockTests.java deleted file mode 100644 index 7a0eda813ded..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicsListEventTypesMockTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.EventType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class TopicsListEventTypesMockTests { - @Test - public void testListEventTypes() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"displayName\":\"zshxzezbzuz\",\"description\":\"l\",\"schemaUrl\":\"zskejcgwfsgqksty\",\"isInDefaultSet\":false},\"id\":\"pyuijp\",\"name\":\"rdavsjcfmazpzdq\",\"type\":\"uzvcmcok\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.topics() - .listEventTypes("rdlhvdvmiphbe", "eqjzm", "kdclacroczf", "unerke", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("zshxzezbzuz", response.iterator().next().displayName()); - Assertions.assertEquals("l", response.iterator().next().description()); - Assertions.assertEquals("zskejcgwfsgqksty", response.iterator().next().schemaUrl()); - Assertions.assertEquals(false, response.iterator().next().isInDefaultSet()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicsListMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicsListMockTests.java deleted file mode 100644 index 1999c864328e..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicsListMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.DataResidencyBoundary; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.InputSchema; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import com.azure.resourcemanager.eventgrid.models.Topic; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class TopicsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"wzlzklasl\",\"acizuxlr\",\"rwpewsa\",\"doejtighsxjpyt\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Canceled\"},\"id\":\"alahovuuwxhm\",\"name\":\"hjnhjiot\",\"type\":\"ffbbcngkegxcypxb\"},{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"ilyrzoxp\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Canceled\"},\"id\":\"frolq\",\"name\":\"wnk\",\"type\":\"u\"},{\"properties\":{\"privateEndpoint\":{},\"groupIds\":[\"ahwkxjjm\",\"tnlmsoodtmvecdhd\"],\"privateLinkServiceConnectionState\":{},\"provisioningState\":\"Canceled\"},\"id\":\"rptveajczxvl\",\"name\":\"srg\",\"type\":\"rfizr\"}],\"provisioningState\":\"Creating\",\"endpoint\":\"ptyu\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"pcf\":{\"description\":\"k\",\"displayName\":\"pfuofixcnpcfykkp\",\"documentationUrl\":\"cpawmp\",\"dataSchemaUrl\":\"rdpwrpc\"}}},\"minimumTlsVersionAllowed\":\"1.1\",\"inputSchema\":\"CustomEventSchema\",\"inputSchemaMapping\":{\"inputSchemaMappingType\":\"InputSchemaMapping\"},\"metricResourceId\":\"awkgy\",\"publicNetworkAccess\":\"Enabled\",\"inboundIpRules\":[{\"ipMask\":\"nnidmdiawpzxk\",\"action\":\"Allow\"},{\"ipMask\":\"mkctdhuo\",\"action\":\"Allow\"}],\"disableLocalAuth\":true,\"dataResidencyBoundary\":\"WithinRegion\"},\"identity\":{\"type\":\"None\",\"principalId\":\"qodvqgcnbhcbmj\",\"tenantId\":\"ti\",\"userAssignedIdentities\":{\"gjrhs\":{\"principalId\":\"ntsxjmfmeftvh\",\"clientId\":\"o\"}}},\"location\":\"w\",\"tags\":{\"u\":\"g\",\"fdz\":\"cfogxhcxnwjt\",\"uzfwo\":\"c\",\"ednlwglihezo\":\"wakukzkdtzxs\"},\"id\":\"ucmqgisnione\",\"name\":\"bzdrdpuenxkgt\",\"type\":\"zlm\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.topics().list("lxu", 1027956751, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("w", response.iterator().next().location()); - Assertions.assertEquals("g", response.iterator().next().tags().get("u")); - Assertions.assertEquals(IdentityType.NONE, response.iterator().next().identity().type()); - Assertions.assertEquals("qodvqgcnbhcbmj", response.iterator().next().identity().principalId()); - Assertions.assertEquals("ti", response.iterator().next().identity().tenantId()); - Assertions.assertEquals("ntsxjmfmeftvh", - response.iterator().next().identity().userAssignedIdentities().get("gjrhs").principalId()); - Assertions.assertEquals("o", - response.iterator().next().identity().userAssignedIdentities().get("gjrhs").clientId()); - Assertions.assertEquals(EventDefinitionKind.INLINE, response.iterator().next().eventTypeInfo().kind()); - Assertions.assertEquals("k", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("pcf").description()); - Assertions.assertEquals("pfuofixcnpcfykkp", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("pcf").displayName()); - Assertions.assertEquals("cpawmp", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("pcf").documentationUrl()); - Assertions.assertEquals("rdpwrpc", - response.iterator().next().eventTypeInfo().inlineEventTypes().get("pcf").dataSchemaUrl()); - Assertions.assertEquals(TlsVersion.ONE_ONE, response.iterator().next().minimumTlsVersionAllowed()); - Assertions.assertEquals(InputSchema.CUSTOM_EVENT_SCHEMA, response.iterator().next().inputSchema()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, response.iterator().next().publicNetworkAccess()); - Assertions.assertEquals("nnidmdiawpzxk", response.iterator().next().inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, response.iterator().next().inboundIpRules().get(0).action()); - Assertions.assertEquals(true, response.iterator().next().disableLocalAuth()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_REGION, - response.iterator().next().dataResidencyBoundary()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicsListResultTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicsListResultTests.java deleted file mode 100644 index fd6dfe030aaa..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/TopicsListResultTests.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.TopicInner; -import com.azure.resourcemanager.eventgrid.models.DataResidencyBoundary; -import com.azure.resourcemanager.eventgrid.models.EventDefinitionKind; -import com.azure.resourcemanager.eventgrid.models.EventTypeInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityInfo; -import com.azure.resourcemanager.eventgrid.models.IdentityType; -import com.azure.resourcemanager.eventgrid.models.InboundIpRule; -import com.azure.resourcemanager.eventgrid.models.InlineEventProperties; -import com.azure.resourcemanager.eventgrid.models.InputSchema; -import com.azure.resourcemanager.eventgrid.models.InputSchemaMapping; -import com.azure.resourcemanager.eventgrid.models.IpActionType; -import com.azure.resourcemanager.eventgrid.models.PublicNetworkAccess; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import com.azure.resourcemanager.eventgrid.models.TopicsListResult; -import com.azure.resourcemanager.eventgrid.models.UserIdentityProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TopicsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopicsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"privateEndpointConnections\":[{\"properties\":{},\"id\":\"fajnjwltlwtjjguk\",\"name\":\"alhsnvkc\",\"type\":\"mxzrpoa\"},{\"properties\":{},\"id\":\"lnwiaaomylwe\",\"name\":\"z\",\"type\":\"lcsethwwnpj\"}],\"provisioningState\":\"Failed\",\"endpoint\":\"swpchwahfbousn\",\"eventTypeInfo\":{\"kind\":\"Inline\",\"inlineEventTypes\":{\"wetwlyxgncxykxh\":{},\"jhlimmbcxfhbcpo\":{},\"xvxcjzhq\":{},\"zxfpxtgqsc\":{}}},\"minimumTlsVersionAllowed\":\"1.2\",\"inputSchema\":\"CustomEventSchema\",\"inputSchemaMapping\":{\"inputSchemaMappingType\":\"InputSchemaMapping\"},\"metricResourceId\":\"hdqazkmtgguwp\",\"publicNetworkAccess\":\"Enabled\",\"inboundIpRules\":[{\"ipMask\":\"ivmmghfcfiwrxgk\",\"action\":\"Allow\"},{\"ipMask\":\"yinzqodfvpgs\",\"action\":\"Allow\"}],\"disableLocalAuth\":true,\"dataResidencyBoundary\":\"WithinGeopair\"},\"identity\":{\"type\":\"UserAssigned\",\"principalId\":\"djtxvzflbq\",\"tenantId\":\"aqvlgafcqusr\",\"userAssignedIdentities\":{\"dxukuqgsjjxundxg\":{\"principalId\":\"nwsdtutnwlduyc\",\"clientId\":\"zhyrmewipmve\"},\"uneqsxvmhf\":{\"principalId\":\"twzhhzjhfjmhv\",\"clientId\":\"uvgp\"},\"hudypohyuemsl\":{\"principalId\":\"zjyi\",\"clientId\":\"as\"}}},\"location\":\"sqy\",\"tags\":{\"nygq\":\"oobrlttyms\",\"hqlyvijo\":\"nfwqzdzgtilaxhn\",\"zunbixx\":\"wivkxo\"},\"id\":\"ti\",\"name\":\"vcpwpgclrc\",\"type\":\"vtsoxf\"}],\"nextLink\":\"enxpmyyefr\"}") - .toObject(TopicsListResult.class); - Assertions.assertEquals("sqy", model.value().get(0).location()); - Assertions.assertEquals("oobrlttyms", model.value().get(0).tags().get("nygq")); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("djtxvzflbq", model.value().get(0).identity().principalId()); - Assertions.assertEquals("aqvlgafcqusr", model.value().get(0).identity().tenantId()); - Assertions.assertEquals("nwsdtutnwlduyc", - model.value().get(0).identity().userAssignedIdentities().get("dxukuqgsjjxundxg").principalId()); - Assertions.assertEquals("zhyrmewipmve", - model.value().get(0).identity().userAssignedIdentities().get("dxukuqgsjjxundxg").clientId()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.value().get(0).eventTypeInfo().kind()); - Assertions.assertEquals(TlsVersion.ONE_TWO, model.value().get(0).minimumTlsVersionAllowed()); - Assertions.assertEquals(InputSchema.CUSTOM_EVENT_SCHEMA, model.value().get(0).inputSchema()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.value().get(0).publicNetworkAccess()); - Assertions.assertEquals("ivmmghfcfiwrxgk", model.value().get(0).inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.value().get(0).inboundIpRules().get(0).action()); - Assertions.assertEquals(true, model.value().get(0).disableLocalAuth()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_GEOPAIR, model.value().get(0).dataResidencyBoundary()); - Assertions.assertEquals("enxpmyyefr", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopicsListResult model = new TopicsListResult().withValue(Arrays.asList(new TopicInner().withLocation("sqy") - .withTags(mapOf("nygq", "oobrlttyms", "hqlyvijo", "nfwqzdzgtilaxhn", "zunbixx", "wivkxo")) - .withIdentity(new IdentityInfo().withType(IdentityType.USER_ASSIGNED) - .withPrincipalId("djtxvzflbq") - .withTenantId("aqvlgafcqusr") - .withUserAssignedIdentities(mapOf("dxukuqgsjjxundxg", - new UserIdentityProperties().withPrincipalId("nwsdtutnwlduyc").withClientId("zhyrmewipmve"), - "uneqsxvmhf", new UserIdentityProperties().withPrincipalId("twzhhzjhfjmhv").withClientId("uvgp"), - "hudypohyuemsl", new UserIdentityProperties().withPrincipalId("zjyi").withClientId("as")))) - .withEventTypeInfo(new EventTypeInfo().withKind(EventDefinitionKind.INLINE) - .withInlineEventTypes(mapOf("wetwlyxgncxykxh", new InlineEventProperties(), "jhlimmbcxfhbcpo", - new InlineEventProperties(), "xvxcjzhq", new InlineEventProperties(), "zxfpxtgqsc", - new InlineEventProperties()))) - .withMinimumTlsVersionAllowed(TlsVersion.ONE_TWO) - .withInputSchema(InputSchema.CUSTOM_EVENT_SCHEMA) - .withInputSchemaMapping(new InputSchemaMapping()) - .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) - .withInboundIpRules( - Arrays.asList(new InboundIpRule().withIpMask("ivmmghfcfiwrxgk").withAction(IpActionType.ALLOW), - new InboundIpRule().withIpMask("yinzqodfvpgs").withAction(IpActionType.ALLOW))) - .withDisableLocalAuth(true) - .withDataResidencyBoundary(DataResidencyBoundary.WITHIN_GEOPAIR))).withNextLink("enxpmyyefr"); - model = BinaryData.fromObject(model).toObject(TopicsListResult.class); - Assertions.assertEquals("sqy", model.value().get(0).location()); - Assertions.assertEquals("oobrlttyms", model.value().get(0).tags().get("nygq")); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("djtxvzflbq", model.value().get(0).identity().principalId()); - Assertions.assertEquals("aqvlgafcqusr", model.value().get(0).identity().tenantId()); - Assertions.assertEquals("nwsdtutnwlduyc", - model.value().get(0).identity().userAssignedIdentities().get("dxukuqgsjjxundxg").principalId()); - Assertions.assertEquals("zhyrmewipmve", - model.value().get(0).identity().userAssignedIdentities().get("dxukuqgsjjxundxg").clientId()); - Assertions.assertEquals(EventDefinitionKind.INLINE, model.value().get(0).eventTypeInfo().kind()); - Assertions.assertEquals(TlsVersion.ONE_TWO, model.value().get(0).minimumTlsVersionAllowed()); - Assertions.assertEquals(InputSchema.CUSTOM_EVENT_SCHEMA, model.value().get(0).inputSchema()); - Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.value().get(0).publicNetworkAccess()); - Assertions.assertEquals("ivmmghfcfiwrxgk", model.value().get(0).inboundIpRules().get(0).ipMask()); - Assertions.assertEquals(IpActionType.ALLOW, model.value().get(0).inboundIpRules().get(0).action()); - Assertions.assertEquals(true, model.value().get(0).disableLocalAuth()); - Assertions.assertEquals(DataResidencyBoundary.WITHIN_GEOPAIR, model.value().get(0).dataResidencyBoundary()); - Assertions.assertEquals("enxpmyyefr", model.nextLink()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/UpdateTopicsConfigurationInfoTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/UpdateTopicsConfigurationInfoTests.java deleted file mode 100644 index b044e7e14dcd..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/UpdateTopicsConfigurationInfoTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.CustomDomainConfiguration; -import com.azure.resourcemanager.eventgrid.models.CustomDomainIdentity; -import com.azure.resourcemanager.eventgrid.models.CustomDomainIdentityType; -import com.azure.resourcemanager.eventgrid.models.CustomDomainValidationState; -import com.azure.resourcemanager.eventgrid.models.UpdateTopicsConfigurationInfo; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UpdateTopicsConfigurationInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateTopicsConfigurationInfo model = BinaryData.fromString( - "{\"customDomains\":[{\"fullyQualifiedDomainName\":\"opgxedkowepb\",\"validationState\":\"Pending\",\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentity\":\"wccsnjvcdwxlpqek\"},\"certificateUrl\":\"nkhtjsyingw\",\"expectedTxtRecordName\":\"atmtdhtmdvy\",\"expectedTxtRecordValue\":\"ikdgszywkbir\"},{\"fullyQualifiedDomainName\":\"yuzhlhkjoqrvq\",\"validationState\":\"Approved\",\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"rv\"},\"certificateUrl\":\"upmfiibfg\",\"expectedTxtRecordName\":\"ioolvrwxkvtkkgll\",\"expectedTxtRecordValue\":\"jygvjayvbl\"},{\"fullyQualifiedDomainName\":\"hvkzuh\",\"validationState\":\"Approved\",\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"s\"},\"certificateUrl\":\"byrqufeg\",\"expectedTxtRecordName\":\"vwz\",\"expectedTxtRecordValue\":\"nhlmctlpdng\"},{\"fullyQualifiedDomainName\":\"tvgbmhrixkwmy\",\"validationState\":\"Pending\",\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentity\":\"rh\"},\"certificateUrl\":\"nai\",\"expectedTxtRecordName\":\"xccbdreaxhcex\",\"expectedTxtRecordValue\":\"rvqahqkghtpwi\"}]}") - .toObject(UpdateTopicsConfigurationInfo.class); - Assertions.assertEquals("opgxedkowepb", model.customDomains().get(0).fullyQualifiedDomainName()); - Assertions.assertEquals(CustomDomainValidationState.PENDING, model.customDomains().get(0).validationState()); - Assertions.assertEquals(CustomDomainIdentityType.SYSTEM_ASSIGNED, - model.customDomains().get(0).identity().type()); - Assertions.assertEquals("wccsnjvcdwxlpqek", model.customDomains().get(0).identity().userAssignedIdentity()); - Assertions.assertEquals("nkhtjsyingw", model.customDomains().get(0).certificateUrl()); - Assertions.assertEquals("atmtdhtmdvy", model.customDomains().get(0).expectedTxtRecordName()); - Assertions.assertEquals("ikdgszywkbir", model.customDomains().get(0).expectedTxtRecordValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateTopicsConfigurationInfo model = new UpdateTopicsConfigurationInfo().withCustomDomains(Arrays.asList( - new CustomDomainConfiguration().withFullyQualifiedDomainName("opgxedkowepb") - .withValidationState(CustomDomainValidationState.PENDING) - .withIdentity(new CustomDomainIdentity().withType(CustomDomainIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentity("wccsnjvcdwxlpqek")) - .withCertificateUrl("nkhtjsyingw") - .withExpectedTxtRecordName("atmtdhtmdvy") - .withExpectedTxtRecordValue("ikdgszywkbir"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("yuzhlhkjoqrvq") - .withValidationState(CustomDomainValidationState.APPROVED) - .withIdentity(new CustomDomainIdentity().withType(CustomDomainIdentityType.USER_ASSIGNED) - .withUserAssignedIdentity("rv")) - .withCertificateUrl("upmfiibfg") - .withExpectedTxtRecordName("ioolvrwxkvtkkgll") - .withExpectedTxtRecordValue("jygvjayvbl"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("hvkzuh") - .withValidationState(CustomDomainValidationState.APPROVED) - .withIdentity(new CustomDomainIdentity().withType(CustomDomainIdentityType.USER_ASSIGNED) - .withUserAssignedIdentity("s")) - .withCertificateUrl("byrqufeg") - .withExpectedTxtRecordName("vwz") - .withExpectedTxtRecordValue("nhlmctlpdng"), - new CustomDomainConfiguration().withFullyQualifiedDomainName("tvgbmhrixkwmy") - .withValidationState(CustomDomainValidationState.PENDING) - .withIdentity(new CustomDomainIdentity().withType(CustomDomainIdentityType.USER_ASSIGNED) - .withUserAssignedIdentity("rh")) - .withCertificateUrl("nai") - .withExpectedTxtRecordName("xccbdreaxhcex") - .withExpectedTxtRecordValue("rvqahqkghtpwi"))); - model = BinaryData.fromObject(model).toObject(UpdateTopicsConfigurationInfo.class); - Assertions.assertEquals("opgxedkowepb", model.customDomains().get(0).fullyQualifiedDomainName()); - Assertions.assertEquals(CustomDomainValidationState.PENDING, model.customDomains().get(0).validationState()); - Assertions.assertEquals(CustomDomainIdentityType.SYSTEM_ASSIGNED, - model.customDomains().get(0).identity().type()); - Assertions.assertEquals("wccsnjvcdwxlpqek", model.customDomains().get(0).identity().userAssignedIdentity()); - Assertions.assertEquals("nkhtjsyingw", model.customDomains().get(0).certificateUrl()); - Assertions.assertEquals("atmtdhtmdvy", model.customDomains().get(0).expectedTxtRecordName()); - Assertions.assertEquals("ikdgszywkbir", model.customDomains().get(0).expectedTxtRecordValue()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/UserIdentityPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/UserIdentityPropertiesTests.java deleted file mode 100644 index 9066dad1faa9..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/UserIdentityPropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.UserIdentityProperties; -import org.junit.jupiter.api.Assertions; - -public final class UserIdentityPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserIdentityProperties model = BinaryData.fromString("{\"principalId\":\"lopwiyig\",\"clientId\":\"pkdwzbai\"}") - .toObject(UserIdentityProperties.class); - Assertions.assertEquals("lopwiyig", model.principalId()); - Assertions.assertEquals("pkdwzbai", model.clientId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserIdentityProperties model - = new UserIdentityProperties().withPrincipalId("lopwiyig").withClientId("pkdwzbai"); - model = BinaryData.fromObject(model).toObject(UserIdentityProperties.class); - Assertions.assertEquals("lopwiyig", model.principalId()); - Assertions.assertEquals("pkdwzbai", model.clientId()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/VerifiedPartnerInnerTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/VerifiedPartnerInnerTests.java deleted file mode 100644 index 6810cacfceaa..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/VerifiedPartnerInnerTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.VerifiedPartnerInner; -import com.azure.resourcemanager.eventgrid.models.PartnerDetails; -import com.azure.resourcemanager.eventgrid.models.VerifiedPartnerProvisioningState; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; - -public final class VerifiedPartnerInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VerifiedPartnerInner model = BinaryData.fromString( - "{\"properties\":{\"partnerRegistrationImmutableId\":\"c7e86a55-f555-409f-b2db-3ea5eb82908b\",\"organizationName\":\"k\",\"partnerDisplayName\":\"hu\",\"partnerTopicDetails\":{\"description\":\"rctat\",\"longDescription\":\"intqpbrlcyr\",\"setupUri\":\"czkgofxyfsrucvcr\"},\"provisioningState\":\"Updating\"},\"id\":\"ttbst\",\"name\":\"jeaq\",\"type\":\"rmvvfkoxmlghktui\"}") - .toObject(VerifiedPartnerInner.class); - Assertions.assertEquals(UUID.fromString("c7e86a55-f555-409f-b2db-3ea5eb82908b"), - model.partnerRegistrationImmutableId()); - Assertions.assertEquals("k", model.organizationName()); - Assertions.assertEquals("hu", model.partnerDisplayName()); - Assertions.assertEquals("rctat", model.partnerTopicDetails().description()); - Assertions.assertEquals("intqpbrlcyr", model.partnerTopicDetails().longDescription()); - Assertions.assertEquals("czkgofxyfsrucvcr", model.partnerTopicDetails().setupUri()); - Assertions.assertEquals(VerifiedPartnerProvisioningState.UPDATING, model.provisioningState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VerifiedPartnerInner model = new VerifiedPartnerInner() - .withPartnerRegistrationImmutableId(UUID.fromString("c7e86a55-f555-409f-b2db-3ea5eb82908b")) - .withOrganizationName("k") - .withPartnerDisplayName("hu") - .withPartnerTopicDetails(new PartnerDetails().withDescription("rctat") - .withLongDescription("intqpbrlcyr") - .withSetupUri("czkgofxyfsrucvcr")) - .withProvisioningState(VerifiedPartnerProvisioningState.UPDATING); - model = BinaryData.fromObject(model).toObject(VerifiedPartnerInner.class); - Assertions.assertEquals(UUID.fromString("c7e86a55-f555-409f-b2db-3ea5eb82908b"), - model.partnerRegistrationImmutableId()); - Assertions.assertEquals("k", model.organizationName()); - Assertions.assertEquals("hu", model.partnerDisplayName()); - Assertions.assertEquals("rctat", model.partnerTopicDetails().description()); - Assertions.assertEquals("intqpbrlcyr", model.partnerTopicDetails().longDescription()); - Assertions.assertEquals("czkgofxyfsrucvcr", model.partnerTopicDetails().setupUri()); - Assertions.assertEquals(VerifiedPartnerProvisioningState.UPDATING, model.provisioningState()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/VerifiedPartnerPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/VerifiedPartnerPropertiesTests.java deleted file mode 100644 index fbe3daa78a58..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/VerifiedPartnerPropertiesTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.VerifiedPartnerProperties; -import com.azure.resourcemanager.eventgrid.models.PartnerDetails; -import com.azure.resourcemanager.eventgrid.models.VerifiedPartnerProvisioningState; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; - -public final class VerifiedPartnerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VerifiedPartnerProperties model = BinaryData.fromString( - "{\"partnerRegistrationImmutableId\":\"1ce6e6e4-8515-4e18-a18d-7544a9caf35c\",\"organizationName\":\"ma\",\"partnerDisplayName\":\"pdwwexymzvlazi\",\"partnerTopicDetails\":{\"description\":\"pwvqsgnyyu\",\"longDescription\":\"ivensrpmeyyvpk\",\"setupUri\":\"tlbijpzg\"},\"provisioningState\":\"Deleting\"}") - .toObject(VerifiedPartnerProperties.class); - Assertions.assertEquals(UUID.fromString("1ce6e6e4-8515-4e18-a18d-7544a9caf35c"), - model.partnerRegistrationImmutableId()); - Assertions.assertEquals("ma", model.organizationName()); - Assertions.assertEquals("pdwwexymzvlazi", model.partnerDisplayName()); - Assertions.assertEquals("pwvqsgnyyu", model.partnerTopicDetails().description()); - Assertions.assertEquals("ivensrpmeyyvpk", model.partnerTopicDetails().longDescription()); - Assertions.assertEquals("tlbijpzg", model.partnerTopicDetails().setupUri()); - Assertions.assertEquals(VerifiedPartnerProvisioningState.DELETING, model.provisioningState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VerifiedPartnerProperties model = new VerifiedPartnerProperties() - .withPartnerRegistrationImmutableId(UUID.fromString("1ce6e6e4-8515-4e18-a18d-7544a9caf35c")) - .withOrganizationName("ma") - .withPartnerDisplayName("pdwwexymzvlazi") - .withPartnerTopicDetails(new PartnerDetails().withDescription("pwvqsgnyyu") - .withLongDescription("ivensrpmeyyvpk") - .withSetupUri("tlbijpzg")) - .withProvisioningState(VerifiedPartnerProvisioningState.DELETING); - model = BinaryData.fromObject(model).toObject(VerifiedPartnerProperties.class); - Assertions.assertEquals(UUID.fromString("1ce6e6e4-8515-4e18-a18d-7544a9caf35c"), - model.partnerRegistrationImmutableId()); - Assertions.assertEquals("ma", model.organizationName()); - Assertions.assertEquals("pdwwexymzvlazi", model.partnerDisplayName()); - Assertions.assertEquals("pwvqsgnyyu", model.partnerTopicDetails().description()); - Assertions.assertEquals("ivensrpmeyyvpk", model.partnerTopicDetails().longDescription()); - Assertions.assertEquals("tlbijpzg", model.partnerTopicDetails().setupUri()); - Assertions.assertEquals(VerifiedPartnerProvisioningState.DELETING, model.provisioningState()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/VerifiedPartnersGetWithResponseMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/VerifiedPartnersGetWithResponseMockTests.java deleted file mode 100644 index bcb161cb99dc..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/VerifiedPartnersGetWithResponseMockTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.VerifiedPartner; -import com.azure.resourcemanager.eventgrid.models.VerifiedPartnerProvisioningState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class VerifiedPartnersGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"partnerRegistrationImmutableId\":\"f5878924-ddba-4c66-9bd0-0813e9cbe417\",\"organizationName\":\"exduetbapfczew\",\"partnerDisplayName\":\"rlqbpxyazkjpir\",\"partnerTopicDetails\":{\"description\":\"vbczwhyegb\",\"longDescription\":\"msritjbuiggr\",\"setupUri\":\"ozfvualjt\"},\"provisioningState\":\"Creating\"},\"id\":\"sdwsngkrfi\",\"name\":\"sc\",\"type\":\"vakmhzbhwahfbw\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - VerifiedPartner response - = manager.verifiedPartners().getWithResponse("vab", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals(UUID.fromString("f5878924-ddba-4c66-9bd0-0813e9cbe417"), - response.partnerRegistrationImmutableId()); - Assertions.assertEquals("exduetbapfczew", response.organizationName()); - Assertions.assertEquals("rlqbpxyazkjpir", response.partnerDisplayName()); - Assertions.assertEquals("vbczwhyegb", response.partnerTopicDetails().description()); - Assertions.assertEquals("msritjbuiggr", response.partnerTopicDetails().longDescription()); - Assertions.assertEquals("ozfvualjt", response.partnerTopicDetails().setupUri()); - Assertions.assertEquals(VerifiedPartnerProvisioningState.CREATING, response.provisioningState()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/VerifiedPartnersListMockTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/VerifiedPartnersListMockTests.java deleted file mode 100644 index 1967695dd744..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/VerifiedPartnersListMockTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.eventgrid.EventGridManager; -import com.azure.resourcemanager.eventgrid.models.VerifiedPartner; -import com.azure.resourcemanager.eventgrid.models.VerifiedPartnerProvisioningState; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class VerifiedPartnersListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"partnerRegistrationImmutableId\":\"f4e39e0f-187b-44ec-bc63-7eaa686d3910\",\"organizationName\":\"kotaurat\",\"partnerDisplayName\":\"cppfzsclefyrle\",\"partnerTopicDetails\":{\"description\":\"qlmfdg\",\"longDescription\":\"bbuypwovvvsflee\",\"setupUri\":\"oqayrehjuqwv\"},\"provisioningState\":\"Updating\"},\"id\":\"lzhpzihacenq\",\"name\":\"zlxnqzubf\",\"type\":\"nfdbgmkfwmjcwt\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - EventGridManager manager = EventGridManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response - = manager.verifiedPartners().list("hbnnxemv", 1912398825, com.azure.core.util.Context.NONE); - - Assertions.assertEquals(UUID.fromString("f4e39e0f-187b-44ec-bc63-7eaa686d3910"), - response.iterator().next().partnerRegistrationImmutableId()); - Assertions.assertEquals("kotaurat", response.iterator().next().organizationName()); - Assertions.assertEquals("cppfzsclefyrle", response.iterator().next().partnerDisplayName()); - Assertions.assertEquals("qlmfdg", response.iterator().next().partnerTopicDetails().description()); - Assertions.assertEquals("bbuypwovvvsflee", response.iterator().next().partnerTopicDetails().longDescription()); - Assertions.assertEquals("oqayrehjuqwv", response.iterator().next().partnerTopicDetails().setupUri()); - Assertions.assertEquals(VerifiedPartnerProvisioningState.UPDATING, - response.iterator().next().provisioningState()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/VerifiedPartnersListResultTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/VerifiedPartnersListResultTests.java deleted file mode 100644 index 1ab8d47fd0c2..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/VerifiedPartnersListResultTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.VerifiedPartnerInner; -import com.azure.resourcemanager.eventgrid.models.PartnerDetails; -import com.azure.resourcemanager.eventgrid.models.VerifiedPartnerProvisioningState; -import com.azure.resourcemanager.eventgrid.models.VerifiedPartnersListResult; -import java.util.Arrays; -import java.util.UUID; -import org.junit.jupiter.api.Assertions; - -public final class VerifiedPartnersListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VerifiedPartnersListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"partnerRegistrationImmutableId\":\"d904bf40-e22e-4a81-bc83-25af466fa3e8\",\"organizationName\":\"uiaclkiexhajlfn\",\"partnerDisplayName\":\"iqfyuttdi\",\"partnerTopicDetails\":{\"description\":\"pvn\",\"longDescription\":\"wmtxkyctwwgz\",\"setupUri\":\"jlmec\"},\"provisioningState\":\"Deleting\"},\"id\":\"gzyvnee\",\"name\":\"aifghtmoqqt\",\"type\":\"ffhzbkrkjjjavfq\"},{\"properties\":{\"partnerRegistrationImmutableId\":\"b0346841-caeb-4167-8483-b608ec3ec19d\",\"organizationName\":\"qoewdogiyetesy\",\"partnerDisplayName\":\"idbz\",\"partnerTopicDetails\":{\"description\":\"qtfbovn\",\"longDescription\":\"kbwetnj\",\"setupUri\":\"p\"},\"provisioningState\":\"Succeeded\"},\"id\":\"zyaupiac\",\"name\":\"xnafbw\",\"type\":\"ro\"},{\"properties\":{\"partnerRegistrationImmutableId\":\"9c737352-d20d-4190-bcd7-bb6c80d69261\",\"organizationName\":\"ovmaonurjtum\",\"partnerDisplayName\":\"ihpvecmslclblyj\",\"partnerTopicDetails\":{\"description\":\"bsjuscvsfx\",\"longDescription\":\"ctmgxuupbezqccy\",\"setupUri\":\"tce\"},\"provisioningState\":\"Deleting\"},\"id\":\"kkyihzt\",\"name\":\"eq\",\"type\":\"gqzgwldoychill\"}],\"nextLink\":\"cfehuwaoagu\"}") - .toObject(VerifiedPartnersListResult.class); - Assertions.assertEquals(UUID.fromString("d904bf40-e22e-4a81-bc83-25af466fa3e8"), - model.value().get(0).partnerRegistrationImmutableId()); - Assertions.assertEquals("uiaclkiexhajlfn", model.value().get(0).organizationName()); - Assertions.assertEquals("iqfyuttdi", model.value().get(0).partnerDisplayName()); - Assertions.assertEquals("pvn", model.value().get(0).partnerTopicDetails().description()); - Assertions.assertEquals("wmtxkyctwwgz", model.value().get(0).partnerTopicDetails().longDescription()); - Assertions.assertEquals("jlmec", model.value().get(0).partnerTopicDetails().setupUri()); - Assertions.assertEquals(VerifiedPartnerProvisioningState.DELETING, model.value().get(0).provisioningState()); - Assertions.assertEquals("cfehuwaoagu", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VerifiedPartnersListResult model - = new VerifiedPartnersListResult() - .withValue( - Arrays - .asList( - new VerifiedPartnerInner() - .withPartnerRegistrationImmutableId( - UUID.fromString("d904bf40-e22e-4a81-bc83-25af466fa3e8")) - .withOrganizationName("uiaclkiexhajlfn") - .withPartnerDisplayName("iqfyuttdi") - .withPartnerTopicDetails(new PartnerDetails() - .withDescription("pvn") - .withLongDescription("wmtxkyctwwgz") - .withSetupUri("jlmec")) - .withProvisioningState(VerifiedPartnerProvisioningState.DELETING), - new VerifiedPartnerInner() - .withPartnerRegistrationImmutableId( - UUID.fromString("b0346841-caeb-4167-8483-b608ec3ec19d")) - .withOrganizationName("qoewdogiyetesy") - .withPartnerDisplayName("idbz") - .withPartnerTopicDetails(new PartnerDetails() - .withDescription("qtfbovn") - .withLongDescription("kbwetnj") - .withSetupUri("p")) - .withProvisioningState(VerifiedPartnerProvisioningState.SUCCEEDED), - new VerifiedPartnerInner() - .withPartnerRegistrationImmutableId( - UUID.fromString("9c737352-d20d-4190-bcd7-bb6c80d69261")) - .withOrganizationName("ovmaonurjtum") - .withPartnerDisplayName("ihpvecmslclblyj") - .withPartnerTopicDetails(new PartnerDetails().withDescription("bsjuscvsfx") - .withLongDescription("ctmgxuupbezqccy") - .withSetupUri("tce")) - .withProvisioningState(VerifiedPartnerProvisioningState.DELETING))) - .withNextLink("cfehuwaoagu"); - model = BinaryData.fromObject(model).toObject(VerifiedPartnersListResult.class); - Assertions.assertEquals(UUID.fromString("d904bf40-e22e-4a81-bc83-25af466fa3e8"), - model.value().get(0).partnerRegistrationImmutableId()); - Assertions.assertEquals("uiaclkiexhajlfn", model.value().get(0).organizationName()); - Assertions.assertEquals("iqfyuttdi", model.value().get(0).partnerDisplayName()); - Assertions.assertEquals("pvn", model.value().get(0).partnerTopicDetails().description()); - Assertions.assertEquals("wmtxkyctwwgz", model.value().get(0).partnerTopicDetails().longDescription()); - Assertions.assertEquals("jlmec", model.value().get(0).partnerTopicDetails().setupUri()); - Assertions.assertEquals(VerifiedPartnerProvisioningState.DELETING, model.value().get(0).provisioningState()); - Assertions.assertEquals("cfehuwaoagu", model.nextLink()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/WebhookEventSubscriptionDestinationPropertiesTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/WebhookEventSubscriptionDestinationPropertiesTests.java deleted file mode 100644 index 19e1780292b3..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/WebhookEventSubscriptionDestinationPropertiesTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.fluent.models.WebhookEventSubscriptionDestinationProperties; -import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeMapping; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WebhookEventSubscriptionDestinationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WebhookEventSubscriptionDestinationProperties model = BinaryData.fromString( - "{\"endpointUrl\":\"pjby\",\"endpointBaseUrl\":\"sjoqcjenkyhfqzvs\",\"maxEventsPerBatch\":1502032007,\"preferredBatchSizeInKilobytes\":1585887807,\"azureActiveDirectoryTenantId\":\"l\",\"azureActiveDirectoryApplicationIdOrUri\":\"mpzqjhhhq\",\"deliveryAttributeMappings\":[{\"type\":\"DeliveryAttributeMapping\",\"name\":\"vcacoyv\"}],\"minimumTlsVersionAllowed\":\"1.2\"}") - .toObject(WebhookEventSubscriptionDestinationProperties.class); - Assertions.assertEquals("pjby", model.endpointUrl()); - Assertions.assertEquals(1502032007, model.maxEventsPerBatch()); - Assertions.assertEquals(1585887807, model.preferredBatchSizeInKilobytes()); - Assertions.assertEquals("l", model.azureActiveDirectoryTenantId()); - Assertions.assertEquals("mpzqjhhhq", model.azureActiveDirectoryApplicationIdOrUri()); - Assertions.assertEquals("vcacoyv", model.deliveryAttributeMappings().get(0).name()); - Assertions.assertEquals(TlsVersion.ONE_TWO, model.minimumTlsVersionAllowed()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WebhookEventSubscriptionDestinationProperties model - = new WebhookEventSubscriptionDestinationProperties().withEndpointUrl("pjby") - .withMaxEventsPerBatch(1502032007) - .withPreferredBatchSizeInKilobytes(1585887807) - .withAzureActiveDirectoryTenantId("l") - .withAzureActiveDirectoryApplicationIdOrUri("mpzqjhhhq") - .withDeliveryAttributeMappings(Arrays.asList(new DeliveryAttributeMapping().withName("vcacoyv"))) - .withMinimumTlsVersionAllowed(TlsVersion.ONE_TWO); - model = BinaryData.fromObject(model).toObject(WebhookEventSubscriptionDestinationProperties.class); - Assertions.assertEquals("pjby", model.endpointUrl()); - Assertions.assertEquals(1502032007, model.maxEventsPerBatch()); - Assertions.assertEquals(1585887807, model.preferredBatchSizeInKilobytes()); - Assertions.assertEquals("l", model.azureActiveDirectoryTenantId()); - Assertions.assertEquals("mpzqjhhhq", model.azureActiveDirectoryApplicationIdOrUri()); - Assertions.assertEquals("vcacoyv", model.deliveryAttributeMappings().get(0).name()); - Assertions.assertEquals(TlsVersion.ONE_TWO, model.minimumTlsVersionAllowed()); - } -} diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/WebhookEventSubscriptionDestinationTests.java b/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/WebhookEventSubscriptionDestinationTests.java deleted file mode 100644 index f73d268f1631..000000000000 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/src/test/java/com/azure/resourcemanager/eventgrid/generated/WebhookEventSubscriptionDestinationTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.eventgrid.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.eventgrid.models.DeliveryAttributeMapping; -import com.azure.resourcemanager.eventgrid.models.TlsVersion; -import com.azure.resourcemanager.eventgrid.models.WebhookEventSubscriptionDestination; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WebhookEventSubscriptionDestinationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WebhookEventSubscriptionDestination model = BinaryData.fromString( - "{\"endpointType\":\"WebHook\",\"properties\":{\"endpointUrl\":\"viyoypsuhbrnnhjx\",\"endpointBaseUrl\":\"wjh\",\"maxEventsPerBatch\":1783874944,\"preferredBatchSizeInKilobytes\":843704229,\"azureActiveDirectoryTenantId\":\"t\",\"azureActiveDirectoryApplicationIdOrUri\":\"zycyqiqyhg\",\"deliveryAttributeMappings\":[{\"type\":\"DeliveryAttributeMapping\",\"name\":\"zlex\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"fledynojpziu\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"bzkkd\"},{\"type\":\"DeliveryAttributeMapping\",\"name\":\"hqsycljselp\"}],\"minimumTlsVersionAllowed\":\"1.0\"}}") - .toObject(WebhookEventSubscriptionDestination.class); - Assertions.assertEquals("viyoypsuhbrnnhjx", model.endpointUrl()); - Assertions.assertEquals(1783874944, model.maxEventsPerBatch()); - Assertions.assertEquals(843704229, model.preferredBatchSizeInKilobytes()); - Assertions.assertEquals("t", model.azureActiveDirectoryTenantId()); - Assertions.assertEquals("zycyqiqyhg", model.azureActiveDirectoryApplicationIdOrUri()); - Assertions.assertEquals("zlex", model.deliveryAttributeMappings().get(0).name()); - Assertions.assertEquals(TlsVersion.ONE_ZERO, model.minimumTlsVersionAllowed()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WebhookEventSubscriptionDestination model - = new WebhookEventSubscriptionDestination().withEndpointUrl("viyoypsuhbrnnhjx") - .withMaxEventsPerBatch(1783874944) - .withPreferredBatchSizeInKilobytes(843704229) - .withAzureActiveDirectoryTenantId("t") - .withAzureActiveDirectoryApplicationIdOrUri("zycyqiqyhg") - .withDeliveryAttributeMappings(Arrays.asList(new DeliveryAttributeMapping().withName("zlex"), - new DeliveryAttributeMapping().withName("fledynojpziu"), - new DeliveryAttributeMapping().withName("bzkkd"), - new DeliveryAttributeMapping().withName("hqsycljselp"))) - .withMinimumTlsVersionAllowed(TlsVersion.ONE_ZERO); - model = BinaryData.fromObject(model).toObject(WebhookEventSubscriptionDestination.class); - Assertions.assertEquals("viyoypsuhbrnnhjx", model.endpointUrl()); - Assertions.assertEquals(1783874944, model.maxEventsPerBatch()); - Assertions.assertEquals(843704229, model.preferredBatchSizeInKilobytes()); - Assertions.assertEquals("t", model.azureActiveDirectoryTenantId()); - Assertions.assertEquals("zycyqiqyhg", model.azureActiveDirectoryApplicationIdOrUri()); - Assertions.assertEquals("zlex", model.deliveryAttributeMappings().get(0).name()); - Assertions.assertEquals(TlsVersion.ONE_ZERO, model.minimumTlsVersionAllowed()); - } -}