diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/CHANGELOG.md b/sdk/voiceservices/azure-resourcemanager-voiceservices/CHANGELOG.md index 717d2a12acf8..3e7990b2632f 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/CHANGELOG.md +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2023-06-06) + +- Azure Resource Manager Voice Services client library for Java. This package contains Microsoft Azure SDK for Voice Services Management SDK. Package tag package-2023-04-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/README.md b/sdk/voiceservices/azure-resourcemanager-voiceservices/README.md index cb01dc7eec92..e8dac16babc3 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/README.md +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Voice Services client library for Java. -This package contains Microsoft Azure SDK for Voice Services Management SDK. Package tag package-2023-01-31. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Voice Services Management SDK. Package tag package-2023-04-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-voiceservices - 1.0.0 + 1.1.0-beta.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/SAMPLE.md b/sdk/voiceservices/azure-resourcemanager-voiceservices/SAMPLE.md index 10e3f9eb1044..98d9fdb05fc0 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/SAMPLE.md +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/SAMPLE.md @@ -40,7 +40,7 @@ import java.util.Arrays; /** Samples for CommunicationsGateways CreateOrUpdate. */ public final class CommunicationsGatewaysCreateOrUpdateSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_CreateOrUpdate.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/CommunicationsGateways_CreateOrUpdate.json */ /** * Sample code: CreateCommunicationsGatewayResource. @@ -88,7 +88,7 @@ public final class CommunicationsGatewaysCreateOrUpdateSamples { /** Samples for CommunicationsGateways Delete. */ public final class CommunicationsGatewaysDeleteSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Delete.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/CommunicationsGateways_Delete.json */ /** * Sample code: DeleteCommunicationsGatewayResource. @@ -108,7 +108,7 @@ public final class CommunicationsGatewaysDeleteSamples { /** Samples for CommunicationsGateways GetByResourceGroup. */ public final class CommunicationsGatewaysGetByResourceGroupSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Get.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/CommunicationsGateways_Get.json */ /** * Sample code: GetCommunicationsGatewayResource. @@ -130,7 +130,7 @@ public final class CommunicationsGatewaysGetByResourceGroupSamples { /** Samples for CommunicationsGateways List. */ public final class CommunicationsGatewaysListSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_ListBySubscription.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/CommunicationsGateways_ListBySubscription.json */ /** * Sample code: ListCommunicationsGatewayResourceSub. @@ -150,7 +150,7 @@ public final class CommunicationsGatewaysListSamples { /** Samples for CommunicationsGateways ListByResourceGroup. */ public final class CommunicationsGatewaysListByResourceGroupSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_ListByResourceGroup.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/CommunicationsGateways_ListByResourceGroup.json */ /** * Sample code: ListCommunicationsGatewayResource. @@ -172,7 +172,7 @@ import com.azure.resourcemanager.voiceservices.models.CommunicationsGateway; /** Samples for CommunicationsGateways Update. */ public final class CommunicationsGatewaysUpdateSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Update.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/CommunicationsGateways_Update.json */ /** * Sample code: UpdateCommunicationsGatewayResource. @@ -199,7 +199,7 @@ import com.azure.resourcemanager.voiceservices.models.CheckNameAvailabilityReque /** Samples for NameAvailability CheckLocal. */ public final class NameAvailabilityCheckLocalSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/NameAvailability_CheckLocal.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/NameAvailability_CheckLocal.json */ /** * Sample code: CheckLocalNameAvailability. @@ -226,7 +226,7 @@ public final class NameAvailabilityCheckLocalSamples { /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/Operations_List.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/Operations_List.json */ /** * Sample code: OperationsList. @@ -247,7 +247,7 @@ import com.azure.resourcemanager.voiceservices.models.TestLinePurpose; /** Samples for TestLines CreateOrUpdate. */ public final class TestLinesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_CreateOrUpdate.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/TestLines_CreateOrUpdate.json */ /** * Sample code: CreateTestLineResource. @@ -273,7 +273,7 @@ public final class TestLinesCreateOrUpdateSamples { /** Samples for TestLines Delete. */ public final class TestLinesDeleteSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Delete.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/TestLines_Delete.json */ /** * Sample code: DeleteTestLineResource. @@ -292,7 +292,7 @@ public final class TestLinesDeleteSamples { /** Samples for TestLines Get. */ public final class TestLinesGetSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Get.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/TestLines_Get.json */ /** * Sample code: GetTestLineResource. @@ -311,7 +311,7 @@ public final class TestLinesGetSamples { /** Samples for TestLines ListByCommunicationsGateway. */ public final class TestLinesListByCommunicationsGatewaySamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_ListByCommunicationsGateway.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/TestLines_ListByCommunicationsGateway.json */ /** * Sample code: ListTestLineResource. @@ -332,7 +332,7 @@ import com.azure.resourcemanager.voiceservices.models.TestLine; /** Samples for TestLines Update. */ public final class TestLinesUpdateSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Update.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/TestLines_Update.json */ /** * Sample code: UpdateTestLineResource. diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/pom.xml b/sdk/voiceservices/azure-resourcemanager-voiceservices/pom.xml index fc0d13d2d2c8..d3f123fb7ee2 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/pom.xml +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for Voice Services Management - This package contains Microsoft Azure SDK for Voice Services Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2023-01-31. + This package contains Microsoft Azure SDK for Voice Services Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2023-04-03. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/VoiceServicesManager.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/VoiceServicesManager.java index 168559153264..5da3625d711a 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/VoiceServicesManager.java +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/VoiceServicesManager.java @@ -215,7 +215,7 @@ public VoiceServicesManager authenticate(TokenCredential credential, AzureProfil .append("-") .append("com.azure.resourcemanager.voiceservices") .append("/") - .append("1.0.0"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/CommunicationsGatewayInner.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/CommunicationsGatewayInner.java index 1d947a3f802e..621b5aab800d 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/CommunicationsGatewayInner.java +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/CommunicationsGatewayInner.java @@ -11,6 +11,7 @@ import com.azure.resourcemanager.voiceservices.models.CommunicationsPlatform; import com.azure.resourcemanager.voiceservices.models.Connectivity; import com.azure.resourcemanager.voiceservices.models.E911Type; +import com.azure.resourcemanager.voiceservices.models.ManagedServiceIdentity; import com.azure.resourcemanager.voiceservices.models.ProvisioningState; import com.azure.resourcemanager.voiceservices.models.ServiceRegionProperties; import com.azure.resourcemanager.voiceservices.models.Status; @@ -28,6 +29,12 @@ public final class CommunicationsGatewayInner extends Resource { @JsonProperty(value = "properties") private CommunicationsGatewayProperties innerProperties; + /* + * The managed service identities assigned to this resource. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -47,6 +54,26 @@ private CommunicationsGatewayProperties innerProperties() { return this.innerProperties; } + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the CommunicationsGatewayInner object itself. + */ + public CommunicationsGatewayInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -310,6 +337,29 @@ public CommunicationsGatewayInner withOnPremMcpEnabled(Boolean onPremMcpEnabled) return this; } + /** + * Get the integratedMcpEnabled property: Whether an integrated Mobile Control Point is in use. + * + * @return the integratedMcpEnabled value. + */ + public Boolean integratedMcpEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().integratedMcpEnabled(); + } + + /** + * Set the integratedMcpEnabled property: Whether an integrated Mobile Control Point is in use. + * + * @param integratedMcpEnabled the integratedMcpEnabled value to set. + * @return the CommunicationsGatewayInner object itself. + */ + public CommunicationsGatewayInner withIntegratedMcpEnabled(Boolean integratedMcpEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new CommunicationsGatewayProperties(); + } + this.innerProperties().withIntegratedMcpEnabled(integratedMcpEnabled); + return this; + } + /** * Get the emergencyDialStrings property: A list of dial strings used for emergency calling. * @@ -342,5 +392,8 @@ public void validate() { if (innerProperties() != null) { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } } diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/CommunicationsGatewayProperties.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/CommunicationsGatewayProperties.java index 62714629f3f8..27a89d9dcd6e 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/CommunicationsGatewayProperties.java +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/fluent/models/CommunicationsGatewayProperties.java @@ -92,6 +92,12 @@ public final class CommunicationsGatewayProperties { @JsonProperty(value = "onPremMcpEnabled") private Boolean onPremMcpEnabled; + /* + * Whether an integrated Mobile Control Point is in use. + */ + @JsonProperty(value = "integratedMcpEnabled") + private Boolean integratedMcpEnabled; + /* * A list of dial strings used for emergency calling. */ @@ -315,6 +321,26 @@ public CommunicationsGatewayProperties withOnPremMcpEnabled(Boolean onPremMcpEna return this; } + /** + * Get the integratedMcpEnabled property: Whether an integrated Mobile Control Point is in use. + * + * @return the integratedMcpEnabled value. + */ + public Boolean integratedMcpEnabled() { + return this.integratedMcpEnabled; + } + + /** + * Set the integratedMcpEnabled property: Whether an integrated Mobile Control Point is in use. + * + * @param integratedMcpEnabled the integratedMcpEnabled value to set. + * @return the CommunicationsGatewayProperties object itself. + */ + public CommunicationsGatewayProperties withIntegratedMcpEnabled(Boolean integratedMcpEnabled) { + this.integratedMcpEnabled = integratedMcpEnabled; + return this; + } + /** * Get the emergencyDialStrings property: A list of dial strings used for emergency calling. * diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/CommunicationsGatewayImpl.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/CommunicationsGatewayImpl.java index 2300d6a0949d..bc4d6cb1358d 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/CommunicationsGatewayImpl.java +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/CommunicationsGatewayImpl.java @@ -14,6 +14,7 @@ import com.azure.resourcemanager.voiceservices.models.CommunicationsPlatform; import com.azure.resourcemanager.voiceservices.models.Connectivity; import com.azure.resourcemanager.voiceservices.models.E911Type; +import com.azure.resourcemanager.voiceservices.models.ManagedServiceIdentity; import com.azure.resourcemanager.voiceservices.models.ProvisioningState; import com.azure.resourcemanager.voiceservices.models.ServiceRegionProperties; import com.azure.resourcemanager.voiceservices.models.Status; @@ -53,6 +54,10 @@ public Map tags() { } } + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + public SystemData systemData() { return this.innerModel().systemData(); } @@ -120,6 +125,10 @@ public Boolean onPremMcpEnabled() { return this.innerModel().onPremMcpEnabled(); } + public Boolean integratedMcpEnabled() { + return this.innerModel().integratedMcpEnabled(); + } + public List emergencyDialStrings() { List inner = this.innerModel().emergencyDialStrings(); if (inner != null) { @@ -259,6 +268,16 @@ public CommunicationsGatewayImpl withTags(Map tags) { } } + public CommunicationsGatewayImpl withIdentity(ManagedServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateProperties.withIdentity(identity); + return this; + } + } + public CommunicationsGatewayImpl withServiceLocations(List serviceLocations) { this.innerModel().withServiceLocations(serviceLocations); return this; @@ -305,6 +324,11 @@ public CommunicationsGatewayImpl withOnPremMcpEnabled(Boolean onPremMcpEnabled) return this; } + public CommunicationsGatewayImpl withIntegratedMcpEnabled(Boolean integratedMcpEnabled) { + this.innerModel().withIntegratedMcpEnabled(integratedMcpEnabled); + return this; + } + public CommunicationsGatewayImpl withEmergencyDialStrings(List emergencyDialStrings) { this.innerModel().withEmergencyDialStrings(emergencyDialStrings); return this; diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/MicrosoftVoiceServicesImpl.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/MicrosoftVoiceServicesImpl.java index 234f0069af98..8cc4ea0b5c57 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/MicrosoftVoiceServicesImpl.java +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/implementation/MicrosoftVoiceServicesImpl.java @@ -181,7 +181,7 @@ public TestLinesClient getTestLines() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2023-01-31"; + this.apiVersion = "2023-04-03"; this.operations = new OperationsClientImpl(this); this.communicationsGateways = new CommunicationsGatewaysClientImpl(this); this.nameAvailabilities = new NameAvailabilitiesClientImpl(this); diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/models/CommunicationsGateway.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/models/CommunicationsGateway.java index 10d00cf854da..8108b7fe3cbc 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/models/CommunicationsGateway.java +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/models/CommunicationsGateway.java @@ -48,6 +48,13 @@ public interface CommunicationsGateway { */ Map tags(); + /** + * Gets the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -142,6 +149,13 @@ public interface CommunicationsGateway { */ Boolean onPremMcpEnabled(); + /** + * Gets the integratedMcpEnabled property: Whether an integrated Mobile Control Point is in use. + * + * @return the integratedMcpEnabled value. + */ + Boolean integratedMcpEnabled(); + /** * Gets the emergencyDialStrings property: A list of dial strings used for emergency calling. * @@ -223,6 +237,7 @@ interface WithResourceGroup { */ interface WithCreate extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, DefinitionStages.WithServiceLocations, DefinitionStages.WithConnectivity, DefinitionStages.WithCodecs, @@ -232,6 +247,7 @@ interface WithCreate DefinitionStages.WithAutoGeneratedDomainNameLabelScope, DefinitionStages.WithTeamsVoicemailPilotNumber, DefinitionStages.WithOnPremMcpEnabled, + DefinitionStages.WithIntegratedMcpEnabled, DefinitionStages.WithEmergencyDialStrings { /** * Executes the create request. @@ -258,6 +274,16 @@ interface WithTags { */ WithCreate withTags(Map tags); } + /** The stage of the CommunicationsGateway definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } /** The stage of the CommunicationsGateway definition allowing to specify serviceLocations. */ interface WithServiceLocations { /** @@ -354,6 +380,16 @@ interface WithOnPremMcpEnabled { */ WithCreate withOnPremMcpEnabled(Boolean onPremMcpEnabled); } + /** The stage of the CommunicationsGateway definition allowing to specify integratedMcpEnabled. */ + interface WithIntegratedMcpEnabled { + /** + * Specifies the integratedMcpEnabled property: Whether an integrated Mobile Control Point is in use.. + * + * @param integratedMcpEnabled Whether an integrated Mobile Control Point is in use. + * @return the next definition stage. + */ + WithCreate withIntegratedMcpEnabled(Boolean integratedMcpEnabled); + } /** The stage of the CommunicationsGateway definition allowing to specify emergencyDialStrings. */ interface WithEmergencyDialStrings { /** @@ -373,7 +409,7 @@ interface WithEmergencyDialStrings { CommunicationsGateway.Update update(); /** The template for CommunicationsGateway update. */ - interface Update extends UpdateStages.WithTags { + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity { /** * Executes the update request. * @@ -401,6 +437,16 @@ interface WithTags { */ Update withTags(Map tags); } + /** The stage of the CommunicationsGateway update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identities assigned to this resource.. + * + * @param identity The managed service identities assigned to this resource. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/models/CommunicationsGatewayUpdate.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/models/CommunicationsGatewayUpdate.java index a234364894ff..169023166f6c 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/models/CommunicationsGatewayUpdate.java +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/models/CommunicationsGatewayUpdate.java @@ -12,6 +12,12 @@ /** The type used for update operations of the CommunicationsGateway. */ @Fluent public final class CommunicationsGatewayUpdate { + /* + * The managed service identities assigned to this resource. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + /* * Resource tags. */ @@ -23,6 +29,26 @@ public final class CommunicationsGatewayUpdate { public CommunicationsGatewayUpdate() { } + /** + * Get the identity property: The managed service identities assigned to this resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed service identities assigned to this resource. + * + * @param identity the identity value to set. + * @return the CommunicationsGatewayUpdate object itself. + */ + public CommunicationsGatewayUpdate withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + /** * Get the tags property: Resource tags. * @@ -49,5 +75,8 @@ public CommunicationsGatewayUpdate withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (identity() != null) { + identity().validate(); + } } } diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/models/ManagedServiceIdentity.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/models/ManagedServiceIdentity.java new file mode 100644 index 000000000000..1a1ee411090c --- /dev/null +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/models/ManagedServiceIdentity.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.voiceservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import java.util.UUID; + +/** Managed service identity (system assigned and/or user assigned identities). */ +@Fluent +public final class ManagedServiceIdentity { + /* + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tenantId; + + /* + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ + @JsonProperty(value = "type", required = true) + private ManagedServiceIdentityType type; + + /* + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys + * will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** Creates an instance of ManagedServiceIdentity class. */ + public ManagedServiceIdentity() { + } + + /** + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). + * + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: The set of user assigned identities associated with the resource. The + * userAssignedIdentities dictionary keys will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + * The dictionary values can be empty objects ({}) in requests. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. + */ + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); +} diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/models/ManagedServiceIdentityType.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..07ffa3fafde8 --- /dev/null +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/models/ManagedServiceIdentityType.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.voiceservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** Static value None for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** Static value SystemAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value SystemAssigned, UserAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = + fromString("SystemAssigned, UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + @JsonCreator + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/models/UserAssignedIdentity.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/models/UserAssignedIdentity.java new file mode 100644 index 000000000000..1fe72ce59258 --- /dev/null +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/main/java/com/azure/resourcemanager/voiceservices/models/UserAssignedIdentity.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.voiceservices.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** User assigned identity properties. */ +@Immutable +public final class UserAssignedIdentity { + /* + * The principal ID of the assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private UUID clientId; + + /** Creates an instance of UserAssignedIdentity class. */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysCreateOrUpdateSamples.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysCreateOrUpdateSamples.java index a6e01cf36a3f..47a271203498 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysCreateOrUpdateSamples.java +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysCreateOrUpdateSamples.java @@ -16,7 +16,7 @@ /** Samples for CommunicationsGateways CreateOrUpdate. */ public final class CommunicationsGatewaysCreateOrUpdateSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_CreateOrUpdate.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/CommunicationsGateways_CreateOrUpdate.json */ /** * Sample code: CreateCommunicationsGatewayResource. diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysDeleteSamples.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysDeleteSamples.java index 82ce63776d0b..119386b79781 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysDeleteSamples.java +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for CommunicationsGateways Delete. */ public final class CommunicationsGatewaysDeleteSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Delete.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/CommunicationsGateways_Delete.json */ /** * Sample code: DeleteCommunicationsGatewayResource. diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysGetByResourceGroupSamples.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysGetByResourceGroupSamples.java index bafabffcd16b..ddc54accf232 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysGetByResourceGroupSamples.java +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysGetByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for CommunicationsGateways GetByResourceGroup. */ public final class CommunicationsGatewaysGetByResourceGroupSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Get.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/CommunicationsGateways_Get.json */ /** * Sample code: GetCommunicationsGatewayResource. diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysListByResourceGroupSamples.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysListByResourceGroupSamples.java index 70773fb599c0..9b058997a944 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysListByResourceGroupSamples.java +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysListByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for CommunicationsGateways ListByResourceGroup. */ public final class CommunicationsGatewaysListByResourceGroupSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_ListByResourceGroup.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/CommunicationsGateways_ListByResourceGroup.json */ /** * Sample code: ListCommunicationsGatewayResource. diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysListSamples.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysListSamples.java index 3a640ebd80a1..91cae3afbe35 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysListSamples.java +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysListSamples.java @@ -7,7 +7,7 @@ /** Samples for CommunicationsGateways List. */ public final class CommunicationsGatewaysListSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_ListBySubscription.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/CommunicationsGateways_ListBySubscription.json */ /** * Sample code: ListCommunicationsGatewayResourceSub. diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysUpdateSamples.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysUpdateSamples.java index b66e6625aca0..f3f6fd9ebdc1 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysUpdateSamples.java +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysUpdateSamples.java @@ -9,7 +9,7 @@ /** Samples for CommunicationsGateways Update. */ public final class CommunicationsGatewaysUpdateSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/CommunicationsGateways_Update.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/CommunicationsGateways_Update.json */ /** * Sample code: UpdateCommunicationsGatewayResource. diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/NameAvailabilityCheckLocalSamples.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/NameAvailabilityCheckLocalSamples.java index bd8c2bfddf12..85d188cd0955 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/NameAvailabilityCheckLocalSamples.java +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/NameAvailabilityCheckLocalSamples.java @@ -9,7 +9,7 @@ /** Samples for NameAvailability CheckLocal. */ public final class NameAvailabilityCheckLocalSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/NameAvailability_CheckLocal.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/NameAvailability_CheckLocal.json */ /** * Sample code: CheckLocalNameAvailability. diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/OperationsListSamples.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/OperationsListSamples.java index 35007a945d83..c27b191a70e4 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/OperationsListSamples.java +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/OperationsListSamples.java @@ -7,7 +7,7 @@ /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/Operations_List.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/Operations_List.json */ /** * Sample code: OperationsList. diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/TestLinesCreateOrUpdateSamples.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/TestLinesCreateOrUpdateSamples.java index 6b6bfdb37fef..f348e811dc6e 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/TestLinesCreateOrUpdateSamples.java +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/TestLinesCreateOrUpdateSamples.java @@ -9,7 +9,7 @@ /** Samples for TestLines CreateOrUpdate. */ public final class TestLinesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_CreateOrUpdate.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/TestLines_CreateOrUpdate.json */ /** * Sample code: CreateTestLineResource. diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/TestLinesDeleteSamples.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/TestLinesDeleteSamples.java index e89a63b0ae32..0805404aaeb0 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/TestLinesDeleteSamples.java +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/TestLinesDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for TestLines Delete. */ public final class TestLinesDeleteSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Delete.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/TestLines_Delete.json */ /** * Sample code: DeleteTestLineResource. diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/TestLinesGetSamples.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/TestLinesGetSamples.java index 93efb47ebaa7..518bedcd238c 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/TestLinesGetSamples.java +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/TestLinesGetSamples.java @@ -7,7 +7,7 @@ /** Samples for TestLines Get. */ public final class TestLinesGetSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Get.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/TestLines_Get.json */ /** * Sample code: GetTestLineResource. diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/TestLinesListByCommunicationsGatewaySamples.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/TestLinesListByCommunicationsGatewaySamples.java index 1e5705b2c0f7..6801361514d3 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/TestLinesListByCommunicationsGatewaySamples.java +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/TestLinesListByCommunicationsGatewaySamples.java @@ -7,7 +7,7 @@ /** Samples for TestLines ListByCommunicationsGateway. */ public final class TestLinesListByCommunicationsGatewaySamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_ListByCommunicationsGateway.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/TestLines_ListByCommunicationsGateway.json */ /** * Sample code: ListTestLineResource. diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/TestLinesUpdateSamples.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/TestLinesUpdateSamples.java index d2275c0f4b92..17d5d82ed29f 100644 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/TestLinesUpdateSamples.java +++ b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/samples/java/com/azure/resourcemanager/voiceservices/generated/TestLinesUpdateSamples.java @@ -9,7 +9,7 @@ /** Samples for TestLines Update. */ public final class TestLinesUpdateSamples { /* - * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-01-31/examples/TestLines_Update.json + * x-ms-original-file: specification/voiceservices/resource-manager/Microsoft.VoiceServices/stable/2023-04-03/examples/TestLines_Update.json */ /** * Sample code: UpdateTestLineResource. diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/CheckNameAvailabilityRequestTests.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/CheckNameAvailabilityRequestTests.java deleted file mode 100644 index 50ce84b7f894..000000000000 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/CheckNameAvailabilityRequestTests.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.voiceservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.voiceservices.models.CheckNameAvailabilityRequest; -import org.junit.jupiter.api.Assertions; - -public final class CheckNameAvailabilityRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CheckNameAvailabilityRequest model = - BinaryData - .fromString("{\"name\":\"peqfpjkjl\",\"type\":\"fpdvhpfxxypi\"}") - .toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("peqfpjkjl", model.name()); - Assertions.assertEquals("fpdvhpfxxypi", model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityRequest model = - new CheckNameAvailabilityRequest().withName("peqfpjkjl").withType("fpdvhpfxxypi"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("peqfpjkjl", model.name()); - Assertions.assertEquals("fpdvhpfxxypi", model.type()); - } -} diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/CheckNameAvailabilityResponseInnerTests.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/CheckNameAvailabilityResponseInnerTests.java deleted file mode 100644 index e3898ef484f9..000000000000 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/CheckNameAvailabilityResponseInnerTests.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.voiceservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.voiceservices.fluent.models.CheckNameAvailabilityResponseInner; -import com.azure.resourcemanager.voiceservices.models.CheckNameAvailabilityReason; -import org.junit.jupiter.api.Assertions; - -public final class CheckNameAvailabilityResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CheckNameAvailabilityResponseInner model = - BinaryData - .fromString("{\"nameAvailable\":true,\"reason\":\"Invalid\",\"message\":\"huyb\"}") - .toObject(CheckNameAvailabilityResponseInner.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.INVALID, model.reason()); - Assertions.assertEquals("huyb", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityResponseInner model = - new CheckNameAvailabilityResponseInner() - .withNameAvailable(true) - .withReason(CheckNameAvailabilityReason.INVALID) - .withMessage("huyb"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityResponseInner.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.INVALID, model.reason()); - Assertions.assertEquals("huyb", model.message()); - } -} diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewayUpdateTests.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewayUpdateTests.java deleted file mode 100644 index 2c4319e37930..000000000000 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewayUpdateTests.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.voiceservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.voiceservices.models.CommunicationsGatewayUpdate; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class CommunicationsGatewayUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CommunicationsGatewayUpdate model = - BinaryData - .fromString("{\"tags\":{\"vamih\":\"odepoogin\",\"vyevcciqi\":\"ognarxzxtheotus\"}}") - .toObject(CommunicationsGatewayUpdate.class); - Assertions.assertEquals("odepoogin", model.tags().get("vamih")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommunicationsGatewayUpdate model = - new CommunicationsGatewayUpdate().withTags(mapOf("vamih", "odepoogin", "vyevcciqi", "ognarxzxtheotus")); - model = BinaryData.fromObject(model).toObject(CommunicationsGatewayUpdate.class); - Assertions.assertEquals("odepoogin", model.tags().get("vamih")); - } - - @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/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysDeleteMockTests.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysDeleteMockTests.java deleted file mode 100644 index b124d5088b56..000000000000 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/CommunicationsGatewaysDeleteMockTests.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.voiceservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.voiceservices.VoiceServicesManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CommunicationsGatewaysDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - VoiceServicesManager manager = - VoiceServicesManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.communicationsGateways().delete("itnwuizgazxufi", "uckyf", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/NameAvailabilitiesCheckLocalWithResponseMockTests.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/NameAvailabilitiesCheckLocalWithResponseMockTests.java deleted file mode 100644 index b262d188ed80..000000000000 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/NameAvailabilitiesCheckLocalWithResponseMockTests.java +++ /dev/null @@ -1,76 +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.voiceservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.voiceservices.VoiceServicesManager; -import com.azure.resourcemanager.voiceservices.models.CheckNameAvailabilityReason; -import com.azure.resourcemanager.voiceservices.models.CheckNameAvailabilityRequest; -import com.azure.resourcemanager.voiceservices.models.CheckNameAvailabilityResponse; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class NameAvailabilitiesCheckLocalWithResponseMockTests { - @Test - public void testCheckLocalWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"nameAvailable\":false,\"reason\":\"AlreadyExists\",\"message\":\"dcuf\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - VoiceServicesManager manager = - VoiceServicesManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CheckNameAvailabilityResponse response = - manager - .nameAvailabilities() - .checkLocalWithResponse( - "sdkf", - new CheckNameAvailabilityRequest().withName("wxmnteiwao").withType("km"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(false, response.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, response.reason()); - Assertions.assertEquals("dcuf", response.message()); - } -} diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/OperationDisplayTests.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/OperationDisplayTests.java deleted file mode 100644 index 93111cca30f0..000000000000 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/OperationDisplayTests.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.voiceservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.voiceservices.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"yrtih\",\"resource\":\"tijbpzvgnwzsymgl\",\"operation\":\"fcyzkohdbihanufh\",\"description\":\"bj\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/OperationInnerTests.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/OperationInnerTests.java deleted file mode 100644 index b0a3442b178c..000000000000 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/OperationInnerTests.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.voiceservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.voiceservices.fluent.models.OperationInner; -import com.azure.resourcemanager.voiceservices.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"usarhmofc\",\"isDataAction\":false,\"display\":{\"provider\":\"urkdtmlx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/OperationListResultTests.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/OperationListResultTests.java deleted file mode 100644 index 390cdb1cae60..000000000000 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/OperationListResultTests.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.voiceservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.voiceservices.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"izhwlrxy\",\"isDataAction\":false,\"display\":{\"provider\":\"ijgkdm\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"rifkwm\",\"isDataAction\":true,\"display\":{\"provider\":\"izntocipao\",\"resource\":\"jpsq\",\"operation\":\"mpoyfd\",\"description\":\"ogknygjofjdd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upewnwreitjzy\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/OperationsListMockTests.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/OperationsListMockTests.java deleted file mode 100644 index 1c92518256f2..000000000000 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/OperationsListMockTests.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.voiceservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.voiceservices.VoiceServicesManager; -import com.azure.resourcemanager.voiceservices.models.Operation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"jfddgmbmbe\",\"isDataAction\":true,\"display\":{\"provider\":\"tq\",\"resource\":\"ol\",\"operation\":\"fpsalgbqu\",\"description\":\"gjyjgzjaoyfhrtxi\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - VoiceServicesManager manager = - VoiceServicesManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/PrimaryRegionPropertiesTests.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/PrimaryRegionPropertiesTests.java deleted file mode 100644 index b8205e9d00b4..000000000000 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/PrimaryRegionPropertiesTests.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.voiceservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.voiceservices.models.PrimaryRegionProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrimaryRegionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrimaryRegionProperties model = - BinaryData - .fromString( - "{\"operatorAddresses\":[\"bcryffdfd\",\"sy\",\"expa\",\"jakhmsbzjh\"],\"esrpAddresses\":[\"evdphlxaol\",\"hqtrgqjbpf\"],\"allowedSignalingSourceAddressPrefixes\":[\"inzgvfcj\"],\"allowedMediaSourceAddressPrefixes\":[\"oxxjtfelluwf\",\"it\"]}") - .toObject(PrimaryRegionProperties.class); - Assertions.assertEquals("bcryffdfd", model.operatorAddresses().get(0)); - Assertions.assertEquals("evdphlxaol", model.esrpAddresses().get(0)); - Assertions.assertEquals("inzgvfcj", model.allowedSignalingSourceAddressPrefixes().get(0)); - Assertions.assertEquals("oxxjtfelluwf", model.allowedMediaSourceAddressPrefixes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrimaryRegionProperties model = - new PrimaryRegionProperties() - .withOperatorAddresses(Arrays.asList("bcryffdfd", "sy", "expa", "jakhmsbzjh")) - .withEsrpAddresses(Arrays.asList("evdphlxaol", "hqtrgqjbpf")) - .withAllowedSignalingSourceAddressPrefixes(Arrays.asList("inzgvfcj")) - .withAllowedMediaSourceAddressPrefixes(Arrays.asList("oxxjtfelluwf", "it")); - model = BinaryData.fromObject(model).toObject(PrimaryRegionProperties.class); - Assertions.assertEquals("bcryffdfd", model.operatorAddresses().get(0)); - Assertions.assertEquals("evdphlxaol", model.esrpAddresses().get(0)); - Assertions.assertEquals("inzgvfcj", model.allowedSignalingSourceAddressPrefixes().get(0)); - Assertions.assertEquals("oxxjtfelluwf", model.allowedMediaSourceAddressPrefixes().get(0)); - } -} diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/ServiceRegionPropertiesTests.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/ServiceRegionPropertiesTests.java deleted file mode 100644 index c2e07d7ab3cd..000000000000 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/ServiceRegionPropertiesTests.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.voiceservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.voiceservices.models.PrimaryRegionProperties; -import com.azure.resourcemanager.voiceservices.models.ServiceRegionProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServiceRegionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceRegionProperties model = - BinaryData - .fromString( - "{\"name\":\"pjoxzjnch\",\"primaryRegionProperties\":{\"operatorAddresses\":[\"jspodmailzyde\",\"o\",\"wyahuxinpmqnja\"],\"esrpAddresses\":[\"xj\",\"prozvcputegjvwmf\",\"atscmd\",\"pjhulsuuvmkj\"],\"allowedSignalingSourceAddressPrefixes\":[\"rwfndiod\"],\"allowedMediaSourceAddressPrefixes\":[\"lwejdpv\",\"ryo\",\"psoacctazakljl\"]}}") - .toObject(ServiceRegionProperties.class); - Assertions.assertEquals("pjoxzjnch", model.name()); - Assertions.assertEquals("jspodmailzyde", model.primaryRegionProperties().operatorAddresses().get(0)); - Assertions.assertEquals("xj", model.primaryRegionProperties().esrpAddresses().get(0)); - Assertions - .assertEquals("rwfndiod", model.primaryRegionProperties().allowedSignalingSourceAddressPrefixes().get(0)); - Assertions.assertEquals("lwejdpv", model.primaryRegionProperties().allowedMediaSourceAddressPrefixes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceRegionProperties model = - new ServiceRegionProperties() - .withName("pjoxzjnch") - .withPrimaryRegionProperties( - new PrimaryRegionProperties() - .withOperatorAddresses(Arrays.asList("jspodmailzyde", "o", "wyahuxinpmqnja")) - .withEsrpAddresses(Arrays.asList("xj", "prozvcputegjvwmf", "atscmd", "pjhulsuuvmkj")) - .withAllowedSignalingSourceAddressPrefixes(Arrays.asList("rwfndiod")) - .withAllowedMediaSourceAddressPrefixes(Arrays.asList("lwejdpv", "ryo", "psoacctazakljl"))); - model = BinaryData.fromObject(model).toObject(ServiceRegionProperties.class); - Assertions.assertEquals("pjoxzjnch", model.name()); - Assertions.assertEquals("jspodmailzyde", model.primaryRegionProperties().operatorAddresses().get(0)); - Assertions.assertEquals("xj", model.primaryRegionProperties().esrpAddresses().get(0)); - Assertions - .assertEquals("rwfndiod", model.primaryRegionProperties().allowedSignalingSourceAddressPrefixes().get(0)); - Assertions.assertEquals("lwejdpv", model.primaryRegionProperties().allowedMediaSourceAddressPrefixes().get(0)); - } -} diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLineInnerTests.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLineInnerTests.java deleted file mode 100644 index 39a16cc80822..000000000000 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLineInnerTests.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.voiceservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.voiceservices.fluent.models.TestLineInner; -import com.azure.resourcemanager.voiceservices.models.TestLinePurpose; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TestLineInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TestLineInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"phoneNumber\":\"ypnddhsgcb\",\"purpose\":\"Manual\"},\"location\":\"hejkotynqgou\",\"tags\":{\"gakeqsr\":\"dlikwyqkgfgibma\",\"qqedqytbciqfou\":\"yb\"},\"id\":\"lmmnkzsmodmglo\",\"name\":\"gpbkwtmut\",\"type\":\"uqktap\"}") - .toObject(TestLineInner.class); - Assertions.assertEquals("hejkotynqgou", model.location()); - Assertions.assertEquals("dlikwyqkgfgibma", model.tags().get("gakeqsr")); - Assertions.assertEquals("ypnddhsgcb", model.phoneNumber()); - Assertions.assertEquals(TestLinePurpose.MANUAL, model.purpose()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TestLineInner model = - new TestLineInner() - .withLocation("hejkotynqgou") - .withTags(mapOf("gakeqsr", "dlikwyqkgfgibma", "qqedqytbciqfou", "yb")) - .withPhoneNumber("ypnddhsgcb") - .withPurpose(TestLinePurpose.MANUAL); - model = BinaryData.fromObject(model).toObject(TestLineInner.class); - Assertions.assertEquals("hejkotynqgou", model.location()); - Assertions.assertEquals("dlikwyqkgfgibma", model.tags().get("gakeqsr")); - Assertions.assertEquals("ypnddhsgcb", model.phoneNumber()); - Assertions.assertEquals(TestLinePurpose.MANUAL, model.purpose()); - } - - @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/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLineListResultTests.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLineListResultTests.java deleted file mode 100644 index 38efe5b29754..000000000000 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLineListResultTests.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.voiceservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.voiceservices.fluent.models.TestLineInner; -import com.azure.resourcemanager.voiceservices.models.TestLineListResult; -import com.azure.resourcemanager.voiceservices.models.TestLinePurpose; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TestLineListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TestLineListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"phoneNumber\":\"gbwjzrnf\",\"purpose\":\"Manual\"},\"location\":\"gispemvtzfkufubl\",\"tags\":{\"v\":\"xqeofjaeqjhqjba\",\"zgcwrw\":\"smjqulngsntnbyb\"},\"id\":\"lxxwrljdouskc\",\"name\":\"vkocrcjdkwtn\",\"type\":\"xbnjbiksq\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"phoneNumber\":\"sainqpjwnzl\",\"purpose\":\"Manual\"},\"location\":\"mppeebvmgxs\",\"tags\":{\"jczdzevndh\":\"yqduujit\",\"feusnhut\":\"rwpdappdsbdkvwrw\",\"xhocdgeablgphuti\":\"eltmrldhugjzzdat\"},\"id\":\"ndv\",\"name\":\"aozwyiftyhxhu\",\"type\":\"okftyxolniwpwcuk\"}],\"nextLink\":\"kgiawxklryplwck\"}") - .toObject(TestLineListResult.class); - Assertions.assertEquals("gispemvtzfkufubl", model.value().get(0).location()); - Assertions.assertEquals("xqeofjaeqjhqjba", model.value().get(0).tags().get("v")); - Assertions.assertEquals("gbwjzrnf", model.value().get(0).phoneNumber()); - Assertions.assertEquals(TestLinePurpose.MANUAL, model.value().get(0).purpose()); - Assertions.assertEquals("kgiawxklryplwck", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TestLineListResult model = - new TestLineListResult() - .withValue( - Arrays - .asList( - new TestLineInner() - .withLocation("gispemvtzfkufubl") - .withTags(mapOf("v", "xqeofjaeqjhqjba", "zgcwrw", "smjqulngsntnbyb")) - .withPhoneNumber("gbwjzrnf") - .withPurpose(TestLinePurpose.MANUAL), - new TestLineInner() - .withLocation("mppeebvmgxs") - .withTags( - mapOf( - "jczdzevndh", - "yqduujit", - "feusnhut", - "rwpdappdsbdkvwrw", - "xhocdgeablgphuti", - "eltmrldhugjzzdat")) - .withPhoneNumber("sainqpjwnzl") - .withPurpose(TestLinePurpose.MANUAL))) - .withNextLink("kgiawxklryplwck"); - model = BinaryData.fromObject(model).toObject(TestLineListResult.class); - Assertions.assertEquals("gispemvtzfkufubl", model.value().get(0).location()); - Assertions.assertEquals("xqeofjaeqjhqjba", model.value().get(0).tags().get("v")); - Assertions.assertEquals("gbwjzrnf", model.value().get(0).phoneNumber()); - Assertions.assertEquals(TestLinePurpose.MANUAL, model.value().get(0).purpose()); - Assertions.assertEquals("kgiawxklryplwck", model.nextLink()); - } - - @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/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLinePropertiesTests.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLinePropertiesTests.java deleted file mode 100644 index 79dd7b715676..000000000000 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLinePropertiesTests.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.voiceservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.voiceservices.fluent.models.TestLineProperties; -import com.azure.resourcemanager.voiceservices.models.TestLinePurpose; -import org.junit.jupiter.api.Assertions; - -public final class TestLinePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TestLineProperties model = - BinaryData - .fromString("{\"provisioningState\":\"Failed\",\"phoneNumber\":\"gcue\",\"purpose\":\"Automated\"}") - .toObject(TestLineProperties.class); - Assertions.assertEquals("gcue", model.phoneNumber()); - Assertions.assertEquals(TestLinePurpose.AUTOMATED, model.purpose()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TestLineProperties model = - new TestLineProperties().withPhoneNumber("gcue").withPurpose(TestLinePurpose.AUTOMATED); - model = BinaryData.fromObject(model).toObject(TestLineProperties.class); - Assertions.assertEquals("gcue", model.phoneNumber()); - Assertions.assertEquals(TestLinePurpose.AUTOMATED, model.purpose()); - } -} diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLineUpdateTests.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLineUpdateTests.java deleted file mode 100644 index bfd6cf4d2732..000000000000 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLineUpdateTests.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.voiceservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.voiceservices.models.TestLineUpdate; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TestLineUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TestLineUpdate model = - BinaryData.fromString("{\"tags\":{\"bmdg\":\"kdosvqw\"}}").toObject(TestLineUpdate.class); - Assertions.assertEquals("kdosvqw", model.tags().get("bmdg")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TestLineUpdate model = new TestLineUpdate().withTags(mapOf("bmdg", "kdosvqw")); - model = BinaryData.fromObject(model).toObject(TestLineUpdate.class); - Assertions.assertEquals("kdosvqw", model.tags().get("bmdg")); - } - - @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/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLinesCreateOrUpdateMockTests.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLinesCreateOrUpdateMockTests.java deleted file mode 100644 index 5412f898db7e..000000000000 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLinesCreateOrUpdateMockTests.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.voiceservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.voiceservices.VoiceServicesManager; -import com.azure.resourcemanager.voiceservices.models.TestLine; -import com.azure.resourcemanager.voiceservices.models.TestLinePurpose; -import java.nio.ByteBuffer; -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 org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TestLinesCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"phoneNumber\":\"icxm\",\"purpose\":\"Manual\"},\"location\":\"wqvhkhixuigdt\",\"tags\":{\"m\":\"objoghmewu\"},\"id\":\"uhrzayvvt\",\"name\":\"gvdfgiotkftutq\",\"type\":\"ln\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - VoiceServicesManager manager = - VoiceServicesManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - TestLine response = - manager - .testLines() - .define("dkexxppofm") - .withRegion("exhd") - .withExistingCommunicationsGateway("ctbzaq", "qsycbkbfkgu") - .withTags(mapOf("jnxqbzvddntwn", "bqe")) - .withPhoneNumber("fjpgddtocjjxhvp") - .withPurpose(TestLinePurpose.MANUAL) - .create(); - - Assertions.assertEquals("wqvhkhixuigdt", response.location()); - Assertions.assertEquals("objoghmewu", response.tags().get("m")); - Assertions.assertEquals("icxm", response.phoneNumber()); - Assertions.assertEquals(TestLinePurpose.MANUAL, response.purpose()); - } - - @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/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLinesDeleteMockTests.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLinesDeleteMockTests.java deleted file mode 100644 index e8977f6908bd..000000000000 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLinesDeleteMockTests.java +++ /dev/null @@ -1,63 +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.voiceservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.voiceservices.VoiceServicesManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TestLinesDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - VoiceServicesManager manager = - VoiceServicesManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .testLines() - .delete("jionpimexgstxgc", "odgmaajrmvdjwz", "lovmclwhijcoe", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLinesGetWithResponseMockTests.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLinesGetWithResponseMockTests.java deleted file mode 100644 index 1e47cfd56914..000000000000 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLinesGetWithResponseMockTests.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.voiceservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.voiceservices.VoiceServicesManager; -import com.azure.resourcemanager.voiceservices.models.TestLine; -import com.azure.resourcemanager.voiceservices.models.TestLinePurpose; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TestLinesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Succeeded\",\"phoneNumber\":\"c\",\"purpose\":\"Manual\"},\"location\":\"ljavbqid\",\"tags\":{\"dj\":\"jzyulpk\",\"xzlocxscp\":\"rlkhbzhfepgzgq\"},\"id\":\"ierhhbcsglummaj\",\"name\":\"j\",\"type\":\"odxobnbdxkqpxok\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - VoiceServicesManager manager = - VoiceServicesManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - TestLine response = - manager - .testLines() - .getWithResponse("bznorcjxvsnby", "qabnmoc", "cyshurzafbljjgp", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ljavbqid", response.location()); - Assertions.assertEquals("jzyulpk", response.tags().get("dj")); - Assertions.assertEquals("c", response.phoneNumber()); - Assertions.assertEquals(TestLinePurpose.MANUAL, response.purpose()); - } -} diff --git a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLinesListByCommunicationsGatewayMockTests.java b/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLinesListByCommunicationsGatewayMockTests.java deleted file mode 100644 index f25213639b4f..000000000000 --- a/sdk/voiceservices/azure-resourcemanager-voiceservices/src/test/java/com/azure/resourcemanager/voiceservices/generated/TestLinesListByCommunicationsGatewayMockTests.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.voiceservices.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.voiceservices.VoiceServicesManager; -import com.azure.resourcemanager.voiceservices.models.TestLine; -import com.azure.resourcemanager.voiceservices.models.TestLinePurpose; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TestLinesListByCommunicationsGatewayMockTests { - @Test - public void testListByCommunicationsGateway() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"phoneNumber\":\"sne\",\"purpose\":\"Automated\"},\"location\":\"wzjeiach\",\"tags\":{\"eeh\":\"sflnrosfqp\",\"swjdkirso\":\"zvypyqrimzinp\"},\"id\":\"dqxhcrmnohjtckwh\",\"name\":\"soifiyipjxsqw\",\"type\":\"gr\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - VoiceServicesManager manager = - VoiceServicesManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .testLines() - .listByCommunicationsGateway("fsrpymzidnse", "cxtbzsg", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("wzjeiach", response.iterator().next().location()); - Assertions.assertEquals("sflnrosfqp", response.iterator().next().tags().get("eeh")); - Assertions.assertEquals("sne", response.iterator().next().phoneNumber()); - Assertions.assertEquals(TestLinePurpose.AUTOMATED, response.iterator().next().purpose()); - } -}